PDA

View Full Version : Need scripts that remove duplicate materials


macrod
01-30-2008, 01:43 PM
Hi,

My goal is, replacing all materials with the same diffuse map in the scene with any one these materials. That means, as long as the material use the same diffuse, they have no difference to the game engine, so i keep one and discard the rest.

Note: all the same-diffuse-materials may have different names, they may be in different multi-subobject materials.

Thanks in advance!

macrod
01-30-2008, 01:52 PM
first, i will do a Instance Duplicate Maps, so that the scene contains no duplicate bitmap.

i'd like to have a command to list all the unique bitmaps, then find their materials.

RustyKnight
01-30-2008, 09:54 PM
As I read this, you want to locate all the instances of a, say bitmap texture, and condence these down to a single instance...cause I have to say, I'm personally having some difficulty understanding what it is you mean...but it is early...
bMaps=(getClassInstances Bitmaptexture)Will give you a list of all the bitmap textures in the scene. You can then trall this for possible duplicate bitmaps

I'd also recommend a visit to the "texture - TextureMap" section of the docs as I found; userMaps function and even enumerateFiles which may help

Happy hunting

Shane

MoonDoggie
01-31-2008, 02:41 PM
Shane above says "userMap" functions, what he means is the "usedMaps" function, I forgive you.

-Colin

RustyKnight
01-31-2008, 09:30 PM
Shane above says "userMap" functions, what he means is the "usedMaps" function, I forgive you.

-ColinHay, it's been a long day :P

CGTalk Moderation
01-31-2008, 09:30 PM
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.