diff options
author | Leon Schittek <leon.schittek@gmx.net> | 2022-04-18 23:28:03 +0300 |
---|---|---|
committer | Leon Schittek <leon.schittek@gmx.net> | 2022-04-18 23:28:03 +0300 |
commit | 03d39a04a3a29b7eb464ca2ae39c69757ee9f6c2 (patch) | |
tree | 739c4608eda314fa8ac03b5fa2f94eccd2c9bfc5 /source/blender/nodes | |
parent | 314b27850ccb6d103cf5c73855187cfc11ec48d8 (diff) |
Fix T97002: Preserve multi socket link order
Preserve multi socket link order when copying nodes or adding a new
group input sockets by linking directly to multi inputs from the group
input node's extension socket.
This is done by also copying the `multi_input_socket_index` when
the new links are created by copying existing or temporary links.
Reviewed By: Hans Goudey
Differential Revision: http://developer.blender.org/D14535
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/node_common.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index c4befd5828c..abbfe4b823d 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -476,7 +476,10 @@ void node_group_input_update(bNodeTree *ntree, bNode *node) /* redirect links from the extension socket */ for (link = (bNodeLink *)tmplinks.first; link; link = link->next) { - nodeAddLink(ntree, node, newsock, link->tonode, link->tosock); + bNodeLink *newlink = nodeAddLink(ntree, node, newsock, link->tonode, link->tosock); + if (newlink->tosock->flag & SOCK_MULTI_INPUT) { + newlink->multi_input_socket_index = link->multi_input_socket_index; + } } } |