5
$\begingroup$

I have a bunch of materials in one file (made by appending objects from multiple files) and I don't know, to which objects they are assigned, but I know, that they are all same. How can I find out, to which objects the material is assigned?

$\endgroup$
4
$\begingroup$

This creates a list of all materials and objects. Paste it into the text editor and press the run button. The results will be displayed in the console windows. You might want to open it from the menu: Window/Toggle System Console

import bpy

for mat in bpy.data.materials:
    print()
    print(mat.name)
    print("-"*20)
    for obj in bpy.data.objects:
        for slot in obj.material_slots:
            if slot.material == mat:
                print(obj.name)

Script is derived from: How to know which object is using a material

Sample output:

Material
--------------------
Cube

Material.001
--------------------
Cube
Sphere
$\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.