I’ve found a similar problem where controls are added to the UI and don’t update the nodes, UNLESS the compositing node tree is selected in the node editor.
Doesn’t work:
Works:
Obviously, the location of the buttons will depend on your layout.
Yes, i found that too. If there is a opened window with compositing nodes during script execution, nodes updates. But if there is no window with compositing nodes during script run, nodes stay not updated.
Is there any way to update compositing node tree if there is no active compositing window during script execution?
Ok, so I think that the only way is to change the type of one window to node editor during script execution. But I can’t find, how tho change the type of the node editor window to “compositing”?
print(bpy.types.SpaceNodeEditor.tree_type)
returns
AttributeError: type object ‘SpaceNodeEditor’ has no attribute ‘tree_type’
I tried this without success. Nothing changes. If there is no opened node tree window, compositing nodes are not updated.
Now I try to change one window to the node editor type, then create compositing nodes. It works. But if I return window to the previous type during script execution, it doesn’t work.