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
This commit is contained in:
Philipp Oeser 2021-05-14 15:42:07 +02:00
parent c3e13d5a2b
commit d4a36c7ad5
Notes: blender-bot 2023-02-13 18:42:26 +01:00
Referenced by issue #88234, Crash with Eevee when shader displacement socket connection is muted
1 changed files with 3 additions and 1 deletions

View File

@ -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,