3
$\begingroup$

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.

$\endgroup$
0

1 Answer 1

2
$\begingroup$

As of this patch the bug is solved. You'll either have to download the latest 3.2 alpha build or wait for the official release which will be in 3 or 4 months from now if I'm not mistaken.

Here's a snippet to toggle between 2 outputs in the world shader (inspired by developer Jacques Lucke in the bug report):

import bpy n1 = bpy.context.scene.world.node_tree.nodes['World Output'] n2 = bpy.context.scene.world.node_tree.nodes['World Output.001'] if not n1.is_active_output: n1.is_active_output = True else: n2.is_active_output = True 

![image|490x291](upload://bEMEzMZdHkuWbWSsH0FHI0uW5Eq.png)

$\endgroup$
2
  • $\begingroup$ Yeah as I understand it, now (as before) just setting is_active_output = True on any node will automatically set other output nodes to False and it should work. $\endgroup$ Commented Mar 23, 2022 at 21:32
  • $\begingroup$ Thanks for this, it also works for material outputs, but somehow nobody talks about that... $\endgroup$ Commented Oct 25, 2022 at 20:58

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.