Fix part of T95654: Cycles crash with text objects in excluded view layers

This is a bug on the Blender side, where the depsgraph does not have proper
relations for text object duplis and fails to include the required materials
in the dependency graph. But at least Cycles should not crash.
This commit is contained in:
Brecht Van Lommel 2022-02-17 17:21:06 +01:00
parent e5100ca3ad
commit 9281ba5812
1 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,8 @@ typedef map<string, ConvertNode *> ProxyMap;
void BlenderSync::find_shader(BL::ID &id, array<Node *> &used_shaders, Shader *default_shader)
{
Shader *shader = (id) ? shader_map.find(id) : default_shader;
Shader *synced_shader = (id) ? shader_map.find(id) : nullptr;
Shader *shader = (synced_shader) ? synced_shader : default_shader;
used_shaders.push_back_slow(shader);
shader->tag_used(scene);