Node: Incorrect node socket indexing when connecting with python #103395
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#103395
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: Linux-5.10.0-13-amd64-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.91.03
Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-21 20:25, hash:
cef5841e12
Worked: (newest version of Blender that worked as expected)
Short description of error
Trying to connect a mix node (former MixRGB) to another node using tree.links.new() doesn't work.
Exact steps for others to reproduce the error
Open the attached .blend file bug_plug_nodes.blend
It contains a cube with a materials and some nodes inside :
You can then run the script, and test different combinations, the last one work but not the others.
Added subscriber: @sozap
#104029 was marked as duplicate of this issue
#103922 was marked as duplicate of this issue
#103642 was marked as duplicate of this issue
blender/blender-addons#103205 was marked as duplicate of this issue
Added subscriber: @cassidy
For some reason, first output seems to be the third in the outputs list.
And for the inputs, although the first socket is index 0 (correct), second and third input is index 6 and 7, respectively)
And I agree, this doesn't seem normal.
EDIT:
Above was observed in Blender version:
3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash:
a95bf1ac01
, type: releaseAdded subscribers: @CharlieJolly, @deadpin
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
This is because you're connecting the wrong sockets (see below). The Mix node now hosts several different variants now, and the sockets will change depending on which data type and blend type is specified -- you can see this by enabling Python tooltips and hovering over the fields in question.
CC @CharlieJolly I'm not sure there's a good place to document how the sockets change but the current chart looks like the following - did I get these right?:
Oh, that makes totally sense ! Thanks a lot @deadpin and sorry for that false report !
Added subscriber: @mod_moder
Now changing the mode of operation and data type is just toggling the visibility of a bunch of sockets.
However, work is already underway to fix this.
Concretely, at the moment, Hans is verifying the addition of dynamic declarations https://developer.blender.org/diffusion/B/history/temp-nodes-group-declarations/source/blender/
This does not specifically fix your problem, as it is about different sockets for different modes of operation, but not types.
But this is current progress in this regard.
So for now, this is how socket addressing works.
But it will be fixed someday.
For now, you should only index the sockets that are visible.
Added subscriber: @bigmark
@deadpin yes that's right. Each data type has a different selection of sockets. It's probably worth adding a note on the documentation.
I'm not going to say how long it will take to add new ways to define different types of sockets.
But, probably, the mention in the documentation will only be relevant for this - the next versions (if not even faster)
Material : connect Mix nodes with python failto Node: Incorrect node socket indexing when connecting with pythonA note in the documentation would definitely help in the long run, but since this is such a simple operation I'm not sure I'll go and look into the doc ...
I'm not sure that a lot of nodes act that way either, that's part of the confusion.
Would having an error message make sense ? In the link operator, adding an option (off by default) to do the connection even if sockets aren't visible,
and by default displaying an error message when that fails ?
Just my two cents, at least it's easy to remember once you know, and I'll do my best to pass that torch to others if/when needed !
The ability to connect sockets that have been made invisible should remain, I guess
Added subscriber: @timknip
Added subscriber: @Human_Robot
Added subscribers: @peterf-2, @LazyDodo, @JulienDuroure
just to add maybe it helps, when the mix node is set to float it works, only on color and vector it does not work
@MarioTovirac Is not a bug, try
Result_Vector
its not a bug that you cant call them by key because you used the same key for 3 different sockets? Ok, if its not a bug, its just terrible UI/API writing. Just put the type in the socket name.
Its still not mentioned in the documentation either.