Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Sub-frame document time

    Cinema 4D SDK
    c++ windows
    2
    3
    593
    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.
    • WickedPW
      WickedP
      last edited by

      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.

      wickedp.com

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @WickedP
        last edited by ferdinand

        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 of 1 fps and you are at frame 2 then that is equal to 2 seconds. You now cannot just make up a time 2.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 with CCurve.GetValue sample things directly. This only works for tracks of type bool, int, float (and tracks you can decompose into these types such as Vector or Matrix). 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

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • WickedPW
          WickedP
          last edited by

          Is there any way to get around the apparent hard-coded maximum frame rate limit?

          WP.

          wickedp.com

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