diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-15 04:01:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-15 04:01:33 +0300 |
commit | a5a2b36b9ead8f1b6aed60833c03d7a90ace9b03 (patch) | |
tree | b7adefbbb94b802283ab50e9c8a7434bdd457645 /object_fracture_cell | |
parent | 376d609664afd1df56f50ba1139b9efe2991732a (diff) |
Fix T66820: Cell fracture not working properly
This failed to properly calculate booleans from the fractured cells.
Diffstat (limited to 'object_fracture_cell')
-rw-r--r-- | object_fracture_cell/fracture_cell_setup.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index 6bd8937d..83f7cdd1 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -321,7 +321,6 @@ def cell_fracture_boolean(context, obj, objects, collection = context.collection scene = context.scene view_layer = context.view_layer - depsgraph = context.evaluated_depsgraph_get() if use_interior_hide and level == 0: # only set for level 0 @@ -337,11 +336,18 @@ def cell_fracture_boolean(context, obj, objects, if use_interior_hide: obj_cell.data.polygons.foreach_set("hide", [True] * len(obj_cell.data.polygons)) + # Calculates all booleans at once (faster). + depsgraph = context.evaluated_depsgraph_get() + + for obj_cell in objects: + + if not use_debug_bool: + obj_cell_eval = obj_cell.evaluated_get(depsgraph) mesh_new = bpy.data.meshes.new_from_object(obj_cell_eval) mesh_old = obj_cell.data obj_cell.data = mesh_new - obj_cell.modifiers.remove(mod) + obj_cell.modifiers.remove(obj_cell.modifiers[-1]) # remove if not valid if not mesh_old.users: |