1
$\begingroup$

I have a few objects in my scene and I sort them in collections based on the some parameters of the applied particle systems. No problems here. I would also like to check if an object has a particle system applied or something like a collision modifier. How would I go about doing that?

I have tried the len(obj.particles_systems) == 0 as my condition but that didn't work.

Thank you in advance!

$\endgroup$
1
$\begingroup$

The modifiers type are given here.

And you can simply test the type you want from that (including 'PARTICLE_SYSTEM' or 'COLLISION').

Here, they are simply printed:

import bpy

obj = bpy.context.object

for modifier in obj.modifiers:
    print( modifier.type )
$\endgroup$

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.