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
    • Recent
    • Tags
    • Users
    • Login

    Getting basic animation info

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 234 Views
    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 Offline
      Helper
      last edited by

      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.

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

        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

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

          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!

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