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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Custom Plugin Data Saving

    SDK Help
    0
    4
    353
    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
      Helper
      last edited by

      On 22/10/2015 at 19:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      I looked up words like custom, data, saving, and whatnot but found no clear information on this. I need a nudge in the right direction on where to look. I want to go further with a plugin I've made and I'd like to use and retain some custom information that might get calculated during use. I'd also of course like to save states of the user data fields as well. My question is, how does one go about saving custom information like that. In a plugin like X-Particles for instance they have all sorts of stuff saved with the actual scene, particle ages, ids, colors, position vectors, etc. From what I've been reading some of this is automatic I guess, if your using the right base data types?

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

        On 23/10/2015 at 04:55, xxxxxxxx wrote:

        You need to overload the NodeData::Read(),::Write() virtual functions. They will be called when the c4d scene file is saved/loaded. There you can save/load your custom data into a HyperFile.

        You also want to overload CopyTo() for that matter for completeness.

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

          On 23/10/2015 at 07:48, xxxxxxxx wrote:

          So basically, I need to derive any new classes from NodeData to take advantage of data persistence?

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

            On 23/10/2015 at 10:43, xxxxxxxx wrote:

            There are special derived classes that you should derive your own plugin from, i.e. ObjectData, TagData, ShaderData etc. depending on what kind of plugin you want to create. These are all derived from NodeData.

            Check out the SDK docs for info on these subclasses.

            Of course you can also write data onto disc at any time. Overloading the provided virtual functions however makes sure you have maximum support.

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