Fix T89709: avoid double node links after delete and reconnect
Differential Revision: https://developer.blender.org/D13062
This commit is contained in:
@@ -2601,6 +2601,17 @@ void nodeInternalRelink(bNodeTree *ntree, bNode *node)
|
||||
bNodeLink *fromlink = link->fromsock->link->fromsock->link;
|
||||
/* skip the node */
|
||||
if (fromlink) {
|
||||
if (link->tosock->flag & SOCK_MULTI_INPUT) {
|
||||
/* remove the link that would be the same as the relinked one */
|
||||
LISTBASE_FOREACH_MUTABLE (bNodeLink *, link_to_compare, &ntree->links) {
|
||||
if (link_to_compare->fromsock == fromlink->fromsock &&
|
||||
link_to_compare->tosock == link->tosock) {
|
||||
adjust_multi_input_indices_after_removed_link(
|
||||
ntree, link_to_compare->tosock, link_to_compare->multi_input_socket_index);
|
||||
nodeRemLink(ntree, link_to_compare);
|
||||
}
|
||||
}
|
||||
}
|
||||
link->fromnode = fromlink->fromnode;
|
||||
link->fromsock = fromlink->fromsock;
|
||||
|
||||
|
Reference in New Issue
Block a user