[Bf-blender-cvs] [94079ffc7f0] master: Fix T86879 Boolean exact crash with dependency loop.

Howard Trickey noreply at git.blender.org
Wed Mar 31 15:36:08 CEST 2021


Commit: 94079ffc7f0e49c9eb923eb59b065973ae9cd990
Author: Howard Trickey
Date:   Wed Mar 31 09:35:40 2021 -0400
Branches: master
https://developer.blender.org/rB94079ffc7f0e49c9eb923eb59b065973ae9cd990

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.

===================================================================

M	source/blender/modifiers/intern/MOD_boolean.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list