shaderNodeMix can not be connected to other sockets with python API #109257
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, 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
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
Core
Module
Development Management
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
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109257
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: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Intel(R) Iris(R) Xe Graphics Intel 4.5.0 - Build 31.0.101.4032
Blender Version
Broken: version: 3.5.1, branch: blender-v3.5-release, commit date: 2023-04-24 18:11, hash:
e1ccd9d4a1d3
Worked: I think never. https://docs.blender.org/api/3.4/bpy.types.ShaderNodeMix.html is new in 3.4
Short description of error
The out socket from ShaderNodeMix can not be connected to any input sockets by using python API. Blender think it's connected, but it's really not.
I tried the release candidate 3.6 and it seems to have the same error.
Exact steps for others to reproduce the error
Get the principled bsdf and check that nothing us connected to base color.
pbsdf = bpy.data.materials['Material'].node_tree.nodes['Principled BSDF']
pbsdf.inputs['Base Color'].is_linked
Create a ShaderNodeMix and change type to RGBA and check its output is not connected to anything.
shadermix = bpy.data.materials['Material'].node_tree.nodes.new('ShaderNodeMix')
shadermix.data_type = 'RGBA'
shadermix.outputs['Result'].is_linked
In the shader editor, move the created shaderNodeMix to the left so it will be easier to see it's not connected.
Connect output of ShaderNodeMix to principled bsdf base color.
Check that blender thinks they are connected even though no line is drawn between them.
bpy.data.materials['Material'].node_tree.links.new(pbsdf.inputs['Base Color'], shadermix.outputs['Result'])
pbsdf.inputs['Base Color'].is_linked
shadermix.outputs['Result'].is_linked
Now it says it's connected (is_linked returns true) but there's no line. In the principled bsdf it looks like it's connected but if you connect something to shaderNodeMix, there will be no changes to the default cube. See first image that the base color for principled bsdf seems to be connected.
Change type of ShaderNodeMix to FLOAT. Now the line is drawn.
shadermix.data_type = "FLOAT"
pbsdf.inputs['Base Color'].is_linked
shadermix.outputs['Result'].is_linked
Change back to RGBA, the line disappears.
shadermix.data_type = "RGBA"
pbsdf.inputs['Base Color'].is_linked
shadermix.outputs['Result'].is_linked
I can confirm, however this issue has been reported before, see #103395. Will merge reports. Please subscribe in #103395 if you want to see further updates