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

    Get current frame at render time with Python?

    Cinema 4D SDK
    2
    3
    662
    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.
    • A
      android
      last edited by m_adam

      Hey guys,
      I have a python script that reads external files on a per frame basis and modifies the scene accordingly. This works great in the viewport but when I go to render it appears as though I can no longer get current time, because I can't get "active document" anymore while it's in the render process. Can someone point me in the correct direction of getting current time/frame during render? It seems so simple, I'm sure I'm overlooking something. Thanks!!

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @android first of all welcome in the plugincafe community.

        This happens because when you render the scene, the scene is actually copied and then rendered in order to avoid any kind of modification while it's rendering.

        If I understand correctly you are in a given context such as a python tag or a python generator. In any case please include this information in your next topics (and confirm it on this one).

        Finally, if you are in such context instead of retrieving the active document, you should retrieve the current document of the current object with BaseList2D.GetDocument.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • A
          android
          last edited by

          Hi Maxime, thanks for the response! I was aware that the scene gets copied, but unaware of the GetDocument function so it definitely makes sense! I will give that a try and report back. I have been trying this with both a python effector, as well as in a python xpresso node.

          Andrew

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