Getting basic animation info



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

    On 25/09/2010 at 18:25, xxxxxxxx wrote:

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

    ---------
    I'm trying to get some basic animation info from Melange, but I've been having difficulties.
    How can I get the start/end frame?
    The BaseDocument doesn't have GetMinTime() or GetMaxTime(), unlike the C++ SDK, and the docpref member is private.
    // doesn't work
    LONG start_frame = c4ddoc.docpref.GetMinTime().GetFrame(c4ddoc.GetFps());
    LONG end_frame   = c4ddoc.docpref.GetMaxTime().GetFrame(c4ddoc.GetFps());
    There are no methods in BaseDocument that explicitly return docpref, so I have no idea how to access it.



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

    On 30/09/2010 at 01:43, xxxxxxxx wrote:

    Most of the attributes you can set/get with SetParameter()/GetParameter().
    (to get the name of a parameter you can drag it from the attribute manager into the edit field of the console window in cinema)

    to get min and max frames please try this:

    _GeData mydata;
    Real start_time = 0.0, end_time = 0.0;
    LONG start_frame = 0, end_frame = 0, fps = 0;

    // get fps
    if (c4ddoc.GetParameter(DOCUMENT_FPS,mydata))
    fps = mydata.GetLong();

    // get start and end time
    if (c4ddoc.GetParameter(DOCUMENT_MINTIME,mydata))
    start_time = mydata.GetTime().Get();
    if (c4ddoc.GetParameter(DOCUMENT_MAXTIME,mydata))
    end_time = mydata.GetTime().Get();

    // calculate start and end frame
    start_frame = start_time * fps;
    end_frame   = end_time * fps;_

    Jens



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

    On 30/09/2010 at 17:32, xxxxxxxx wrote:

    Thanks for the help!


Log in to reply