Sub-frame document time
-
Hi folks,
I have a document in memory and I need to evaluate data to a sub-frame time value. The issue I'm getting is that when I do this:
BaseTime time = doc->GetTime(); // adjust time numerator here doc->SetTime(time); //SetDocumentTime(doc,time); doc->ExecutePasses(...);
the document time is floored to the nearest frame, and does not take on the sub-frame value. I can see this, because straight after I execute the document and pull the time again, it's reverted back to the original floored frame. I can however, change to the next full frame.
I've tried other methods like SetDocumentTime() to no avail.
Is there a trick I'm missing to this?
WP.
-
Hey @WickedP,
Thank you for reaching out to us. Your question is a bit like asking why one cannot fit 410 ml into a jar which one before measured to fit exactly 0.4 liters. Seconds,
BaseTime
, and frames are all just different units of time. Just because you switch your unit from frames to seconds, this does not mean that this suddenly changes the time value.So, when there are
4
frames in a document with a resolution of1 fps
and you are at frame2
then that is equal to2 seconds
. You now cannot just make up a time2.2 seconds
as the document still has only four frames. The broader answer would be that Cinema 4D has no builtin sub-frame interpolation. Some things implement sub-frame sampling themselves (as for example dynamics do), for everything else you must do it manually.- Increase the FPS of the document so that you can step with the desired precision. Increasing the FPS of a document can have unforeseen consequences for a document, as renderings at the end of the day operate in frames and the user might have planned his or her scene based on that.
- Go to the
CCurve
level and withCCurve.GetValue
sample things directly. This only works for tracks of typebool, int, float
(and tracks you can decompose into these types such asVector
orMatrix
). This will also not work for all simulations such Dynamics, Cloth, or Pyro (as they are not animations).
You should tell us more about what you want to achieve (I am on vacation tomorrow, so someone else will take over here) because as a general feature wish - "just step through a document with twice the resolution" - this will lead to many problems. When you are just after sampling some position, scale, rotation animations with a higher fidelity, I would go the
CCurve
route, as I would try to avoid at all costs messing with the FPS of an input document.Cheers,
Ferdinand -
Is there any way to get around the apparent hard-coded maximum frame rate limit?
WP.