diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-10 02:39:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-10 02:39:35 +0400 |
commit | 24f672d57b75e7ed0cf1bc1ea20ec598fcfb4f6e (patch) | |
tree | 03240de6083827dbda4223f0a11228a32b76d458 /source/blender | |
parent | df107939c9eeaa77dffe57ba6b246e1184efe67b (diff) |
fix for blender naming all new node groups "Missing Datablock"
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 33df8e4b503..239072f2bb4 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -321,15 +321,18 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp) node->color[0] = node->color[1] = node->color[2] = 0.608; /* default theme color */ node_add_sockets_from_type(ntree, node, ntype); - - /* 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); + + /* initialize the node name with the node label. + * note: do this after the initfunc so nodes get + * their data set which may be used in naming + * (node groups for example) */ + BLI_strncpy(node->name, nodeLabel(node), NODE_MAXSTR); + nodeUniqueName(ntree, node); ntree->update |= NTREE_UPDATE_NODES; |