2
$\begingroup$

While working on an Add-on that does node connection stuff, I came across a problem I can not find a solution to anywhere: The compositor nodes are only ever updated / evaluated, as long as there is a compositor space open somewhere. If you for instance have the image editor maximized, compositor node tree changes are not evaluated at all.

I am displaying the result of my Python node reconnections through the Viewer Node in the image editor. As long as somewhere there is a Compositor window open, this works. As soon as you switch that window to something else (like a 3D View), updates are not calculated at all.

here is a .blend file to test this, the GIF below shows how to trigger the behavior I described:

enter image description here

I have tried calling the update, update_tag and evaluated_get methods pretty much anywhere I can think of. Is there a way still to force a refresh?

$\endgroup$
1
$\begingroup$

Compositing output can be updated by rendering without any Render Layers nodes in the compositing node tree.

See documentation about Render Operators

bpy.ops.render.render(animation=False, write_still=False, use_viewport=False, layer="", scene="")

If I am not mistaken this use_viewport parameter seems to be for controlling if the render process is shown in the UI. It is false by default so it should not show the render in the UI unless specified otherwise.

$\endgroup$
  • $\begingroup$ unfortunately this won't trigger the update either. $\endgroup$ – aliasguru Jul 4 at 9:41
  • $\begingroup$ Could you share some bit of code to reproduce the issue? $\endgroup$ – Martynas Žiemys Jul 4 at 9:43
  • $\begingroup$ Did you mean you need to recalculate the compositing output? That happens if you render and do not have any Render Layer nodes. $\endgroup$ – Martynas Žiemys Jul 4 at 9:54
  • $\begingroup$ I'll update my question with a blend file, script included. In the meantime I'll test your idea with triggering rendering, this might work for such a case, has a lot of side effects though $\endgroup$ – aliasguru Jul 4 at 11:35
  • $\begingroup$ rendering does indeed trigger such an output update. however, it does a lot more, like opening a render output window, switching to Render Result, etc. I wonder if there is some operator other than that that could be called to trigger these updates? $\endgroup$ – aliasguru Jul 4 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.