Remove unused materials?

Is there a method to remove all unused materials from my folder at once?

I can remove them one at a time by checking dependancies, then finding the file in the finder, but I’ve somehow build up many unused materials, too many for this method.

Thanks.

through an editor script that uses select dependencies to find out whats used, then “invert” that and select them

Yikes, no idea how to do that. Seems that could be a good feature to add to Unity, Flash, video editing and most 3D programs have built in ways to remove unused assets.

Hi all!

I have created this script that removes all unused materials in all selected scenes.

1- Select all your scenes (CTRL+left click).
2- Execute the Script.

Enjoy it!

492691–17322–$CleanMaterials.cs (3.82 KB)

Hello there!

I just ran that script, and it seems to have removed every material in my project, used or not!
I may have executed it wrong, but just a warning!

how do I “execute the script” ?