My application should run on a headless server, thus I cannot rely on Blender GUI, and I need a stand-alone python script.. I have been looking all over the place for an example of the creation on a particle system in pure Python API, but all the examples either assume the GUI usage or are not up to date with the API. Can someone provide a minimal snippet for the creation of a particle system in Python?

Thanks, Simon


1 Answer 1


check this out:

To make this work, create a cube and a cylinder. Then select the cube. Then run the script.

import bpy

obj = bpy.context.active_object
obj.modifiers.new("example", type='PARTICLE_SYSTEM')

particles = bpy.data.particles["ParticleSettings"]

particles.count = 5
particles.render_type = 'OBJECT'
particles.instance_object = bpy.data.objects["Cylinder"]
particles.particle_size = 0.15
particles.emit_from = 'FACE'

Not the answer you're looking for? Browse other questions tagged or ask your own question.