I'm trying to get the positions of the hair vertices and looked at how some plugins do it. It's usually something like this, using the co_hair function:
import bpy
obj=bpy.context.active_object
ps = obj.particle_systems[0]
strands = len(ps.particles)
if ps.settings.child_type == 'NONE':
start_id, count = (0, strands)
else:
start_id, count = (strands, len(ps.child_particles))
length = 2 ** ps.settings.display_step + 1
for particle_idx in range(start_id, start_id + count):
for step in range(length):
e = ps.co_hair(obj, particle_no=particle_idx, step=step)
print(e)
Yet when i try this, i only get empty vectors:
<Vector (0.0000, 0.0000, 0.0000)>
<Vector (0.0000, 0.0000, 0.0000)>
...
What am i doing wrong?