diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2021-03-31 16:35:40 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2021-03-31 16:35:40 +0300 |
commit | 94079ffc7f0e49c9eb923eb59b065973ae9cd990 (patch) | |
tree | 99df629387b0b595fda8a8ac261accfbcb050ea0 /source | |
parent | 23c1e48e19dd4281516723e1a6dcc80e752b1bf7 (diff) |
Fix T86879 Boolean exact crash with dependency loop.
When boolean's Object also has a modifier that depends back on
the target Object, a crash occurred.
In a case like this, BKE_modifier_get_evaluated_mesh_from_evaluated_object
returns NULL, so just have to protect against that case.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_boolean.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index fae8ac72108..ffb40bea9ba 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -660,6 +660,9 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, BLI_array_append(material_remaps, NULL); if (bmd->flag & eBooleanModifierFlag_Object) { mesh_operand = BKE_modifier_get_evaluated_mesh_from_evaluated_object(bmd->object, false); + if (!mesh_operand) { + return mesh; + } BKE_mesh_wrapper_ensure_mdata(mesh_operand); BLI_array_append(meshes, mesh_operand); BLI_array_append(obmats, &bmd->object->obmat); @@ -673,6 +676,9 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) { if (ob->type == OB_MESH && ob != ctx->object) { Mesh *collection_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob, false); + if (!collection_mesh) { + continue; + } BKE_mesh_wrapper_ensure_mdata(collection_mesh); BLI_array_append(meshes, collection_mesh); BLI_array_append(obmats, &ob->obmat); |