Maniphest T93438

Custom nodes no longer get inserted in between two linked nodes
Closed, Resolved

Assigned To
None
Authored By
Valeri Barashkov (valera)
Nov 27 2021, 10:27 PM
Tags
  • BF Blender
Subscribers
Joshua Knauber (JoshuaKnauber)
Philipp Oeser (lichtwerk)
Pratik Borhade (PratikPB2123)
Valeri Barashkov (valera)

Description

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 496.49

Blender Version
Broken: version: 3.0.0 Release Candidate, branch: master, commit date: 2021-11-25 17:24, hash: rB2fb8c6805a98
Worked: 2.93 and 3.0 a few weeks ago (lost the build)

Short description of error
Using custom node trees would previously allow to drop a node in between two connected nodes. Now I see the link get highlighted but when I release the node it does not get inserted into that link.

Exact steps for others to reproduce the error

Revisions and Commits

rB Blender
D13403
D13403

Event Timeline

Valeri Barashkov (valera) created this task.Nov 27 2021, 10:27 PM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from User.Nov 28 2021, 3:22 PM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

Cannot reproduce here (at least not with the custom nodes from the custom_nodes.py python template.

Could you share a minimal example .blend file (including the necessary py script[s]) that demonstrates this failure?

Joshua Knauber (JoshuaKnauber) added a subscriber: Joshua Knauber (JoshuaKnauber).EditedNov 28 2021, 6:12 PM

I guess one of the reports can be closed, but I provided an example with the python template here: https://developer.blender.org/T93430
The explanation of how to reproduce this with the custom node template is also given there:

When creating custom python nodes that have only custom sockets, the node can't be dropped onto an existing link. This is not the case if the node has normal blender sockets, only with custom ones. It also doesn't happen if the node has blender and custom sockets as the blender sockets will be connected and the custom ones ignored.

If I were to throw a wild guess out there why this is happening, I would say that it might have to do with a fix for the float curve node in geometry nodes being connected to the factor input instead of the value input. This was an issue for a while and seems to recently have gotten fixed. I would guess that this somehow looks for compatible sockets and that doesn't consider custom python sockets. I couldn't find the exact commit for this, but it might be a starting point for where to look.

Valeri Barashkov (valera) added a comment.Nov 28 2021, 11:57 PM

@Joshua Knauber (JoshuaKnauber) @Philipp Oeser (lichtwerk)

I think Joshua figured it out, here is my script for the node, it uses custom float socket.

I can't share the entire script here, but I can email it if you like.

Node UI

class TNODES_ND_clip(bpy.types.Node):
    bl_idname = 'TNODES_ND_clip'
    bl_label = 'Clip'
    bl_icon = 'DRIVER_DISTANCE'
    bl_type = 'TNODES'
    bl_width_default = 200


    def init(self, context):
        self.inputs.new('TNODES_FloatSocket', 'Value')
        self.inputs.new('TNODES_FloatSocket', 'Minimum')
        self.inputs.new('TNODES_FloatSocket', 'Maximum')
        self.outputs.new('TNODES_BasicSocketNoUpdate', 'Value')

        self.inputs["Maximum"].default_value = 1

Custom Float socket

class TNODES_FloatSocket(bpy.types.NodeSocket):
    bl_idname = 'TNODES_FloatSocket'
    bl_label = "Custom Node Socket"

    def prop_update(self, context):
        if hasattr(context, 'node'):
            reset_connections(context.node)

    default_value: FloatProperty(
        description='Custom Height',
        min=0,
        default=0,
        precision=5,
        step=0.1,
        update=prop_update)
Omar Emara (OmarSquircleArt) added a commit: rBab2a7aa0da81: Fix T93438: Auto linking do not work for custom sockets.Nov 29 2021, 11:35 AM
Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).Nov 29 2021, 1:27 PM
Pratik Borhade (PratikPB2123) added a comment.Nov 29 2021, 1:41 PM
Philipp Oeser (lichtwerk) changed the task status from Duplicate to Resolved by committing rB61fe0d626441: Fix T93438: Auto linking do not work for custom sockets.Jan 11 2022, 9:00 AM
Philipp Oeser (lichtwerk) added a commit: rB61fe0d626441: Fix T93438: Auto linking do not work for custom sockets.