From 817d308803dc1234e9e7b4cab782c0f52a4ebaca Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 8 May 2012 15:14:59 +0000 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/node.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 07122a1ec4d..a25cd0d3b38 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -339,15 +339,15 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp) 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 */ BLI_strncpy(node->name, nodeLabel(node), NODE_MAXSTR); nodeUniqueName(ntree, node); BLI_addtail(&ntree->nodes, node); + if (ntype->initfunc!=NULL) + ntype->initfunc(ntree, node, ntemp); + ntree->update |= NTREE_UPDATE_NODES; return node;