Notifications
Clear all

[Closed] Checking where BitmapTexture is used in scene

Hi, everyone.
I’m collecting bitmap textures from scene like this:
BTs = getClassInstances BitmapTexture

How can I check where each bitmap texture is used? For example in what material, in what modifier etc?

4 Replies
1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

My first instinct would be to write a whole bunch of functions that would iterate through the various material libraries, collecting the various pieces of information…but then I read the docs…

enumerateFiles [ <MAXWrapper_obj> ] <function> [<arg>] [#inactive] [#videoPost] [#render] [#missing] [#localOnly]
[left]Lets you run through all the bitmap files currently used in the scene or in an individual object. You can filter this so it just gives you the bitmap files that are inactive or missing.
[/left]
[left]See Bitmap Files for a description of this method’s parameters.
[/left]

and if that wasn’t enought

[left][b]usedMaps/b
[/left]
[left]This method returns an array containing the filename strings of all bitmap textures used by the current scene.
[/left]
[left]Note:
[/left]
[left]Bitmap textures present only in the Material Editor but not assigned to the scene are excluded.
[/left]
[left]There is an optional MAXWrapper argument to this method:
[/left]
[left]usedMaps{<MAXWrapper>}
[/left]
[left]If a MAXWrapper is specified, the method returns a list of all bitmap textures used by that object. In order to include all Material Editor bitmap textures, you can use:
I suggest you take a look at the BitMapTexture : TextureMap entry in the docs (from the index, look for texture – TextureMap…that should get you there).

Hope it helps!
Shane
[/left]

Thanks, this definetly helps.
What I’m looking for is a way to locate where missing map is used, to do some cleanup. I know that I can put empty string into filename but this isn’t a clean solution.

Check my script that relinks bitmaps, hopefully it will give you some insight or provide the functionality you’re after.

http://www.scriptspot.com/3ds-max/relink-bitmaps

This topic is interesting for me, too, thanks for posting.
What really is needed is the inverse of what you posted, i.e. finding the MAXWrapper(s) using a bitmap for a given bitmap/file name.

Any ideas?
– MartinB