Merge branch 'blender-v2.93-release'

This commit is contained in:
Fabian Schempp 2021-05-13 23:07:05 +02:00
commit d889e9684a
1 changed files with 15 additions and 0 deletions

View File

@ -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;
}