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 identical document as the Render document

    Cinema 4D SDK
    python
    3
    5
    889
    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.
    • orestiskonO
      orestiskon
      last edited by orestiskon

      Hello,

      I'm trying to create a script where I export models from the document across different frames exactly as they appear in the animated render.

      However there are differences. The document is sampling a noise to drive values, and there could be minute differences between the editor document and the render document that is causing it to produce slightly different values.

      Is there a way to ensure in my script that I'm using the exact same document execution that the renderer is using?

      1 Reply Last reply Reply Quote 0
      • orestiskonO
        orestiskon
        last edited by

        I think I managed to make it work by using:

        c4d.documents.LoadDocument(docPath, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
        

        and then going to the end of the document and rewinding back to the beginning.

        Doing this on the active document didn't work.

        I'm using the Render execute passes as well, and the combination of all these seem to match the render results.

        1 Reply Last reply Reply Quote 0
        • orestiskonO
          orestiskon
          last edited by

          After more testing unfortunately there were still differences, not sure if I'm missing the proper way to go with it or if it's a limitation that the editor won't ever match the render state precisely.

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

            Hi @orestiskon the way to have a document identical to what is render, is to animate the document from the beginning to the targeted frame and evaluating the document each frame. The evaluation of a document is done via ExecutePasses.

            One important thing is that internally sometime Cinema 4D use several call to ExecutePasses to really have the final result. Usually calling it 3 time in a raw is enough.

            There is the basedocument_animate example which demonstrate how to animate a scene, one things to note is the use of DrawView, this internally does call ExecutePass beside also refreshing the ViewPort.

            Hope it helps,
            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • ferdinandF
              ferdinand
              last edited by

              Hello @orestiskon,

              without any further questions, we will consider this topic as solved by Tuesday, November the 2nd and flag it accordingly.

              Thank you for your understanding,
              Ferdinand

              MAXON SDK Specialist
              developers.maxon.net

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