View Full Version : Need scripts that remove duplicate materials

01 January 2008, 02:43 PM

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!

01 January 2008, 02: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.

01 January 2008, 10: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


01 January 2008, 03:41 PM
Shane above says "userMap" functions, what he means is the "usedMaps" function, I forgive you.


01 January 2008, 10: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 January 2008, 10: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.