diff options
Diffstat (limited to 'object_fracture_cell/__init__.py')
-rw-r--r-- | object_fracture_cell/__init__.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/object_fracture_cell/__init__.py b/object_fracture_cell/__init__.py index 68d887a5..e9f70a44 100644 --- a/object_fracture_cell/__init__.py +++ b/object_fracture_cell/__init__.py @@ -13,9 +13,9 @@ bl_info = { } -#if "bpy" in locals(): -# import importlib -# importlib.reload(fracture_cell_setup) +# if "bpy" in locals(): +# import importlib +# importlib.reload(fracture_cell_setup) import bpy from bpy.props import ( @@ -29,6 +29,7 @@ from bpy.props import ( from bpy.types import Operator + def main_object(context, collection, obj, level, **kw): import random @@ -79,7 +80,7 @@ def main_object(context, collection, obj, level, **kw): center='MEDIAN', ) - #---------- + # ---------- # Recursion if level == 0: for level_sub in range(1, recursion + 1): @@ -99,8 +100,7 @@ def main_object(context, collection, obj, level, **kw): objects_recurse_input.reverse() elif recursion_chance_select in {'CURSOR_MIN', 'CURSOR_MAX'}: c = scene.cursor.location.copy() - objects_recurse_input.sort(key=lambda ob_pair: - (ob_pair[1].location - c).length_squared) + objects_recurse_input.sort(key=lambda ob_pair: (ob_pair[1].location - c).length_squared) if recursion_chance_select == 'CURSOR_MAX': objects_recurse_input.reverse() @@ -124,7 +124,7 @@ def main_object(context, collection, obj, level, **kw): if recursion_clamp and len(objects) > recursion_clamp: break - #-------------- + # -------------- # Level Options if level == 0: # import pdb; pdb.set_trace() @@ -182,6 +182,7 @@ def main(context, **kw): rb.mass = mass elif mass_mode == 'VOLUME': from mathutils import Vector + def _get_volume(obj_cell): def _getObjectBBMinMax(): min_co = Vector((1000000.0, 1000000.0, 1000000.0)) @@ -207,7 +208,6 @@ def main(context, **kw): return _getObjectVolume() - obj_volume_ls = [_get_volume(obj_cell) for obj_cell in objects] obj_volume_tot = sum(obj_volume_ls) if obj_volume_tot > 0.0: @@ -387,7 +387,6 @@ class FractureCell(Operator): default=1.0, ) - # ------------------------------------------------------------------------- # Object Options @@ -444,7 +443,6 @@ class FractureCell(Operator): return {'FINISHED'} - def invoke(self, context, event): # print(self.recursion_chance_select) wm = context.window_manager @@ -492,7 +490,6 @@ class FractureCell(Operator): rowsub.prop(self, "margin") rowsub.prop(self, "use_island_split") - box = layout.box() col = box.column() col.label(text="Physics") @@ -500,14 +497,12 @@ class FractureCell(Operator): rowsub.prop(self, "mass_mode") rowsub.prop(self, "mass") - box = layout.box() col = box.column() col.label(text="Object") rowsub = col.row(align=True) rowsub.prop(self, "use_recenter") - box = layout.box() col = box.column() col.label(text="Scene") |