2
$\begingroup$

I have created a particle system in a plane which renders an object (UV Sphere) for each particle. The instanciated UV Sphere has a driver in its scale properties, so the Spheres created with the particle system have this driver working on each particle. This means that I can add drivers to my particles and they work.

Also in the Blender Python API there are these functions in particle objects:

  • driver_add()
  • driver_remove()

(you can see them in bpy.data.objects['Plane.002'].particle_systems[0].particles[0])

Has anybody known where the drivers of particles are stored? Which is the property and its data path?

I have been looking for it in these paths:

  • bpy.data.objects['Foo'].animation_data.drivers -> all object drivers but not the particle ones
  • bpy.data.objects['Plane.002'].particle_systems["ParticleSystem"].settings.animation_data -> None

Here is the test file.

I appreciate any help you can provide.

$\endgroup$
3
$\begingroup$

An emitter object emits particles. It does not have any drivers associated with it that it passes onto particles. When it emits objects, the objects it emits as particles can have drivers.

You need to be looking in the original objects for the drivers, each object gets duplicated as a particle - the drivers the particles use are duplicated from the original object.

>>> bpy.data.objects['Sphere.048'].animation_data.drivers[0].driver.expression
'randf(0.25,0.9)'

As far as the existence of particle_systems[0].particles[0].driver_add() goes, I expect it only exists as an inherited function from the base class, same as keyframe_insert, items, keys... To add a driver to an individual particle would mean it only exists during the particles lifetime, meaning you would need to add the driver as each particle is created. The properties you can access from each particle object is only relevant to a particles existence, so I also expect that most of these values are 'driven' by the particle system and will not actually work with drivers.

$\endgroup$
  • $\begingroup$ I have the same issue, and the proof that the drivers applied to a dupli objects are active in the particles, and they are independently set. I have a size randomization script, with the randomization driven by the time, which creates unpredictable patterns. with only one object duplicated, the particle system shows particles with driven values set individually. so that means that every dupli object is treated individually, that means there is an area where it should be possible to access them $\endgroup$ – Francesco Shanigawe Kobane Sep 14 '18 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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