Document settings



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

    On 19/09/2010 at 08:01, xxxxxxxx wrote:

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

    ---------
    I'm being particularly dense here, this is such a simple question. How do you get the document settings for a document? Here's what I'm doing in this code snippet, where 'doc' is a valid pointer to the current document:

    BaseContainer bc;   
    // get the document's base container   
    bc = doc->GetData(DOCUMENTSETTINGS_GENERAL);   
    // get the linear workflow setting   
    if(bc.GetBool(DOCUMENT_LINEARWORKFLOW))   
    // ... rest of code   
    

    Then the Bool I want always returns FALSE, even when the setting is clearly on. If I use doc->GetSettingsInstance(DOCUMENTSETTINGS_GENERAL) instead, it always returns a NULL pointer.

    There's something wrong with what I'm doing, but what? All I want to do is get the value of the linear workflow switch in the document settings.



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

    On 20/09/2010 at 01:23, xxxxxxxx wrote:

    The easiest way is to simply access the document's container directly.

      
    BaseContainer *data = doc->GetDataInstance();  
    Bool lwf = data->GetBool(DOCUMENT_LINEARWORKFLOW,TRUE);  
    

    doc- >GetData(DOCUMENTSETTINGS_GENERAL) returns the container IDs from 1000 to 1020. The LWF option has the ID of 2102. It is included in the container returned by DOCUMENTSETTINGS_DOCUMENT.

      
    DOCUMENT_TIME                    = 1000, // BASETIME  
    DOCUMENT_FPS                    = 1001, // LONG  
    DOCUMENT_MINTIME                = 1002, // BASETIME  
    DOCUMENT_MAXTIME                = 1003, // BASETIME  
    DOCUMENT_LOOPMINTIME            = 1004, // BASETIME  
    DOCUMENT_LOOPMAXTIME            = 1005, // BASETIME  
    DOCUMENT_LOD                    = 1006, // REAL  
    DOCUMENT_RENDERLOD                = 1007, // BOOL  
    DOCUMENT_USEANIMATION            = 1008, // BOOL  
    DOCUMENT_USEEXPRESSIONS            = 1009, // BOOL  
    DOCUMENT_USEGENERATORS            = 1010, // BOOL  
    DOCUMENT_USEDEFORMERS            = 1011, // BOOL  
    DOCUMENT_PATH                    = 1012, // FILENAME  
    DOCUMENT_NAME                    = 1013, // FILENAME  
    DOCUMENT_STATEX                    = 1014, // BOOL  
    DOCUMENT_STATEY                    = 1015, // BOOL  
    DOCUMENT_STATEZ                    = 1016, // BOOL  
    DOCUMENT_STATEW                    = 1017, // BOOL  
    DOCUMENT_USERCHANGE                = 1018, // BOOL  
    DOCUMENT_MODE                    = 1019, // LONG  
    DOCUMENT_ACTION                    = 1020, // LONG  
    

    cheers,
    Matthias



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

    On 20/09/2010 at 04:05, xxxxxxxx wrote:

    Aha, now I understand, thank you!

    When you have a moment, could the docs on this be upgraded? For DOCUMENTSETTINGS_GENERAL, the SDK says 'see ddoc.h'. Which I did, and the LWF flag is part of the enum, so it made me think the returned container would include that setting. Also, DOCUMENTSETTINGS_DOCUMENT is marked in the docs as 'Private!' which makes you think it shouldn't be used, when it obviously can be.

    Thanks,

    Steve


Log in to reply