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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user