Exporting Blender Particles - is it possible?


#1

I’d like to export Blender’s particles out to other packages. However, since they are a modifier, none of the export utilities are working.

Is there a way to get particles out of Blender 2.5?

Thanks!


#2

Do you just mean exporting the particle positions? You can access that data from python


#3

Is it in bpy.ops.particle? It looked like everything in there only pertained to hair particles, but nothing about get positions. Could I get a nudge in the right direction?

BTW, thanks for all you did/do for blender Matt!


#4

nah, they’re all operators - i.e. wrapping in python things that you can do from the ui.

here’s a snippet from an exporter i’m working on that gets particle locations and sizes and stores them in two lists:


def get_particles(scene, ob, psys):
    P = []
    width = []

    for pa in psys.particles:
        P += [pa.location[0], pa.location[1], pa.location[2]]
        width.append(pa.size)
    
    return (P, width)

btw that code gets all particles regardless of state, you may also want to check

if pa.alive_state == 'ALIVE':

psys is something like ob.particle_systems[‘Name_of_my_particle_system’]

cheers


#5

You’re a champ! Thanks!


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.