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 Document Settings

    SDK Help
    0
    4
    373
    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 07/05/2013 at 02:39, xxxxxxxx wrote:

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

      ---------
      Hello Everybody,

      I need to store custom document settings. I already did that with the R13 SDK by using >BaseContainer *bc = BaseDocument->GetSettingsInstance(DOCUMENTSETTINGS_DOCUMENT);

      and inserting a BaseContainer under the ID of my plug-in. Saving & loading actually worked like a charm, however, I wasn't sure if that's the correct way to do this. Or if this is even allowed.

      I'm even more unsure now that I had to check the R11.5 SDK (my plug-in has to support PPC Macs) to see what the ID for the document settings container is called in this version. There, the SETTINGS_DOCUMENT enum is noted with "Private!".

      So, how exactly should I store custom document settings?

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

        On 07/05/2013 at 08:07, xxxxxxxx wrote:

        The document has a built-in Hyperfile where you can store data.
        And it's one of the things I wish Maxon would make simpler to use. And make more robust. Like adding an image array function to them for one example.

        You'll have to use  three methods: Read(), Write, and CopyTo(). Just to save your data.
        And they all have to be in sync. Containing the exact same data in each method.
        IMHO. It's a horribly over complicated system. And once you try to save things like arrays and multiple data. It's becomes a real nightmare to use.

        If you can save your data in a base container and get away with it. I would do it that way and save yourself the headache of the HF system.
        But the HF is there if you really want to use it. Just don't expect it to be much fun. 😉

        -ScottA

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

          On 07/05/2013 at 10:08, xxxxxxxx wrote:

          Ah, I totally forgot about these methods.

          I always thought those only are called when an actual Node is being written (i.e. a BaseObject), but it looks like they also are called for SceneHooks.

          Awesome! It seems much more "cleaner" now.

          Thanks for your help!

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

            On 07/05/2013 at 12:33, xxxxxxxx wrote:

            Howdy,

            Also remember that a BaseDocument inherits from BaseList2D which has the GetDataInstance() function. If I'm not mistaken, there is where you can safely store a container that is your own plugin's ID, or at least that's how I've been doing it. 😉

            Adios,
            Cactus Dan

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