[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3551] trunk/py/scripts/addons/ object_fracture_voroni: minor fixes to last commit, also use basic BGE physics options
Campbell Barton
ideasman42 at gmail.com
Fri Jun 29 11:58:46 CEST 2012
Revision: 3551
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3551
Author: campbellbarton
Date: 2012-06-29 09:58:32 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
minor fixes to last commit, also use basic BGE physics options
Modified Paths:
--------------
trunk/py/scripts/addons/object_fracture_voroni/__init__.py
trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py
Modified: trunk/py/scripts/addons/object_fracture_voroni/__init__.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_voroni/__init__.py 2012-06-28 22:42:27 UTC (rev 3550)
+++ trunk/py/scripts/addons/object_fracture_voroni/__init__.py 2012-06-29 09:58:32 UTC (rev 3551)
@@ -95,11 +95,13 @@
for obj_cell in objects:
obj_cell.select = True
- print("Done! %d objects in %.4f sec" % (len(objects), time.time() - t)
+ print("Done! %d objects in %.4f sec" % (len(objects), time.time() - t))
+
class FractureCell(Operator):
bl_idname = "object.add_fracture_cell_objects"
bl_label = "Cell Fracture Helper Objects"
+ bl_options = {'PRESET'}
# -------------------------------------------------------------------------
# Source Options
Modified: trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py
===================================================================
--- trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py 2012-06-28 22:42:27 UTC (rev 3550)
+++ trunk/py/scripts/addons/object_fracture_voroni/fracture_cell_setup.py 2012-06-29 09:58:32 UTC (rev 3551)
@@ -130,9 +130,13 @@
# -------------------------------------------------------------------------
# GET POINTS
- points = _points_from_object(obj, source)
+ points = _points_from_object(obj, source)
if not points:
+ # print using fallback
+ points = _points_from_object(obj, source | {'VERT_OWN'})
+
+ if not points:
print("no points found")
return []
@@ -247,9 +251,16 @@
objects.append(obj_cell)
-
scene.update()
+
+ # move this elsewhere...
+ for obj_cell in objects:
+ game = obj_cell.game
+ game.physics_type = 'RIGID_BODY'
+ game.use_collision_bounds = True
+ game.collision_bounds_type = 'TRIANGLE_MESH'
+
return objects
More information about the Bf-extensions-cvs
mailing list