Rendering and commandplugin

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)?

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?

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.


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).

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.

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

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