# Display all users of a datablock [duplicate]

How can I see all the "users" of a datablock? Is it possible with the Blender's UI? With Python?

For example, I'd like to know which 3 objects are the users of my material:

• For that specific case you can select one object which you know has the material and press Shift L > Material. – gandalf3 Jun 24 '14 at 3:46
• For the material check this : blender.stackexchange.com/questions/4817/… – lucblender Jun 24 '14 at 7:36
• – gandalf3 Jun 24 '14 at 20:04

Without Python:

You can simply select one of the objects and use Shift+L > Material to select all the objects that share the same material. If the object has more than one material, it'll check for the one that's currently active.

With Python:

It's a bit of a workaround. Each material has the attribute users, but this is only the number of users and not actually a list of objects/data.

So in order to get a list of all the objects that use a certain material, we have to loop through the objects, then through each object's material slots:

import bpy

objects = bpy.context.selectable_objects
mat = bpy.context.object.active_material

for obj in objects:
for slot in obj.material_slots:
if slot.material == mat:
obj.select = True

• Another non-python way is to search with the outliner – sambler Jun 24 '14 at 8:18