# Find users of a material / texture / image which is not displayed in the outliner

How can one search by name for a material / texture / image datablock that is not displayed in the outliner, for example because it's buried somewhere deep inside a node tree?

Let me please describe some typical use cases to make more clear what I'm talking about:

• When a material / texture / image datablock is 'buried' in the node tree, not displayed in the outliner, and you have a lot of materials with complex node trees, you often have a hard time finding one by name.
• For me, the most common use case is to find if seemingly-orphaned datablocks (mostly named xxx.001 etc.) are still in use somewhere: There are often some datablocks which stay orphaned in the blendfile because the user count has not been set to zero correctly, and the more complex the shaders, the more likely this is. You can shift-delete them, but you have to make 100% sure that they are not in use anywhere.
• Besides this, it is often necessary for complex materials, especially when you have been linking/appending and copy-pasting parts of the node tree from other files. If the appended part uses, for instance, a texture with a name that is also used in your destination blend file, you may have to check if the textures are identical, and therefore find the other one.

Once saw an addon which did similar stuff, but not exactly this. Don't remember which, unfortunately.

Any ideas how we can make our lives easier keeping our blend files clean?

Best greetings, Michael

• You might be able to write a quick bit of python like in this answer. – gandalf3 May 27 '14 at 20:27
• maybe this is the answer... but still I hope it's not... to my understanding, this means your script, in order not to be a workaround, but a safe and clean solution, would have to 'manually' iterate over every type of datablock that you can imagine as a user. Is this right? Or is there any other possible, cleaner way maybe? – Mayqel May 29 '14 at 14:57
• Yes, it's what that script does. I can't immediately think of any other way, but even on large files it shouldn't take that long (maybe a few seconds at most). – gandalf3 May 29 '14 at 19:24

You can set your outliner to Blender File mode. This will show even datablocks with no users. Under materials you will find a list of all materials in alphabetical order. You can even search for datablocks by name in the small search field at the top:
To find users of a datablock, perform the same search in All Scenes mode instead of Blender File mode.