Fix for 30439, Cycles node group conversion wasn't checking node->id pointer (group node without internal node tree). This is a somewhat unusual case (UI buttons don't allow unlinking group tree), but not entirely forbidden.

Also fixed similar issue in node_templates.c where the group tree is used to generate a button name.
This commit is contained in:
Lukas Toenne 2012-03-06 11:34:57 +00:00
parent 2b9551a4e4
commit 92322b57d4
2 changed files with 9 additions and 2 deletions

@ -517,6 +517,9 @@ static void add_nodes(BL::BlendData b_data, ShaderGraph *graph, BL::ShaderNodeTr
/* add proxy converter nodes for inputs and outputs */
BL::NodeGroup b_gnode(*b_node);
BL::ShaderNodeTree b_group_ntree(b_gnode.node_tree());
if (!b_group_ntree)
continue;
BL::Node::inputs_iterator b_input;
BL::Node::outputs_iterator b_output;

@ -277,8 +277,12 @@ static void ui_node_sock_name(bNodeSocket *sock, char name[UI_MAX_NAME_STR])
bNode *node = sock->link->fromnode;
char node_name[UI_MAX_NAME_STR];
if(node->type == NODE_GROUP)
BLI_strncpy(node_name, node->id->name+2, UI_MAX_NAME_STR);
if(node->type == NODE_GROUP) {
if (node->id)
BLI_strncpy(node_name, node->id->name+2, UI_MAX_NAME_STR);
else
BLI_strncpy(node_name, "Group", UI_MAX_NAME_STR);
}
else
BLI_strncpy(node_name, node->typeinfo->name, UI_MAX_NAME_STR);