Notifications
Clear all

[Closed] Need scripts that remove duplicate materials

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!

4 Replies

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.

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

Shane above says “userMap” functions, what he means is the “usedMaps” function, I forgive you.

-Colin

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

Hay, it’s been a long day