Remove Duplicate materials from Multi-sub object

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  04 April 2013
Unhappy Remove Duplicate materials from Multi-sub object

Hi guys...

I am working on Max 2012 and am working on quite a big scene.

I have combined a number of models together and sampled the multi-sub material in the Material Editor.

Unfortunately, it seems that Max has generated about 300 different materials, even though I am only using about 20 textures. After looking at some of the materials, I have found that there are alot of duplicate materials that are using one texture.

Is there a script that detects by texture, then deletes the duplicates?

Any help would be massively appreciated..

Cheers
__________________
Enter..... Stranger......
 
  04 April 2013
Maybe you can try this?

http://docs.autodesk.com/3DSMAX/15/...5F406C1CD1C.htm

You may have tried, but you didn't mention anything you have tried yet.
__________________
Juan Martinez | Blog | Animator
 
  04 April 2013
Hey Juan

Hello... I have tried the Clean MultiMaterial Utility...
It didnt work unfortunately :(
__________________
Enter..... Stranger......
 
  04 April 2013
I answered you over at Polycount too, but...

I had this script laying around. If you are only using diffuse maps it might help you.


(
	prevMatCount = scenematerials.count
	diffuseMapList = #()
	materialList = #()

	scenemats = scenematerials


	for m = 1 to scenemats.count do
	(
		dmapFile = scenemats[m].diffuseMap.filename
		getMat = findItem diffuseMapList dmapFile
		
		if getMat == 0 then
		(
			--MATERIAL NOT FOUND, ADD IT TO THE MATERIAL LIST
			append diffuseMapList dmapFile
			append materialList m
		)
		else
		(
			--MATERIAL FOUND, APPLY TO ALL IT'S OBJECTS
			for obj in refs.dependents scenemats[m] do
			(
				try
				(
					obj.material = scenemats[getMat]
				)
				catch()
			)
			
		)
	)
	
	gc lite:true
	
	messageBox ("Materials condensed from " + prevMatCount as string + " material(s) to " + materialList.count as string + " material(s).") title:"Materials"
)
__________________
Juan Martinez | Blog | Animator
 
  04 April 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:28 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.