In our Anima plugin we receive several calls to GetVirtualObjects and that's ok but we've found a issue, if I want to check if I'm in render right now I could use
if (hh->GetBuildFlags() & A_INTERNAL_RENDERER || hh->GetBuildFlags() & A_EXTERNAL_RENDERER)
rendering = true;
The problems is that I receive the same flag if I press 'C' (make editable) in my object and we'll need a different behaviour for rendering and make editable.
Is there any other tag I could check in the document or whatever?
Thank you in advance for any tip.
Hi @victor, sorry for the late reply, you can use CheckIsRunning, for this purpose.
Here a code sample from a Python Generator.
# main == GetVirtualObject
if c4d.CheckIsRunning(c4d.CHECKISRUNNING_EDITORRENDERING) or c4d.CheckIsRunning(c4d.CHECKISRUNNING_EXTERNALRENDERING):
Another option that will be more consistent is to listen to MSG_MULTI_RENDERNOTIFICATION which is a message sent to all BaseList2D of a scene, before and at the end of the rendering.