Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    PluginMaterial & undo problems

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 326 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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:

      User Information:
      Cinema 4D Version:   R11 
      Platform:      
      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.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/12/2010 at 06:53, xxxxxxxx wrote:

        Make sure to overload Read/Write/Copy if a data structure is not stored in the materials container.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 01/12/2010 at 08:11, xxxxxxxx wrote:

          Thanks Matthias. I'm a bit confused though. Aren't Read & Write only required when a file is loaded/saved? My problem isn't when loading and saving, those work fine - the data in the structure is transferred into the container when the description is created, so it shouldn't be necessary to overload those functions.

          Unless I've completely misunderstood (quite possible!)?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post