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

    Saving data with a file

    SDK Help
    0
    4
    323
    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

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

      On 14/02/2004 at 09:35, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      I want to be able to save some data inside a c4d file (data created by a plug-in) so that, when the c4d file is saved, the data is saved along with it. This way, when the c4d file is loaded back, calling the plug-in again (a menu plug-in) it can access the previously saved data. Possible?
      Thank you very much in advance.

      Rui Batista

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

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

        On 15/02/2004 at 16:13, xxxxxxxx wrote:

        In C++ you could store this in the document container under a unique ID. In C.O.F.F.E.E. this isn't officially supported, since there's no Get/SetContainer() in the docs for BaseDocument. But it seems to work anyway.

            
            
            var bc = doc->GetContainer();  
            println(bc->GetString(UNIQUE_ID));  
            bc->SetData(UNIQUE_ID, "Test");  
            doc->SetContainer(bc);
        

        To store many values, combine them into a container and store it as a sub-container with the unique ID. Then the values inside of it needn't have unique IDs.

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

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

          On 16/02/2004 at 02:46, xxxxxxxx wrote:

          Thank you very much, Mikael.
          I will give it a try.
          Anyway, how can I store a sub-container? It may be simpler than I'm thinking but I guess I never did anything similar.

          Rui Batista

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

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

            On 16/02/2004 at 20:15, xxxxxxxx wrote:

            Just use SetData() with a container, the GetContainer() to get it back. (I think.)

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