CONFLICT BETWEEN INTERACTIVE RENDER AND PYTHON TAG FOR AUTOMATIC LABELING AND RE

Hello everyone. I’m requesting guidance on a rendering issue with Corona Render and Cinema 4D. I’ve created Python tags to automatically rename and label objects. When I run the Corona render, everything works normally. However, when I run the interactive Corona render, it seems the automatic tags are running continuously, causing the interactive render to refresh constantly, without progressing more than five steps. I understand I need to add code to the tags that stops the tag script when I render, perform an interactive render, or animate. I’ve tried a few lines of code, but it’s not working. Can anyone advise or help me? Thanks and regards.

Hi there,

When Corona Interactive Rendering (IR) is running, it watches for any changes in the scene. Every time your Python tag runs and modifies something (like renaming an object), Corona IR sees it as a change and restarts the render. Since the tag runs over and over, the IR keeps restarting and never gets past a few passes.

WHY THE USUAL FIX DOESN’T WORK:
We tested using c4d.CheckIsRunning() to detect when Corona IR is active, but Corona IR does not set any of Cinema 4D’s standard rendering flags. So we cannot use that method to skip the tag during IR.

THE FIX:
The solution is to make your tag only write to the scene when something actually needs to change. Before setting any value, first check if it is already correct.

Instead of this:

obj.SetName("MyNewName")

Do this:

if obj.GetName() != "MyNewName":
    obj.SetName("MyNewName")

This way, the name is set once on the first run. After that, the tag sees the name is already correct and does nothing. No scene change is triggered, and Corona IR can render without interruption.

Apply this same pattern to every line in your tag that modifies the scene (SetName, setting user data, changing parameters, etc.).

If you can share the actual code from your Python tags, we can give more specific help.