Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Maxon Cinema 4D How do I get the current frame being rendered in a Python tag?

  • How do I get the current frame being rendered in a Python tag?

    Posted by Max Tomren on October 18, 2018 at 5:15 pm

    Using doc.GetTime().GetFrame(doc.GetFps()) works fine in the editor, but i can’t find an alternative to use while rendering?


    import c4d

    def main():
    doc = c4d.documents.GetActiveDocument()

    currentFrame = doc.GetTime().GetFrame(doc.GetFps())
    print currentFrame

    children = op.GetObject().GetChildren()
    childIndex = 0

    for child in children:

    child.SetEditorMode(c4d.MODE_OFF)
    child.SetRenderMode(c4d.MODE_OFF)

    if child.GetBit(c4d.BIT_ACTIVE):
    child.SetEditorMode(c4d.MODE_ON)
    child.SetRenderMode(c4d.MODE_ON)

    if childIndex == currentFrame:
    child.SetEditorMode(c4d.MODE_ON)
    child.SetRenderMode(c4d.MODE_ON)

    childIndex += 1

    Ivan de Wolf replied 3 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Ivan de Wolf

    May 27, 2022 at 9:19 pm

    Hi Max!

    Any luck on this? I am needing this solution too! 🙂

    Cheers,

    Ivan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy