Commit: d4a36c7ad55b3dfbe5fc52f6183ae26484afa5b9 Author: Philipp Oeser Date: Fri May 14 15:42:07 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBd4a36c7ad55b3dfbe5fc52f6183ae26484afa5b9
Fix T88234: Crash with Eevee when shader displacement socket connection is muted In {rB266cd7bb82ce}, support for muting links was added. It might be debatable if we define a shader as "having" displacement even if the link is muted, but after said commit, shader_has_displacement() would return true but still leave the returned node as NULL. Now also return false if the link is muted (otherwise the caller would need to additionally check the returned node as well.) Maniphest Tasks: T88234 Differential Revision: https://developer.blender.org/D11256 =================================================================== 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 7b52b525541..83f476884e6 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -557,12 +557,14 @@ static bool ntree_shader_has_displacement(bNodeTree *ntree, /* Non-cycles node is used as an output. */ return false; } + if ((displacement->link != NULL) && !(displacement->link->flag & NODE_LINK_MUTED)) { *r_node = displacement->link->fromnode; *r_socket = displacement->link->fromsock; *r_link = displacement->link; + return true; } - return displacement->link != NULL; + return false; } static void ntree_shader_relink_node_normal(bNodeTree *ntree, _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs