diff options
author | Colin <Kdaf> | 2021-11-03 19:53:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-11-03 19:55:06 +0300 |
commit | a827864e6b1ee34af759dea61f832076c0e67c44 (patch) | |
tree | 9d15191971fc4ea6bd1191e023b769f0f37c4013 /source | |
parent | 1e590234f7a601ebb5ef93058ae9d4523624a614 (diff) |
Fix T89709: avoid double node links after delete and reconnect
Differential Revision: https://developer.blender.org/D13062
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index ae9cddacc85..6b409ae656e 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -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; |