From 93fc352cfaf0a38bd59d8bfb44c75bf5835ba3dd Mon Sep 17 00:00:00 2001 From: YimingWu Date: Thu, 5 Jan 2023 12:43:05 +0800 Subject: [PATCH] Fix T102612: Line art crash on loading due to references to other scenes. --- .../gpencil_modifiers/intern/lineart/lineart_cpu.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc index 1ae91ab29c2..93c1571c613 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc @@ -2450,9 +2450,10 @@ static void lineart_object_load_single_instance(LineartData *ld, } if (ob->type == OB_MESH) { use_mesh = BKE_object_get_evaluated_mesh(ob); - if (use_mesh->edit_mesh) { + if ((!use_mesh) || use_mesh->edit_mesh) { /* If the object is being edited, then the mesh is not evaluated fully into the final - * result, do not load them. */ + * result, do not load them. This could be caused by incorrect evaluation order due to + * the way line art uses depsgraph.See T102612 for explaination of this workaround. */ return; } } @@ -2460,7 +2461,7 @@ static void lineart_object_load_single_instance(LineartData *ld, use_mesh = BKE_mesh_new_from_object(depsgraph, ob, true, true); } - /* In case we still can not get any mesh geometry data from the object */ + /* In case we still can not get any mesh geometry data from the object, same as above. */ if (!use_mesh) { return; }