forked from bartvdbraak/blender
Fix #31350, by Sergey Sharybin.
This happens because of how output node index is initializing in assign_index function: itterator goes to the beginning of the nodes list using node->prev and then reviews the whole node list to find first unused index. The problem is that node's initialization now is getting called before node was added to node tree, so all output nodes have got equal index.
This commit is contained in:
parent
e20bff4b60
commit
817d308803
@ -339,15 +339,15 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
|
|||||||
|
|
||||||
node_add_sockets_from_type(ntree, node, ntype);
|
node_add_sockets_from_type(ntree, node, ntype);
|
||||||
|
|
||||||
if (ntype->initfunc!=NULL)
|
|
||||||
ntype->initfunc(ntree, node, ntemp);
|
|
||||||
|
|
||||||
/* initialize the node name with the node label */
|
/* initialize the node name with the node label */
|
||||||
BLI_strncpy(node->name, nodeLabel(node), NODE_MAXSTR);
|
BLI_strncpy(node->name, nodeLabel(node), NODE_MAXSTR);
|
||||||
nodeUniqueName(ntree, node);
|
nodeUniqueName(ntree, node);
|
||||||
|
|
||||||
BLI_addtail(&ntree->nodes, node);
|
BLI_addtail(&ntree->nodes, node);
|
||||||
|
|
||||||
|
if (ntype->initfunc!=NULL)
|
||||||
|
ntype->initfunc(ntree, node, ntemp);
|
||||||
|
|
||||||
ntree->update |= NTREE_UPDATE_NODES;
|
ntree->update |= NTREE_UPDATE_NODES;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
Loading…
Reference in New Issue
Block a user