fix for blender naming all new node groups "Missing Datablock"
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user