PDA

View Full Version : Find if Bitmap is used by a scene object


djlane
05-06-2007, 08:28 PM
Hi All,

Is there a smart way to find out which scene objects have a material that is using a certain Bitmap.

The only way at the moment I can think of doing it is to loop through all objects checking .material property and looping though the map channels of that material until a bitmaptexture is found to be referencing the file string im checking for.

Im not even sure if that will work, is there a quick and easy way?

Cheers

Dan

djlane
05-06-2007, 09:49 PM
I found this in the help:

usedMaps MAXWrapper

should make things easier.

MoonDoggie
05-07-2007, 02:24 PM
there is an easier way


bmaps = getClassInstances BitmapTexture

for b in bmaps do (
local thefile = filenameFromPath b.filename
if thefile == "me.jpg" then (
-- do something
)
)



hope that helps.

djlane
05-07-2007, 11:22 PM
Thanks MoonDoggie I will give it a try.

Cheers

Dan

djlane
05-08-2007, 03:24 PM
That work great, it solved some other problems I was having too.

Cheers

Dan

MoonDoggie
05-08-2007, 04:30 PM
Good to hear, getclassinstances helps because bitmaps can appear in displacement maps, projection maps etc. Glad it helped.

-Colin

CGTalk Moderation
05-08-2007, 04: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.