Fix T49636: material draw mode crash with displacement and missing group input node.

This commit is contained in:
Brecht Van Lommel 2016-10-12 13:10:09 +02:00
parent a54242503e
commit 5f16382195
Notes: blender-bot 2023-02-14 07:30:28 +01:00
Referenced by issue #49636, Crash after switching Method Of Display from Solid to Material. Cycles.
1 changed files with 3 additions and 2 deletions

View File

@ -327,7 +327,8 @@ static void ntree_shader_link_builtin_group_normal(
/* Need to update tree so all node instances nodes gets proper sockets. */
bNode *group_input_node = ntreeFindType(group_ntree, NODE_GROUP_INPUT);
node_group_verify(ntree, group_node, &group_ntree->id);
node_group_input_verify(group_ntree, group_input_node, &group_ntree->id);
if (group_input_node)
node_group_input_verify(group_ntree, group_input_node, &group_ntree->id);
ntreeUpdateTree(G.main, group_ntree);
/* Assumes sockets are always added at the end. */
bNodeSocket *group_node_normal_socket = group_node->inputs.last;
@ -370,7 +371,7 @@ static void ntree_shader_link_builtin_group_normal(
group_displacement_socket);
ntreeUpdateTree(G.main, group_ntree);
}
else {
else if (group_input_node) {
/* Connect group node normal input. */
nodeAddLink(ntree,
node_from, socket_from,