DzPuppeteerElementData Class

Hi everyone,

I'm stuck, and could use the help of some Guru...

I've got the "IG Iray Lights and Shaders - Candles" package, and I'm trying to write a script that will burn down the candles automatically and animate the flicker on all the candles found in the scene. Doing this was relatively straightforward all the way down until I have a reference to the candle node. I can't figure out  how to set the properties for "Candle Height", "Flicker 1", and "Flicker 2". I understand that these properties are not like, say, a light source's Flux property, because they are not known at compile time (can I say that with QtScript?) and so I suspect that these properties are held in the node's dataelements. I dug down further until I got a reference to a DzPuppeteerElementData, and Google returns literally ZERO RESULTS. That is impressive.

So, I suspect the three properties I need are in there, but I don't know what the class interface is at all to get at them; and the base classes have virtually nothing in them.

Or is there another approach that I am missing?

Thanks,

Donald

Comments

  • The node is a dzEelement and DzElements have methods for finding properties, by name or by label http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/element_dz . Some properties can be found more directly, and it's a good idea to use the diect method if it exists in case the name/label change (as just happened with soem of the visibility controls) but custom properties like these should be safe to search for since they aren't built-in to DS.

  • Thanks for replying, Richard.

    I found the DzElements, but they seemed to have only the properties known to Daz, and not the ones implemented by the maker of the lighting package. I tried findPropertyByLabel( "Candle Height" ) but it was not found. I dumped out all the properties and found only the common ones like position and rotation.

    Are you saying that my assumption that the various Element Data classes were a way to attach class-specific data is incorrect, and there should be a descendant of DzElement in there somewhere with a label of "CandleHeight"?

    The class name DzPuppeteerElementData seems awfully promising... I can't think of why it would be in a model of a candle, if not to control its very few features...

    This is frustrating and has brought my project to a screeching halt because the candles that are as idle as a painted ship upon a pinted ocean look incredibly fake. Thanks for your input; I would appreciate any more direction you can give.

    Donald

  • DzPuppeteerElement isn't, aside from its existance and its inherited properties, exposed to scripting. As long as you have the node with the proeprty you should be able to findPropertyByLabel or findProperty using the name (which you can get by clicking the gear icon on the slider and selecting Parameter Settings) to get the property, which will be some kind of DzProperty (I would guess DzFloatProperty) and then you cana ccess its value (getValue/setValue as needed).

  • Thanks Richard,

    What you said seemed completely reasonable, but the API is the unfortunate combination of inconsistent and undocumented.

    findPropertyByLabel() finds the standard properties, but the custom ones not known to DAZ are only returned in the array returned by getPropertyGroups().getAllProperties(). And it returns just an array, not some associative container like DzPropertyList or something, so you have to iterate through it O(n) to find the desired property by label.

    Three days to make a candle flicker. An awesome program with terrible documentation is almost as bad as a terrible program.

  • Hm,  I've not noticed an issue using findByLabel in the past.

Sign In or Register to comment.