Notifications
Clear all
[Closed] Access base class parameters of script extended class from c++ ?
Jun 18, 2009 10:25 am
Hi all,
Ive been trying to access the paramblock of a child class deriving from a simple object like sphere. Something like this
plugin geometry testSphere
name:"test sphere
category:"test"
classID:#(0x13456, 0x12468)
extends:sphere
replaceui:true
(
)
and from c++
Interface* ip = GetCOREInterface()
Object *obj = (Object*) ip->CreateInstance(GEOMOBJECT_CLASS_ID, Class_ID(0x13456, 0x12468))
char* toto = obj->GetObjectName() // name is correct
// Get a hold of the parameter block
IParamArray * params = obj->GetParamBlock()
assert(params)
The param block will be null.
Im trying to access SPHERE_RADIUS and others parameters from c++ to create objects like I want
Thanks !
3 Replies
Jun 18, 2009 10:25 am
IParamBlock2* GetParamBlock(int i)
Is defined from Animatable, so I can’t access it from Object
I tried to cast into a Animatable* but I suppose life isn’t that easy :rolleyes:
Jun 18, 2009 10:25 am
Solved it !
if you do
plugin geometry testSphere
name:”test sphere
category:“test”
classID:#(0x13456, 0x12468)
extends:sphere
replaceui:true
(
parameters basic
(
radius type:#float default: 0.0
segs type:#float default: 0.0
on radius set val do
(
delegate.radius = val
)
on segs set val do
(
delegate.segs = val
)
)
)
You’ll have a paramblock that you can access from Object