Page 1 of 1
Accessing the locations of trail particles or approx alg?
Posted: Fri Aug 16, 2013 9:42 pm
I made a simple script to rip particle locations to a point mesh, but the trail particles are not included. Do I need to manipulate the current_frame and repeat the rip at various points in time?
How would I get the particle locations at sub-step resolution in time? Just set the frame to a non-integer value?
Posted: Fri Aug 16, 2013 11:05 pm
So far this is what I've got:
Code: Select all
from math import modf
bl_idname = "parts.to_verts"
bl_label = "r2p:particles to Points"
assert context.active_object.particle_systems.active != None
has = True
has = False
scn = context.scene
frame = scn.frame_current
psys = context.object.particle_systems.active
pset = psys.settings
m = bpy.data.meshes.new('P-cloud_verts')
v = 
tc = pset.trail_count
span = (frame - pset.frame_start) * pset.path_end
step = span / tc
cf = frame - span
for r in range(tc):
sub,f = modf(cf + (step * r))
for p in psys.particles:
o = bpy.data.objects.new('P-cloud',object_data=m)
if __name__ == '__main__':
It was a problem with the wrapped location vectors!
Posted: Fri Aug 16, 2013 11:44 pm
Looked closely at the vertex count of the output object.
They were all stacked at the ending particle location. I thought it was a problem with setting the frame which it was apparently not.
changed the line
and it worked. ( also had to filter out particles that were not alive)
Still have to adjust the spacing to be WYSIWIG