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

    different behaviour in pictureviewer

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 532 Views
    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.
    • H Offline
      Helper
      last edited by

      On 06/09/2016 at 10:01, xxxxxxxx wrote:

      Hi all,

      my tag plugin is working fine when pressing the play button in the timeline. But the (particle) calculations of the plugin seem to be completely ignored (or at least the plugin behaves very different) when I start the "render in pictureviewer".

      Do I have to consider anything in my code in respect to timeline vs. pictureviewer ?

      thanks.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 06/09/2016 at 11:00, xxxxxxxx wrote:

        When starting the "render in pictureviewer" the "message" method issues an event type "MSG_MULTI_DOCUMENTCLONED" meaning that the document has been cloned. This explains that all variables of my classes that I prepared before rendering are unset.

        Is there anything I can do to avoid that the document is cloned during render time ?

        thanks.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 06/09/2016 at 12:07, xxxxxxxx wrote:

          Originally posted by xxxxxxxx

          When starting the "render in pictureviewer" the "message" method issues
          an event type "MSG_MULTI_DOCUMENTCLONED" meaning that the document has
          been cloned. This explains that all variables of my classes that I
          prepared before rendering are unset.Is there anything I can do to avoid that the document is cloned during render time ?thanks.

          No. That's the way Cinema works when you render to the PV. You need to make sure that any class-level variables are correctly copied to the clone by implementing CopyTo() in all such classes. If you do that it should work fine, but you also need to remember that with any dynamic system the variables in one frame depend on previous frames. In other words, if you play your animation to frame x and then render to PV, it may not be the same as rendering in the viewport. If that happens you must render from the start to frame x to ensure everything is in the correct state.

          Steve

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 06/09/2016 at 13:26, xxxxxxxx wrote:

            Hi Steve, I wasn't aware of the CopyTo() call.

            It works perfectly !

            Thanks a lot !
            Jens

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 07/09/2016 at 08:48, xxxxxxxx wrote:

              Hi,

              glad you two were already able to solve the issue.

              For future readers, here some links relevant for this topic:

              Python docs on NodeData (especially read the notes on Read(), Write and CopyTo())

              In the C++ docs we already have some articles providing a bit more context and thus may be valuable for Python programmers as well:
              General Plugin Functions
              NodeData Read()/()Write
              NodeData CopyTo()

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