Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Storing custom plugin settings or preferences in VRED file

2 REPLIES 2
Reply
Message 1 of 3
fbruchD4CS2
152 Views, 2 Replies

Storing custom plugin settings or preferences in VRED file

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: 

 

  • Store the data in the Values (Key/Value) section of a VariantSet with a predefined name 
  • Store the data as MetaData of a Scenegraph Node, e.g. the Root Node or an empty "Support" Node

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

2 REPLIES 2
Message 2 of 3

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

Message 3 of 3
fbruchD4CS2
in reply to: fbruchD4CS2

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.

Post to forums  

Autodesk Design & Make Report