Unable to set active material output node using Python #96292
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#96292
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.29
Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash:
c77597cd0e
Worked: 3.0
This changed in
7e712b2d6a
Short description of error
It seems to be (inconsistently) no longer possible to set the world/shader node tree's active output using python.
Running
node.is_active_output = True
in a fresh scene does anything. But if you (in the UI) click on one of the output nodes, setting it as the active output, then from that point onwards doingnode.is_active_output = True
will indeed work.Exact steps for others to reproduce the error
node = C.scene.world.node_tree.nodes.new('ShaderNodeOutputWorld')
to create a new world output node. This node is namedWorld Output.001
. The original output node is namedWorld Output
.C.scene.world.node_tree.nodes['World Output'].is_active_output
- the result isTrue
as this is the original node.C.scene.world.node_tree.nodes['World Output.001'].is_active_output
- the result isFalse
as this is the new node.C.scene.world.node_tree.nodes['World Output.001'].is_active_output = True
. Nothing happens, the value remainsFalse
even after we set it.is_active_output
is nowTrue
for the new node)C.scene.world.node_tree.nodes['World Output.001'].is_active_output = True
again, this time it successfully changes the tree's active output to that node.As a side note, is there some other workaround way I can consistently set the node tree's active output? I need to fix an add-on and can't wait for this to be patched.
Added subscriber: @GregZaal
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm (to some extend).
In 3.0, it was possible to have 2 active outputs at the same time, setting
World Output.001
active did not setWorld Output
inactive (this was wrong, too).There has probably been some fix that does not allow for that anymore (otoh, it did not take into account that this prevents setting it active from python in some situations), will check
Added subscriber: @PratikPB2123
I guess ideally we have some
node_tree.set_active_output_node
function in the API, and not have to rely on the python code having to make sure to set all outputs toFalse
except one.I saw there was also a
node_tree.active_output
property, but this was always-1
and didn't seem writable.This changed in
7e712b2d6a
btw.Added subscriber: @JacquesLucke
Even though this was not quite right in 3.0 either, will still set this to High prio (since now it seems this is not possible to set at all).
@JacquesLucke: opinions?
Think that's the index of the active output socket in a node group.
The fix seems to be to make the other outputs of the same type inactive.
FYI, bug reports that require the python console are sometimes a bit annoying, because I have to type/copy so much every time I want to reproduce it. Usually I end up preparing myself a file that just has a small script in it that I can just run to reproduce the bug. It doesn't matter too much, but if you happen to report similar bugs in the future, maybe consider writing a small(!) script instead of using the console.
E.g. this is the script I used for this bug:
This issue was referenced by
40cbbe809c
This issue was referenced by
22a341d9d8
Changed status from 'Confirmed' to: 'Resolved'