[Bf-extensions-cvs] [d269e6b9] master: Fix 'object_fracture_cell' error setting selection & matrix multiply

Campbell Barton noreply at git.blender.org
Sun Jul 7 04:22:21 CEST 2019


Commit: d269e6b9f2783f06d3d8fdfb5e391006b22b13f7
Author: Campbell Barton
Date:   Sun Jul 7 12:20:35 2019 +1000
Branches: master
https://developer.blender.org/rBAd269e6b9f2783f06d3d8fdfb5e391006b22b13f7

Fix 'object_fracture_cell' error setting selection & matrix multiply

Much older update from 07ec645862275ffe2d60e2d6481080aa0ae8b1f0
enabled instead of disabling the selection.

Also use `@` for matrix multiply.

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

M	object_fracture_cell/__init__.py
M	object_fracture_cell/fracture_cell_setup.py

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

diff --git a/object_fracture_cell/__init__.py b/object_fracture_cell/__init__.py
index fd8f0c4d..af7e623c 100644
--- a/object_fracture_cell/__init__.py
+++ b/object_fracture_cell/__init__.py
@@ -199,9 +199,9 @@ def main(context, **kw):
             def _getObjectBBMinMax():
                 min_co = Vector((1000000.0, 1000000.0, 1000000.0))
                 max_co = -min_co
-                matrix = obj_cell.matrix_world
+                matrix = obj_cell.matrix_world.copy()
                 for i in range(0, 8):
-                    bb_vec = obj_cell.matrix_world * Vector(obj_cell.bound_box[i])
+                    bb_vec = matrix @ Vector(obj_cell.bound_box[i])
                     min_co[0] = min(bb_vec[0], min_co[0])
                     min_co[1] = min(bb_vec[1], min_co[1])
                     min_co[2] = min(bb_vec[2], min_co[2])
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py
index ee3b22c6..0bd55547 100644
--- a/object_fracture_cell/fracture_cell_setup.py
+++ b/object_fracture_cell/fracture_cell_setup.py
@@ -391,17 +391,13 @@ def cell_fracture_boolean(context, obj, objects,
     if (not use_debug_bool) and use_island_split:
         # this is ugly and Im not proud of this - campbell
         for ob in view_layer.objects:
-            ob.select_set(True)
+            ob.select_set(False)
         for obj_cell in objects_boolean:
             obj_cell.select_set(True)
 
-        objects_before = set(scene.objects)
-
         bpy.ops.mesh.separate(type='LOOSE')
 
-        objects_boolean[:] = [obj_cell for obj_cell in scene.objects if obj_cell not in objects_before]
-
-        del objects_before
+        objects_boolean[:] = [obj_cell for obj_cell in view_layer.objects if obj_cell.select_get()]
 
     context.view_layer.update()



More information about the Bf-extensions-cvs mailing list