PDA

View Full Version : Checking where BitmapTexture is used in scene


lechoo
11-27-2007, 07:45 AM
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?

RustyKnight
11-27-2007, 10:21 AM
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?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]
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.

See Bitmap Files (http://forums.cgsociety.org/Bitmap_Files.htm) for a description of this methodís parameters.

and if that wasn't enoughtusedMaps()

This method returns an array containing the filename strings of all bitmap textures used by the current scene.

Note:

Bitmap textures present only in the Material Editor but not assigned to the scene are excluded.

There is an optional MAXWrapper argument to this method:

usedMaps{<MAXWrapper>}

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

lechoo
11-27-2007, 11:33 AM
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.

MoonDoggie
11-27-2007, 03:14 PM
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

martinB
12-05-2007, 10:10 AM
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...
and if that wasn't enoughtI 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
[/font][/size] [/left]

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

CGTalk Moderation
12-05-2007, 10:10 AM
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.