Selecting all objects that have been specified in Modifiers Could anyone help in making a script for selecting all objects that are specified in the different modifiers that an object has stacked? For example if my object has a Boolean modifier and an Array modifier, which both refer to an empty or another object (in the Array modifier there is for example an Object offset you can specify). Would it be possible to select all those object with one click? Thanks.
Using the bl_rna.properties collection.  This gives the name, type and other properties of the properties of the modifier. If the property is an object it is most likely, both a PointerProperty (prop.type == 'POINTER') and points to a prop.fixed_type of bpy.types.Object.  If so getattr(modifier, propertyname) will be either the object if set, or None if not.
import bpy
context = bpy.context
obj = context.object
for m in obj.modifiers:
    print(&quot;modifier (%s): %s&quot; % (m.type, m.name))
    for k, v in m.bl_rna.properties.items():
        if v.type == 'POINTER' and v.fixed_type.name == &quot;Object&quot;:
            print(&quot;\t&quot;, k, getattr(m, k))
            # select mod obj if not None
            ob = getattr(m, k, None)
            if ob is not None:
                ob.select_set(True)