Calling system command on animation frame change
-
Hello.
I'm writing an exporting tool for POV-Ray now and thinking about external rendering of animation frames, assuming following scenario:for every_frame: save_scene(); call_renderer(); // As external system command
I'm very new to the C4D SDK, so could you please suggest to me, how to find the event of frame change and run commands on this event ?
Unfortunately, searching manuals still does not give any results.
Thanks in advance,
Sergey (Yesbird). -
hi,
Is this question still in the context of CineWare or are you using the "regular" SDK ?
As you saw, sometimes, not all functions are available in the Cineware SDK.Cheers,
Manuel -
Hi, @manuel.
I mean regular SDK here.
....
YB -
Hi, @manuel.
I only want to add, that Cineware-based solution even more preferable, as it much more easy to debug.
Btw, is there a way to detach C++ written plugin dll for rebuild time not restarting C4D application ?
....
YB -
Hi,
Cinema 4D SDK and Cineware are two distinct products with different goals. Cineware allow you to import in your application maxon technologies. This can allow your application to read c4d file or use our render engine to render your scene.
Cinema 4D sdk allow to extend Cinema 4D possibilities like creating a renderer integrated inside Cinema 4D.
I would rather use the Cinema 4D SDK where you can create a VideoPostData. This is how Render Engine are implemented. This pluging type will give you access to the function Execute. This function is called at different points during the render process. You can have a look at this thread where i used the function
CreateRay
to create my own lens effect.Inside this Execute function you should not have any issue about the scene update. (The scene is duplicated when it is rendered). If so, you can always "force" c4d to ExecutePasses to be sure that all objects have an updated cache. (In some cases, you must call ExecutePasses twice in a row). The system will send each frame one after the other you do not have to change the time manually.
If you want to change the document time, you can use SetTime but as said in the note, you must use
ExecutePasses
.Cineware is rough. If you want to read animation, you must access the animation track for every parameter and retrieve the cache of each generator.
Cheers,
Manuel -
Hi, Manuel.
Thank you for description of both approaches, now I can compare them and choose the best.
Regards,
Sergey (Yesbird).