import bpy
import inspect
#https://blender.stackexchange.com/questions/90535/selecting-all-objects-that-have-been-specified-in-modifiers
def select_objects_in_modifiers(obj):
rna = obj.bl_rna
refs = set()
for mod in obj.modifiers:
for key,val in inspect.getmembers(mod):
if val is None:
continue
if hasattr(val, "bl_rna") and val.bl_rna == rna:
refs.add(val)
for o2 in refs:
o2.select = True
#print(o2)
select_objects_in_modifiers(bpy.context.active_object)
|
Blender python API quick-start
Syntax highlighting by Pygments.