Hi all,
For some VRED plugins I scripted, I would like to store input or settings the user entered into the plugin within the VRED file, so the next time the user opens the file again and uses the plugin, their settings and preferences can be loaded as default. A lot of this data would be very specific to the content of the VRED file, therefore I don't want these settings to be user-specific, but file-specific. I already thought of the following two ways to achieve this:
I don't like either of these solutions because it doesn't seem very clean, and the user may unintentionally delete the data by clearing all MetaData or deleting the data VariantSet. Is there a way to store data in a VRED file through the Python API that doesn't affect the user experience and is safe / safer against unintended manipulation or deletion?
Thanks a lot in advance!
- Florian
Hi Florian,
The example provided by @chr33z in the post below may be an option.
https://forums.autodesk.com/t5/vred-forum/ability-to-get-node-data-removed/m-p/10529883/thread-id/90...
Regards,
Dan
Hi Dan,
Thanks for the quick reply! Yeah, that goes in the direction of the second approach I mentioned in my post. It should work if I use the Root node to store the ValuePair attachment in, since the Root node cannot be deleted, but I do still find it messy. I can imagine it gets tricky when several custom plugins all use this method and keep reading and writing to the same attachment. It is also not ideal for nested data structures, such as plugin-name>setting-type>setting>sub-setting (for example: collision-plugin>node-highlighting>material-properties>collider-node>diffuse-color). I was hoping for something built-in that allows for data storage similar to a json or xml format. If something like that doesn't exist, I am happy to accept your solution!
Can't find what you're looking for? Ask the community or share your knowledge.