ShaderNodeCustomGroup insert_link is not listening to inserts #62670

Closed
opened 2019-03-17 06:19:06 +01:00 by Sergey · 7 comments

System Information
Operating system: Windows 8 64 bit
Graphics card: notebook integrated, render with CPU

Blender Version
Broken: 2.8. cc5bdf0293
Worked: worked in 2.8 with NodeCustomGroup

Short description of error
The new ShaderNodeCustomGroup seems to inherit all methods of the old NodeCustomGroup but insert_link doesn't seem to be working properlty unless I have bugs in my code

Exact steps for others to reproduce the error

  1. run the script, you will see the new node pop up
  2. note that in the script, the insert_link function is defined:
  
insert_link(self, link):

print("insert_link reporting")
return

  1. try linking any input/output of the custom node
  2. there's no printing to console{F6837513}

bug_report.py

bug_report_insert_link.blend

**System Information** Operating system: Windows 8 64 bit Graphics card: notebook integrated, render with CPU **Blender Version** Broken: 2.8. cc5bdf029324 Worked: worked in 2.8 with NodeCustomGroup **Short description of error** The new ShaderNodeCustomGroup seems to inherit all methods of the old NodeCustomGroup but insert_link doesn't seem to be working properlty unless I have bugs in my code **Exact steps for others to reproduce the error** 1. run the script, you will see the new node pop up 2. note that in the script, the insert_link function is defined: ``` ``` ``` insert_link(self, link): ``` print("insert_link reporting") return ``` ``` 3. try linking any input/output of the custom node 4. there's no printing to console{[F6837513](https://archive.blender.org/developer/F6837513/bug_report_insert_link.blend)} [bug_report.py](https://archive.blender.org/developer/F6837516/bug_report.py) [bug_report_insert_link.blend](https://archive.blender.org/developer/F6837520/bug_report_insert_link.blend)
Author

Added subscriber: @serhii1994

Added subscriber: @serhii1994

Added subscriber: @Secrop

Added subscriber: @Secrop

To respond to new link events you need to use the update() and check if there's any changes in your existent sockets.

The insert_link() is used internally to add and verify if links are valid (for example if an input socket has more than 1 link, etc). Not to respond to link changes.

I'll probably hide this function from the api, as it has little meaning for Shader and Compositor Nodetrees... You need a NodeLink struct to call the function, and the api doesn't let you create NodeLinks independently, except when calling new() from a NodeLink Collection (which then makes the insert_link() desnecessary because the link is already in the collection..).

To respond to new link events you need to use the `update()` and check if there's any changes in your existent sockets. The `insert_link()` is used internally to add and verify if links are valid (for example if an input socket has more than 1 link, etc). Not to respond to link changes. I'll probably hide this function from the api, as it has little meaning for Shader and Compositor Nodetrees... You need a NodeLink struct to call the function, and the api doesn't let you create NodeLinks independently, except when calling `new()` from a NodeLink Collection (which then makes the `insert_link()` desnecessary because the link is already in the collection..).
Sergey self-assigned this 2019-03-17 11:51:39 +01:00
Author

So, how do I use it? update() takes no arguments... how can I determine which socket was affected and where the link was created? to check for new changes, you have to keep the old state in some form or? the only thing I can think of... IFF the function update() function runs automatically on update, one could check the last link in the node_tree and so on... but honestly, that's just not serious:( plus there's even no documentation on it.

So, how do I use it? update() takes no arguments... how can I determine which socket was affected and where the link was created? to check for new changes, you have to keep the old state in some form or? the only thing I can think of... IFF the function update() function runs automatically on update, one could check the last link in the node_tree and so on... but honestly, that's just not serious:( plus there's even no documentation on it.
Author

please, gentlemen, I don't understand the approach. insert_link() worked just f i n e for my purposes in bpy.types.CustomNodeGroup. now it stopped working - that's an obvious bug... why not simply get it back? how do you even use update()? it does not take a single argument. to handle an event, you gotta have the event passed as argument...

please, gentlemen, I don't understand the approach. insert_link() worked just f i n e for my purposes in bpy.types.CustomNodeGroup. now it stopped working - that's an obvious bug... why not simply get it back? how do you even use update()? it does not take a single argument. to handle an event, you gotta have the event passed as argument...
Sergey was unassigned by Brecht Van Lommel 2019-03-18 10:32:46 +01:00

This issue was referenced by 1b06e3378a

This issue was referenced by 1b06e3378a750774cd7da76ab61f86476f7087cc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#62670
No description provided.