Page MenuHome

Fix unreported: Drag link search doesn't always connect to the socket
ClosedPublic

Authored by Leon Schittek (lone_noel) on Mar 8 2022, 10:41 PM.

Details

Summary

Connecting to some sockets of a few nodes via the drag link search
would fail and trigger an assert, because the picked socket wasn't
available. This was due to some sockets only being available with
certain settings.

This patch fixes these cases by adding the availability conditions of
the socket to the node declaration with the make_available method or
manually adding a node_link_gather_search function.

The following nodes were affected:

  • Curve Arc
  • Curve Circle
  • Curve Line
  • Distribute Points on Faces
  • Scale Elements
  • Sky Texture
  • Vector Rotate
  • Rotate Euler

Comparison

masterpatch

For some of these nodes it might be nice to manually create the
node_link_gather_search function to allow the same socket to show
up twice for different modes (e.g. it could be convenient it the Start
socket of the Curve Line node would show up both as
Start (Endpoints) and Start (Direction) but I wasn't too sure about
that so I left that out for now.

Diff Detail

Repository
rB Blender

Event Timeline

Leon Schittek (lone_noel) requested review of this revision.Mar 8 2022, 10:41 PM
Leon Schittek (lone_noel) created this revision.

Thanks for looking into this. The changes seem quite reasonable.

We could add special functions for adding search items for different modes. But that is a bit more complex, so I think it's fine to wait until people actually requested it in most cases.

Accepting because the name changing I requested is trivial.

source/blender/nodes/function/nodes/node_fn_rotate_euler.cc
18

I like making a lambda here, good idea. Think I'd tweak the naming a bit though, this sounds like a boolean variable name. How about enable_axis_angle.
Same for the other files.

This revision is now accepted and ready to land.Mar 8 2022, 11:06 PM
Leon Schittek (lone_noel) marked an inline comment as done.
  • Rename lambdas.
  • Rebase on master.
source/blender/nodes/function/nodes/node_fn_rotate_euler.cc
18

To be fair, I got the idea from Jaques' patch D12709 :)

I agree that enable_... is more clear.