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

    Time of a specific frame

    SDK Help
    0
    2
    254
    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

      On 04/03/2016 at 04:37, xxxxxxxx wrote:

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

      ---------
      Hello.

      Which is the best way to get the time of a specific frame (not current) in document ?
      BaseDocument's GetTime returns the time of current time.
      I need to give the frame as parameter and get the time in the same document.

      Thank you.

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

        On 04/03/2016 at 06:16, xxxxxxxx wrote:

        It would seem that if you get the frames-per-second (FPS) from the document it is simply a matter of setting time = frame / document->GetFps().  So you could call BaseTime setting the numerator (frame) and the FPS (denominator) separately.  or simpler yet is to construct the BaseTime using the constructor:

        BaseTime frameTime = BaseTime(frame, fps);
        

        This sets both the numerator to the frame value and the denominator to the frames-per-second value.  This is why you really don't need a method in BaseDocument that gets the time of the frame (but you do need a method that gets the frame at a time because of the internal storage of time in BaseTime).

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