Time of a specific frame

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

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


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.

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