Linked sockets by Python has is_linked
attribute as False #82390
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#82390
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: Windows-10-10.0.18362-SP0 64 Bits
Blender Version
Broken: version: 2.91.0 Beta, branch: master, commit date: 2020-10-29 21:28, hash:
9e85812acc
Short description of error
If add link to a node tree in its update method linked sockets will still have
is_linked
attribute as False. I would expect that it should be True because what else should be expected if I explicitly saying that I what two sockets to be linked to each other.Exact steps for others to reproduce the error
untitled.blend
It is important to me because as I was told I have to replace sockets of reroute nodes in tree update method. https://developer.blender.org/T81701
I'm deleting old sockets with their links and create new one with new links. Then I'm passing running to update system which assumes that if socket has False in
is_linked
attribute then the socket is really unlinked what is not true anymore.Added subscriber: @randum
Funny thing is that if I'm creating link outside of update tree event (via timer call) sockets are getting their actual status immediately. How this behaviour can be explained?
untitled (1).blend
Added subscriber: @iss
Changed status from 'Needs Triage' to: 'Archived'
Looking at code, adding link will run update function on
to_node
and on tree itself. So this is potentially quite dangerous to do inside update function. I am not quite sure if these update function calls will be nested or queued. After adding debug print inside update function, it looks like they are queued...It is not quite clear to me why you need to do this though.
I will just repeat, please use https://www.blender.org/community/ for technical support.
Did you read your own message posted several weeks ago?
And now you are talking that it is not the way and :
What is not clear? Why I would like to see my own sockets in reroute node, why I would like to see it linked when it linked or what?
I am not talking about sockets here, I am saying what happens when you create a link.
rna_NodeTree_link_new()
is function that does this.Why do you need to add links from within update function. Perhaps custom operator woud be better here, I am not sure.
How custom operator will be notify that reroute node was connected then? What I need is that reroute always has sockets the same type as socket to which it is connected. In another topic you gave me advice to do this in update function.
Then just change type? I don't see why you would need to create new links.
The type of a socket is its class. It impossible to change class of an instance. Change socket type means to create new socket instance from another class.
I was almost convinced, but I thought that before I reopen I will need some evidence. However this function seems to work pretty well:
I see some glitches like when you add more reroutes, this doesn't work well. That looks like a bug on the surface, but you can probably bubble up chain up to the actual node as workaround.
Here is the list of standard socket types:
To see type of socket you should use
socket.bl_idname
Value of type attribute of a socket is not type of socket. It is type of its default value.
I added debug prints of
in_sock.bl_idname
to update functionAfter making reroute, the output was:
So you should rather change
type
member ofNodeSocket
class to change its instance. This looks like it's working as expected.Maybe a bit weird from OOP perspective, but these data structures are in C and there you can change class without having to make new intance.
Okay. Here is MY socket. How can I switch type of socket of any other type to socket of mine?
Changed status from 'Archived' to: 'Needs Triage'
Added subscriber: @JacquesLucke
That seems to be problematic. So to recapitulate this:
Issue is that Add Reroute operator always creates color socket.
Node socket type should be changed during node tree update function, which works fine for predefined types.
But for custom socket type defined in python, it seems that it is necessary to make new socket instance and rebuild links to and from socket.
However is_linked property of socket is not changed immediately, but in node update function if I remember this correctly. Also this will cause node tree function to be called. I am not sure if this is making this problem unsolvable, but id definitely doesn't sound nice.
@JacquesLucke Can you look at this comment and give your opinion if this could be a bug? or are we missing something?
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @JoshuaKnauber
Added subscriber: @Zeastin
Added subscriber: @evantryan
Added subscriber: @timodriaan