Determining which object is the source for a particle in the Particle System when using collections

If a particle system uses a collection with different meshes as its source, we can use the Blender Python API to determine which object is the source of each particle.

To access particles in their current state, we first need to “calculate” the scene – get its “evaluated” version, in which all effects and modifiers are applied to all objects, including particles. This could be done using depsgraph.

From the evaluated depshgraph we can get a list of scene instances, which are also objects of the particle system.

We need to define it in the form of an iterator so as not to change the state of the objects in it.

Now we can, by going through the particles from iterator, show the object – the source of the current particle with coordinates of the particle in the scene.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments