7
$\begingroup$

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:

enter image description here

$\endgroup$
3
  • 2
    $\begingroup$ For that specific case you can select one object which you know has the material and press Shift L > Material. $\endgroup$ Commented Jun 24, 2014 at 3:46
  • $\begingroup$ For the material check this : blender.stackexchange.com/questions/4817/… $\endgroup$ Commented Jun 24, 2014 at 7:36
  • $\begingroup$ Related: blender.stackexchange.com/a/2450/599 $\endgroup$ Commented Jun 24, 2014 at 20:04

1 Answer 1

5
$\begingroup$

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 
$\endgroup$
1
  • 2
    $\begingroup$ Another non-python way is to search with the outliner $\endgroup$ Commented Jun 24, 2014 at 8:18

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.