diff options
author | Fabian Schempp <fabianschempp@googlemail.com> | 2021-05-14 00:07:05 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2021-05-14 00:07:05 +0300 |
commit | d889e9684aaf523a422227f0aa61079705865a16 (patch) | |
tree | 54988b19ec20921498d8c5d40a0d9ed4a4af1ca3 /source/blender | |
parent | b90fec5d46624d40f35764de629a0e28e7478101 (diff) | |
parent | 37570a73170e6cddc32ed0523b626bf0857cf068 (diff) |
Merge branch 'blender-v2.93-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index d5b3b961270..3d49d186e01 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -2258,6 +2258,17 @@ bNodeTree *ntreeCopyTree_ex_new_pointers(const bNodeTree *ntree, return new_ntree; } +static int node_count_links(const bNodeTree *ntree, const bNodeSocket *socket) +{ + int count = 0; + LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) { + if (ELEM(socket, link->fromsock, link->tosock)) { + count++; + } + } + return count; +} + /* also used via rna api, so we check for proper input output direction */ bNodeLink *nodeAddLink( bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock) @@ -2294,6 +2305,10 @@ bNodeLink *nodeAddLink( ntree->update |= NTREE_UPDATE_LINKS; } + if(link->tosock->flag & SOCK_MULTI_INPUT){ + link->multi_input_socket_index = node_count_links(ntree,link->tosock) - 1; + } + return link; } |