Unused material cleanup in 3ds max?

Would anyone happen to know off hand of any method or tools/scripts, for 3ds max, for quickly cleaning up unused materials in a scene? I wanted to check before attempting to write one of my own.

I think any material not applied to an object in your scene is classed as “not in the scene”. So do you mean cleaning up the material editor slots? I think there are a bunch of utilitys in the menus at the top of the material editor that may do this for you.

Hmm…that might work. I can’t believe I didn’t even notice any of those menus up until now =).

EDIT: Thanks, that did the trick. I really should get better acquainted with Max’s material system…

You do need a photographic memory with Max these days :slight_smile:
I have myself written scripts and then found “hidden” ways to do the same thing in Max.

Seems like it. On the bright side, after all the pain of trying to find something, you don’t so easily forget it…usually ;).

Hi guys, having same problem than ryguy4377 and can’t get it. What do you mean with "any material not applied to an object in your scene is classed as “not in the scene”?
Could not find anything usefull in material editor. I already know how to clean the 24 “slots”, but what i want is to clean all unused/missing_folder materials in the whole scene.
And apologize for my language, i’m french!

ps: still working on max9.

Unused materials can’t really exist in Max scenes. In order to be part of the scene (meaning the .max file), a material needs to 1) be assigned to 1 or more scene objects, OR 2) assigned to a slot in the material editor.

If it’s neither of those things, it disappears (and subsequently won’t be saved).

Note, the above is for “root” materials only. If you have unused sub-materials inside a Multi-Submaterial, that’s a different issue. Those will still stay in the scene as long as the root material it belongs to meets one of the two rules above.

[QUOTE=Adam Pletcher;2325]Unused materials can’t really exist in Max scenes. In order to be part of the scene (meaning the .max file), a material needs to 1) be assigned to 1 or more scene objects, OR 2) assigned to a slot in the material editor.

…[/QUOTE]

Umm, this seems to be not true. Every time I create a new scene, all scene materials from a previous project still exists even with no objects. Furthermore, after working on the new project that has its own materials, the existing scene materials along with the new materials are attached to the new project file. So I think this is what nosens is referring to and I m having the same exact problem. Here is a screenshot that discribes what we are talking about, and are wondering how to get rid of the scene materials.

Those shaders seem to be associated with the environment, which might be a clue. Are you using a rendering plugin or something of the sort?

Max really, really loves your materials and wants to cling tenaciously to them against all logic.
Max builds a material library for you, and stores material libraries elsewhere than the scene file.

to clean up the materials in the material editor:
Material editor > Modes > Compact Material Editor
then
Utilities > Condense Material slots

this will eliminate any Materials not referenced by the scene.

Edit: nevermind, this suggestion was already given.

You mentioned that “Condense Material Slots” will eliminate any materials not referenced by the scene. In my case, it does seem to eliminate materials that are being used in the scene from the material slots (it deletes all of them, but leaves a few; I repopulate additional slots using the eye dropper tool on objects whose materials I can see are not showing the slot); run Condense Material Editor Slots again, and it deletes some of the materials in some of the slots, including some that it was showing after the first time I ran the utility. Doesn’t seem to be consistent. Anyone have any thoughts why? Thanks in advance.