From 2fbee4598cb7ba0430bf16a0ebb9ec9fabacf42d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 7 Apr 2021 00:32:16 -0500 Subject: [PATCH] Fix T87195: Boolean node multi-input socket only accepts one link The default insert link callback for nodes was trying to move the existing link away, since it didn't properly handle multi-input sockets (though the problem wasn't exposed for the join node). We can basically skip all of this "moving existing links" for multi-input sockets, unless we are at the link limit. --- source/blender/nodes/intern/node_util.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c index 3289caad9ba..4076dc852b3 100644 --- a/source/blender/nodes/intern/node_util.c +++ b/source/blender/nodes/intern/node_util.c @@ -310,6 +310,13 @@ void node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link) return; } + /* If we're not at the link limit of the target socket, we can skip + * trying to move existing links to another socket. */ + const int to_link_limit = nodeSocketLinkLimit(socket); + if (socket->total_inputs + 1 < to_link_limit) { + return; + } + LISTBASE_FOREACH_MUTABLE (bNodeLink *, to_link, &ntree->links) { if (socket == to_link->tosock) { bNodeSocket *new_socket = node_find_linkable_socket(ntree, node, socket);