Output nodes have a is_active_output
property, but it doesn't seem possible to set this consistently.
I believe there's a bug where doing node.is_active_output = True
does nothing unless you first click in the UI on one of the output nodes to change which one is active, then after that node.is_active_output = True
will work.
However I need to stick to the current latest Blender version and cannot wait for this to be patched. Is there some other way to consistently set what the active material output node is? Preferably without deleting any nodes.