shaderNodeMix can not be connected to other sockets with python API #109257

Closed
opened 2023-06-22 20:20:39 +02:00 by Novice · 1 comment

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

  1. Start blender.
  2. Change the layout so one window is the python console and another is the shader editor.
  3. In the python console, copy/paste ( you can skip the comments if you like)

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

**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** 1. Start blender. 2. Change the layout so one window is the python console and another is the shader editor. 3. In the python console, copy/paste ( you can skip the comments if you like) # 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
Novice added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-06-22 20:20:40 +02:00

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

I can confirm, however this issue has been reported before, see https://projects.blender.org/blender/blender/issues/103395. Will merge reports. Please subscribe in https://projects.blender.org/blender/blender/issues/103395 if you want to see further updates
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-06-22 20:25:07 +02:00
Sign in to join this conversation.
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109257
No description provided.