Page MenuHome

Nodes: Add default link socket to socket declaration.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Nov 4 2021, 12:53 PM.

Details

Summary

This fixes T92814 in a more general way. Hopefully we can get rid of the heuristic for socket selection at some point, but that's not something I'd do for 3.0.

Nodes can now specify which sockets should be linked when the node is dropped on an existing link. We could make this more specific in the future (e.g. having a default socket per type etc), but that's not necessary for now.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Nov 4 2021, 12:53 PM
Jacques Lucke (JacquesLucke) created this revision.
source/blender/editors/space_node/node_relationships.cc
2203

Could this check the type too? It seems reasonable to only use the default where the types match.

source/blender/editors/space_node/node_relationships.cc
2203

Types don't have to match exactly in general. We could check for convertability, but that can be fixed as part of T91840.

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/space_node/node_relationships.cc
2203

Okay, as long as we have a task for it, works for me.

This revision is now accepted and ready to land.Nov 4 2021, 2:37 PM