How To Access Element Data?
![Stretch65](https://secure.gravatar.com/avatar/4ac8e70dacce16d2ff5a602d714c5cf0?&r=pg&s=100&d=https%3A%2F%2Fvanillicon.com%2F4ac8e70dacce16d2ff5a602d714c5cf0_100.png)
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?)
![](https://hpclscruffy.daz3d.com/forums/uploads/thumbnails/FileUpload/f6/c41c79fa0177351e24e7e18c014080.png)
![](https://hpclscruffy.daz3d.com/forums/uploads/thumbnails/FileUpload/f6/c41c79fa0177351e24e7e18c014080.png)
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.