Sharing a property between nodes?
shoei321
Posts: 113
I would like to be able to have one instance of a property (DzFloatProperty in this case) be shared between two nodes. Something like this :
DzFloatProperty* prop = new DzFloatProperty();node1->addProperty(prop);node2->addProperty(prop);
The above code runs without error but the property is only listed under the first node. I believe this is possible in Daz however -- the Twist property appears to be shared between the Bend and Twist nodes in Genesis3 for Thigh/Shoulder/Forearm.
Any suggestions on how to do this?
Thanks
Comments
DzProperty::createAlias()
Create a property alias and put that alias on node2. A property alias has its own presentation, but will forward edits of all non-presentation values to the property it is an alias of.
-Rob
Thanks Rob. I've gotten that working now, but with one caveat -- If I save and reload the scene, the aliases are all missing. My code is essentially what you said :
The application log shows these messages on scene reload :
Do you have a broader example of alias usage you could copy & paste here?
Thanks
This helped also - Thanks Rob
The property and the alias must each have a name. The name for a given property (or property alias—which is really a subclass that forwards edits to the property it is an alias of) must be unique on a given element owner.
-Rob