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

    Rendering and commandplugin

    SDK Help
    0
    6
    384
    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
      Helper
      last edited by

      On 11/02/2014 at 01:40, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R15 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I use a command plugin to calculate per frame the new positions of my objects.
      Everything is ok, except when rendering. Then nothing moves.

      Is this because I use a (command) plugin to calculate the new positions of objects and this plugin is not executed during rendering?
      Should I use a different sort of plugin (a tag or object plugin)?

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

        On 11/02/2014 at 06:14, xxxxxxxx wrote:

        I found an old (python) post that says 
        "do not use doc = GetActiveDocument(). For rendering the document is being cloned, which will mess up your frame based dirty calculations as the current frame in the active document won't change while rendering. Instead doc = op->GetDocument();"
        However, this does not seem to help.
        Change to another plugin type?

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

          On 11/02/2014 at 06:17, xxxxxxxx wrote:

          I guess you are using CallCommand() to invoke the command. The command will be executed
          with the document that is currently active, not the one that is currently being rendered, nor you
          can override this bevahiour. I guess you have a C++ plugin that is invoked via Python? Try a
          MessageData or SceneHook plugin. You can send custom messages to it and it can act accordingly.

          Best,
          -Niklas

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

            On 12/02/2014 at 02:13, xxxxxxxx wrote:

            No, I do not use CallCommand to start the renderer.
            When running the plugin in edit mode and then starting the animation with Play Forward, everything is ok.
            Objects are moved (animated).

            However, when I want to render (all frames) the animation does "run".
            Objects are not moved (not animated).

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

              On 12/02/2014 at 08:30, xxxxxxxx wrote:

              Basically, what Niklas said. When you render, Cinema first clones the active document and renders that. Your command plugin works only on the active document in the editor, not the one being rendered, so the cloned document doesn't 'know' that the object positions have been moved. So you'll need some other kind of plugin, e.g. a tag, do do this.

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

                On 15/02/2014 at 07:34, xxxxxxxx wrote:

                Ok, that is indeed what I thought. 
                Thanks, Pim

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