Condense Materials (By Texture Name, Not IDs)

I'm getting frustrated with 3dmax. I'm importing a series of 60 models that use the same 5 textures

yet when I attach them all together, for some reason the IDs are continuous and don't condense. instead I have 60 submats in my multi-material.

is there a script that can condense my materials based on there texture name? so far none of the material editor tools offer a way to do this. the only current solution I've gotten is importing into milkshape, then re-exporting out. but since some of these 60 models are actually morph targets I'm afraid of any vertex reordering that may make the morph un-usable. so I'm looking for a way to fix the materials in 3dsmax only.

/anyway thanks in advanced.

ps I found a few scripts on this site that fit the bill, but there download links no longer work


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
stenionet's picture

It will be really

It will be really useful.
Hope someone develop this script.

Total Anarchy's picture
mariokart64n's picture

Anubis's advice isn't very

Anubis's advice isn't very helpful, did he not understand what I was describing? O_o

obviously you get that option when attaching 2 objects. but what if the IDs are different, and the material names are different.

there is no option to condense by diffuse texture anywhere in max. and that is the issue. so we get a multimaterial with like 20000000 materials all different names, and IDs.. yet the same common diffuse texture.

I did find a preping work around, just export the model and reimport it.
some export formats will condense your materials before exporting. then when you import they will be condensed for you. unfortunately alot of my work was already done, rigging, morphers, animations.. so I wasn't able to export and import, else I would have lost all my work.

since then I've learned a few things about maxscripting, alot of what you want can be seen in the listener, and understood by the maxscript documents.

but sadly I haven't tried to script anything for this yet. I think it require more knowledge about maxscript then I currently have.
I think you would have to call the materials of all the models in the scene. then grab there diffuse file name. then instance the ones that have the same name. but it gets complicated if you want to replace the entire multi material.. i think almost impossible todo by way of maxscript... :(

Anubis's picture

Ok, you are rigth Mario, the

Ok, you are rigth Mario, the asking feature not exist in Max and not such script for that purpose (at least not online). About if it is possible to achieve what you ask via MaxScript, the answer is yes, but I dont beliеve someone to write it for free.

[edit] I never come to such cases where to attach meshes after rigging, but as you say so reexport works, then you can export, then import them to New separate max scene and then return them back to the original scene by Merge/Replace.

my recent MAXScripts RSS (archive here)

Anubis's picture

This is fixed in the initial

This is fixed in the initial process of attaching then prompt appear. [See picture]

my recent MAXScripts RSS (archive here)

af13's picture

You didn't happen to find a

You didn't happen to find a solution to this, did you? I'm looking for something similar....


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.