diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-07 05:20:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-07 05:22:01 +0300 |
commit | d269e6b9f2783f06d3d8fdfb5e391006b22b13f7 (patch) | |
tree | 3100b0e2c2e678bb285f9a3f7abffa6cd67f9997 | |
parent | f1176bd276e7009b394b76840943abb698de9c35 (diff) |
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.
-rw-r--r-- | object_fracture_cell/__init__.py | 4 | ||||
-rw-r--r-- | object_fracture_cell/fracture_cell_setup.py | 8 |
2 files changed, 4 insertions, 8 deletions
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() |