THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/12/2009 at 08:43, xxxxxxxx wrote:
Cinema 4D Version: 11.5
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
We have a crash with some animated scenes, which happens during the execution of ExecutePasses - we call ExecutePasses on the local document in the InitRender function, when we detect that the local time is not the current frame's time (when the users chooses to render a specific frame, from the Render Options)
However, the same call to ExecutePasses perfectly works in the same context, with basic animations.
So, are there some rules to respect when calling ExecutePasses? How can we avoid such crashes in all cases?
On 09/12/2009 at 09:14, xxxxxxxx wrote:
Just another detail (maybe important) : in our case, ExecutePasses is called on the active document (retrieved by the shader by using GetActiveDocument()), not the copy of the document which is about to be rendered. Could it be the origin of the problem?
On 10/12/2009 at 01:47, xxxxxxxx wrote:
I have to investigate. But it's definitely a bad idea to use GetActiveDocumen() because the rendered document could be different than the active document. Remember that the user can switch documents in Cinema while rendering in the background.
On 10/12/2009 at 02:12, xxxxxxxx wrote:
Maybe you can tell for what reason you have to animate the document, it may be necessary to do this in a videopost. In general it should be done on a clone of the passed document.
On 10/12/2009 at 08:49, xxxxxxxx wrote:
Thank you for the reply.
In fact, the reason why we animate the active document and not the copy about to be rendered is because we have proxies in the active document, and those proxies are used to reflect the modifications of the C4D scene in our plugin's own internal scene - so, basically, we enforce the active document to be at time T_render to make sure that all positions and transformations are up-to-date when we update our internal scene based on the proxies located in the active document... (for now, we are not able to match the copied objects (those from the rendered document) to our proxy objects created in the master document - maybe that would be a solution for us, if we could know, for each object in the copied document, from which object in the original document it was copied...)
On 15/12/2009 at 10:02, xxxxxxxx wrote:
We managed to fix the crash by replacing those calls to ExecutePasses on the active document (now we directly recover our data from the rendered document, using the system of containers). I think that you don't need to investigate further, as ExecutePasses perfectly works on the same scene, when we call it in another place, not during render...
Thank you very much for your help solving this issue.