diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 13:46:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-07 13:46:56 +0400 |
commit | 93226d0188184b45d2554572cca2f64f23cf5e8e (patch) | |
tree | b6ff5f6a48964f7b4863d78c6e2b41458648aa9c /object_fracture_cell/fracture_cell_setup.py | |
parent | 313153117b6314e25775cd03065ef246b16575e7 (diff) |
support for using other objects particles as input
Diffstat (limited to 'object_fracture_cell/fracture_cell_setup.py')
-rw-r--r-- | object_fracture_cell/fracture_cell_setup.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index 9a6ccbbf..c2237f68 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -34,7 +34,8 @@ _redraw_yasiamevil.arg = dict(type='DRAW_WIN_SWAP', iterations=1) def _points_from_object(obj, source): _source_all = { - 'PARTICLE', 'PENCIL', + 'PARTICLE_OWN', 'PARTICLE_CHILD', + 'PENCIL', 'VERT_OWN', 'VERT_CHILD', } @@ -77,6 +78,12 @@ def _points_from_object(obj, source): points.extend([matrix * v.co for v in mesh.vertices]) bpy.data.meshes.remove(mesh) + def points_from_particles(obj): + points.extend([p.location.copy() + for psys in obj.particle_systems + for p in psys.particles]) + + # geom own if 'VERT_OWN' in source: points_from_verts(obj) @@ -87,10 +94,12 @@ def _points_from_object(obj, source): points_from_verts(obj_child) # geom particles - if 'PARTICLE' in source: - points.extend([p.location.copy() - for psys in obj.particle_systems - for p in psys.particles]) + if 'PARTICLE_OWN' in source: + points_from_verts(obj) + + if 'PARTICLE_CHILD' in source: + for obj_child in obj.children: + points_from_particles(obj_child) # grease pencil def get_points(stroke): @@ -115,7 +124,7 @@ def _points_from_object(obj, source): def cell_fracture_objects(scene, obj, - source={'PARTICLE'}, + source={'PARTICLE_OWN'}, source_limit=0, source_noise=0.0, clean=True, |