BPY: Cannot link new Mix Node Output to any other node if data_type is changed #117966

Closed
opened 2024-02-07 23:22:37 +01:00 by samlovesmath · 3 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.23

Blender Version
Broken: version: 3.6.8, branch: blender-v3.6-release, commit date: 2024-01-15 12:55, hash: f6ae60f3eeda
Worked: N/A (only versions after 3.3LTS use the new Mix node. Attempted on Blender's latest Steam version, 4.0.2. Same error still exists + can be replicated using the same file.)

Short description of error
Currently trying to build a set of nodes for a new material using Blender's Python coding. After using Python to create a new Mix Node (not the legacy Mix Node) with the Color type ("RGBA" via Python) and try to link the output to my Principled BSDF's "Base Color" input, the two nodes do not get connected. Instead, the BSDF's Base Color input has a "visual link" that connects to a spot behind its own BSDF. It is not visible unless you pull the link away from the BSDF Base Color input. The Mix does not get connected, as the BSDF's Base Color does not change.

This issue also exists when changing the Mix Node to "VECTOR" via Python.
This issue still exists when connecting the Mix Node's output to any other input.
There is no issue trying to connect it using the Factor/Float version that is used by default. It is only after I change the Data Type of the Mix node that there is an issue.
The legacy mix node does not have this issue.

image

Exact steps for others to reproduce the error

  1. Manually create a new object, and ensure it has a new material. Make sure Use Nodes is enabled for the material.
  2. Using Python (or manually), remove all of the nodes within your new material.
  3. Via Python:
    a. Create a new Shader node and a new Mix node (the new version, "ShaderNodeMix", not the legacy "ShaderNodeMixRGB").
    b. Change the data type of the Mix node to Color (data_type = "RGBA").
    c. Link the output of the "Result" in Mix node to your input of another node (using links.new())

This is my first time reporting, but I've used Blender for quite a long time, and this seems like a bug to me. Let me know if I'm wrong.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.23 **Blender Version** Broken: version: 3.6.8, branch: blender-v3.6-release, commit date: 2024-01-15 12:55, hash: `f6ae60f3eeda` Worked: N/A (only versions after 3.3LTS use the new Mix node. Attempted on Blender's latest Steam version, 4.0.2. Same error still exists + can be replicated using the same file.) **Short description of error** Currently trying to build a set of nodes for a new material using Blender's Python coding. After using Python to create a new Mix Node (_not_ the legacy Mix Node) with the Color type ("RGBA" via Python) and try to link the output to my Principled BSDF's "Base Color" input, the two nodes do not get connected. Instead, the BSDF's Base Color input has a "visual link" that connects to a spot behind its own BSDF. It is not visible unless you pull the link away from the BSDF Base Color input. The Mix does not get connected, as the BSDF's Base Color does not change. This issue also exists when changing the Mix Node to "VECTOR" via Python. This issue still exists when connecting the Mix Node's output to any other input. There is no issue trying to connect it using the Factor/Float version that is used by default. It is only after I change the Data Type of the Mix node that there is an issue. The legacy mix node does not have this issue. ![image](/attachments/7f8df590-9ac5-4c34-82f5-5bc93a2e283f) **Exact steps for others to reproduce the error** 1. Manually create a new object, and ensure it has a new material. Make sure Use Nodes is enabled for the material. 2. Using Python (or manually), remove all of the nodes within your new material. 3. Via Python: a. Create a new Shader node and a new Mix node (the new version, "ShaderNodeMix", not the legacy "ShaderNodeMixRGB"). b. Change the data type of the Mix node to Color (data_type = "RGBA"). c. Link the output of the "Result" in Mix node to your input of another node (using links.new()) This is my first time reporting, but I've used Blender for quite a long time, and this seems like a bug to me. Let me know if I'm wrong.
samlovesmath added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-02-07 23:22:38 +01:00
Contributor

I don't see the misdrawn noodle, but the socket not being connected is an error in your script. Dupe of #103395.

tldr Use _node_mix.outputs[2] for the Result output socket in Color mode.

I don't see the misdrawn noodle, but the socket not being connected is an error in your script. Dupe of #103395. tldr Use `_node_mix.outputs[2]` for the Result output socket in Color mode.
Author

Very interesting, thank you. I originally didn't notice there were more than one output listed, since trying to get the console to auto-complete always returns the same word (since, of course, all of those outputs have the same name, silly me). Made me think it only had one output at all times.

image

The misdrawn noodle only shows when you drag it off of the input node that the Result goes into. When I did it with the Principled Shader, the "input spot" that Python tried create with a link was hiding behind the shader, so I didn't even notice it until I tried to take out the link part that goes into Base Color. So in the end, Python still tried to link it anyways. Not sure if that is a particular visual bug only on my end.

Thank you for the correction, and apologies for the incorrect report!

Very interesting, thank you. I originally didn't notice there were more than one output listed, since trying to get the console to auto-complete always returns the same word (since, of course, all of those outputs have the same name, silly me). Made me think it only had one output at all times. ![image](/attachments/63b6fbd9-8f34-4230-9371-11a3e4252cfc) The misdrawn noodle only shows when you drag it off of the input node that the Result goes into. When I did it with the Principled Shader, the "input spot" that Python tried create with a link was hiding behind the shader, so I didn't even notice it until I tried to take out the link part that goes into Base Color. So in the end, Python still tried to link it anyways. Not sure if that is a particular visual bug only on my end. Thank you for the correction, and apologies for the incorrect report!
6.1 KiB

So i'll close as duplicate of #103395.

So i'll close as duplicate of #103395.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-02-08 15:58:45 +01:00
Iliya Katushenock added
Status
Duplicate
and removed
Status
Archived
labels 2024-02-08 15:59:21 +01: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
3 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#117966
No description provided.