Regression: Can't make node tree links in Python script #113106
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113106
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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: macOS-14.0-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 1.2
Blender Version
Broken: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-09-27 23:25, hash:
13f5879e3c61
Worked: v3.6.4
Short description of error
I can't generate node tree link for 'ShaderNodeMix' node by Python script.
For example, ob is the material, bsdf is the 'Principled BSDF' node, mix_rgb_node is the 'ShaderNodeMix' node, and texImage is the 'ShaderNodeTexImage' node, if I run these two lines, it should create a link from the output of the mix_rgb_node to the 'Base Color' input of the bsdf node, and create a link from the output of texImage to the first or the second input of mix_rgb_node, but in v4.0 beta, nothing happen.
Exact steps for others to reproduce the error
Open provided file and run script.
Files with legacy mix node are working correct.
Fail to generate node tree link for 'ShaderNodeMix' nodeto Fail to generate node tree links for 'ShaderNodeMix' node by Python scriptFail to generate node tree links for 'ShaderNodeMix' node by Python scriptto Regression: Can't make node tree links in Python scriptRegression: Can't make node tree links in Python scriptto Can't make node tree links in Python scriptRetracting high priority, since I can reproduce this in 3.6 @artgolf1000 can you provide sample file where it works in 3.6 version?
I'm using 'ShaderNodeMixRGB' instead of 'ShaderNodeMix' in Blender 3.6.4, so it works without bug.
Can you upload the file that works?
Here is the file that works in Blender 3.6.4, the 'ShaderNodeMixRGB' node is created via Python script.
Thanks for file. It seems to work in 4.0 too, but the issue seems to be new Mix node.
Can't make node tree links in Python scriptto Regression: Can't make node tree links in Python scriptI haven't tried to reproduce it yet, but can you check that you are trying to make a link to the correct socket? Note that there are multiple sockets with the same but different identifiers and types. We are working towards improving this situation with different sockets with the same name.
I remembered that it did not work when Blender 4.0 Beta is just out, so I have to change to the new node of the same name, but the legacy node works correctly in the latest build of Blender 4.0 Beta, all sockets can be linked correctly by Python script.
Just looked into it again, the issue is indeed what I mentioned before, sorry for not being more clear.
This is not a bug but expected behavior. The behavior is a bit different than before, because the Mix node now supports different data types. All those data types have separate sockets. We are already working towards unifying these sockets into one (#113553).
Currently, when you say
mix_rgb_node.outputs['Result']
, you will get the float output of the node, but there is also e.g. a vector and color output with the same name. For historic reasons, usingnode.outputs['xxx']
uses the socket name instead of identifier. So currently, you need a different way to find the correct output socket that you want to link.The script from your file can be fixed like this:
Duplicate of #103395