Saving data with a file



  • 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



  • 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.



  • 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



  • 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.)


Log in to reply