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

    save basecontainer to file

    SDK Help
    0
    9
    630
    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 16/09/2004 at 22:55, xxxxxxxx wrote:

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

      ---------
      Is ti possible to write a single basecontainer to a file, and later restore it from the file?
      I dont want to store it in the project file, but in an seperate file.

      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 17/09/2004 at 05:17, xxxxxxxx wrote:

        I don´t think so, except you extract the container values and write those down. Why don´t you want to store it in the project file or in the worldcontainer?

        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 17/09/2004 at 05:39, xxxxxxxx wrote:

          Hm, thought there maybe is a function which writes the container to a file, internally surely there is one.
          The reason...how to say that in two sentences... I build an import manager, wizard based, independent import modules can be registered there at runtime and processed, with module specific configuration steps. It would be a nice feature if I could record the configuration steps in focus to write them to a file, for kind of import macro. Therefor the module import steps need a generic storage format, exactly what a BaseContainer is.
          Of course I can write my own baseContainer-write-to-file function, but thats some work to do, including some overhead in the container. Thought it is maybe already done somewhere.

          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 17/09/2004 at 06:39, xxxxxxxx wrote:

            Have you looked into a PrefsDialogHookClass? This is specifically designed to allow plugins to store preference data (stored in BaseContainers or whatnot).

            In general, BaseContainers are saved to file (i.e. C4D file) by default and already have write/read functions but they are called internally.

            Barring that, you could just as easily use 'system-dependent' read/write routines to your own file, but then, yes, this will require Getting and Setting the data to/from the BaseContainers from/to the file using your own routines.

            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 17/09/2004 at 06:52, xxxxxxxx wrote:

              PrefsDialogHookClass reads nice, not for this point, but for some other things we have to do 🙂
              For the macros, I want to have the possibility to save a macro of the import process I just did, and reload it later, so there will be a bunch of macros with the project.
              Maybe I'll write the macro information into the documents container. Then they'll be stored, but connected to my project. So if I would need the same import process in another project, I cannot use the macro again.
              Well, a write to file function for a basecontainer would be nice....I'll write it on my long list of "class libs I always wanted to write, but never had the time to" 🙂

              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 17/09/2004 at 06:59, xxxxxxxx wrote:

                Quote: _Maybe I'll write the macro information into the documents container. Then they'll be stored, but connected to my project. So if I would need the same import process in another project, I cannot use the macro again.
                >
                > * * *
                _


                That´s why I suggested to store it in the WorldContainer or the PluginWorldContainer. They are saved with Cinema 4D and not connected to any project.

                Best
                Samir

                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 17/09/2004 at 07:03, xxxxxxxx wrote:

                  but the the problem is, that the macros are connected to cinema. on our target projects, more than one person will work at the same time, so everyone would have to make his own macros.
                  bascontainertofile would be the best, independent files everyone can use.

                  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 17/09/2004 at 07:24, xxxxxxxx wrote:

                    I think you can make those library functions quite short if you use this trick... 😉

                        
                        
                        const LONG UNIQUE_ID = 42;  
                        const DUMMY_OBJECT_TYPE = Osphere;
                        
                        
                        
                        
                        Filename fn;  
                        fn.FileSelect(FSTYPE_ANYTHING, GE_SAVE);
                        
                        
                        
                        
                        {  
                          BaseContainer bc;  
                          bc.SetString(1000, "Test");
                        
                        
                        
                        
                          AutoAlloc<BaseDocument> doc; if (!doc) return FALSE;  
                          AutoAlloc<BaseObject> obj(DUMMY_OBJECT_TYPE); if (!obj) return FALSE;  
                          obj->SetData(bc);
                        
                        
                        
                        
                          doc->InsertObject(obj, NULL, NULL);  
                          WriteHyperFile(doc, obj, fn, UNIQUE_ID);  
                          obj->Remove();  
                        }
                        
                        
                        
                        
                        {  
                          AutoAlloc<BaseDocument> doc; if (!doc) return FALSE;  
                          AutoAlloc<BaseObject> obj(DUMMY_OBJECT_TYPE); if (!obj) return FALSE;
                        
                        
                        
                        
                          doc->InsertObject(obj, NULL, NULL);  
                          ReadHyperFile(doc, obj, fn, UNIQUE_ID, NULL);  
                          obj->Remove();  
                            
                          GePrint(obj->GetData().GetString(1000));  
                        }
                    
                    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 20/09/2004 at 06:09, xxxxxxxx wrote:

                      😃 thats the thing I wanted!

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