# is there a way how to find out to which objets a material is assigned

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?

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