[Bf-blender-cvs] [2fbee4598cb] master: Fix T87195: Boolean node multi-input socket only accepts one link

Hans Goudey noreply at git.blender.org
Wed Apr 7 07:32:22 CEST 2021


Commit: 2fbee4598cb7ba0430bf16a0ebb9ec9fabacf42d
Author: Hans Goudey
Date:   Wed Apr 7 00:32:16 2021 -0500
Branches: master
https://developer.blender.org/rB2fbee4598cb7ba0430bf16a0ebb9ec9fabacf42d

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.

===================================================================

M	source/blender/nodes/intern/node_util.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list