Merge branch 'blender-v2.93-release'
This commit is contained in:
commit
d889e9684a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue