Condense Same Named Materials to Master Instance Material

If I'm missing this, I'm sorry. But My scenes have multiple objects using the same materials with the same names, but they each come into the MatEd as individual materials. This is a huge PITA when I need to change one material then propagate that change across multiple objects.

Can someone write a script that finds all materials with the same name, have the option to correlate the materials to ensure they are actually the same setup (or with in a few parameter close) then use a master material as the new instance material that replaces all other same-named materials.

Please contact me with your costs and time availability. This is a need-it-now item.

Thanks in advance,

Curtis Sponsler | AniMill

Comments

Comment viewing options

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

Condense Material / Bitmap Condenser

Hi Marco, I'm searching for a script that is similar to the condense material script,
I have a large file that has several duplicate bitmaps in the material editor and would like all the materials that use the duplicate bitmap to be merged/instanced. Is this something you could help me with? - Mario

Anubis's picture

hmm, such questions continued frequently

fn InstanceMatByName mat = (
	(for o in objects where o.mat != undefined and o.mat.name == mat.name collect o).mat = mat
)
 
--example usage:
InstanceMatByName (meditMaterials[1])

my recent MAXScripts RSS (archive here)

willchocks's picture

I know this is 7 years old,

I know this is 7 years old, but i've tried this code and it does nothing :(. I'm using max 2016, is there any reason why it doesn't work?

I just get this returned in the listener:

InstanceMatByName()
01 - Default:Standard
<code>
stenionet's picture

Marco Brunetta When I press

Marco Brunetta
When I press "Condense Materials" the dialog closes and nothing happens.

Kstudio's picture

Also you can find script

Also you can find script InstanceMatByName in TrackScripts pack.

Select material in Material Editor and run script InstanceMatByName.

All materials with same class and name will be convert to instance.

Marco Brunetta's picture

Piece of cake! It now always

Piece of cake! It now always select the first entry when creating the tree. How's that?

AttachmentSize
Condense Materials-2.ms 4.16 KB
willchocks's picture

Doesn't work :(

I know this is almost 10 years old, but this script doesn't do anything when i try to run it in 3ds max 2016 :( Is there any way to modify it to make it work?

Thanks

I just get this in my listener:

Rollout:condenseMats
true
AniMill's picture

You are sick dude! ;-) OK,

You are sick dude! ;-)

OK, so ya want a tough one? How about a silly little File Loading/Saving Progress Indicator?

I can't stand that all MAX says when you are saving files is: "Saving..."! I've got big-ass files I'm saving and I have no idea how long to wait before I can click on the screen (or take a bathroom break).

If there was a way to make a UI Dialog Box with an accurate saved Mbyte -vs- total Mbytes and estimated time progress bar - that'd be fab! Even better, would there be a way to modify the standard interface in the lower-left corner to replace or add-to the "Saving..." message.

This one I bet you could sell!

I still want to get you something for your help - seriously, NewEgg, Amazon, Apple giftcard?

Marco Brunetta's picture

That actually IS a tough

That actually IS a tough one. Even tough I can call the save function from maxscript, I don't have any control over what it does or have any feedback. And since the max format is not opensource I can't neither reproduce it. So I'm gonna pass on that one, sorry.

Well... if you'r feeling generous, there's always my PayPal account at [email protected] . All donations go towards getting more beer on weekends. =D

Take care.

AniMill's picture

I do insist! Beer's to

I do insist! Beer's to you!

No worries on the "Save" thing. I'll just keep hammering Autodesk on that one.

Comment viewing options

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