THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/12/2010 at 04:35, xxxxxxxx wrote:
Cinema 4D Version: R11
Language(s) : C++ ;
I've got a small problem with the material plugin I'm writing. The plugin loads a text file which contains details used to create the description for the plugin. These details are loaded into a data structure which is a member of the plugin class. GetDDescription() uses this structure to build the interface, adding description elements as necessary.
This all works fine. However, if the user changes a value in the interface (such as a Real slider) and then hits undo, the description disappears. Tracing this through shows that the class constructor is being called whenever undo is hit, which automatically initialises the data structure - so of course there's nothing for GetDDescription to use to create the interface.
Ideally what I need is a data structure which isn't initialised by the class constructor. I've tried the structure as a static member variable and as a global variable, but all I get is linker errors or (if it does link) the plugin doesn't appear in the material manager.
Does anyone have any suggestions about how I could preserve the loaded data between calls to the plugin class constructor? If I could do that, the interface would be recreated after the constructor was called.