How To Access Element Data?
Stretch65
Posts: 166
Hi,
I've just noticed that I can add user-defined data to an object or figure when it's loaded (via the menu command Edit > Object > Element Data ...)
Just as an experiment for a shoe my G2F figure is wearing, I created an empty script file and added 2 key - value pairs (see screen grab below).
I then re-saved the shoe. So now the script executes when I re-load the shoe. If I now select the shoe in the Scene Pane, how do I access (in a script) the
the 2 key - value pairs that I created for the shoe?
(Also, in the script that executes when the shoe is loaded, how can that script access the shoe's scene data such as it's node or skeleton?)
Capture.png
846 x 738 - 109K
Post edited by Stretch65 on
Comments
Have you lookeed at the samples here? http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#post-load_data_items
I was kind of hoping for a simpler snippet, but I think I've figured out to do it. Every scene object appears to inherit a getDataItem() method, and from that there's getSettings(). Thanks anyway.