[Bf-blender-cvs] [5f16382] master: Fix T49636: material draw mode crash with displacement and missing group input node.
Brecht Van Lommel
noreply at git.blender.org
Wed Oct 12 17:01:38 CEST 2016
Commit: 5f16382195a04d5bb418c1d8fa666110b368404d
Author: Brecht Van Lommel
Date: Wed Oct 12 13:10:09 2016 +0200
Branches: master
https://developer.blender.org/rB5f16382195a04d5bb418c1d8fa666110b368404d
Fix T49636: material draw mode crash with displacement and missing group input node.
===================================================================
M source/blender/nodes/shader/node_shader_tree.c
===================================================================
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 8523b72..40d1cfd 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -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,
More information about the Bf-blender-cvs
mailing list