PDA

View Full Version : a way to loop through MultiBitmap maps?


Hobbs
11-21-2007, 09:56 PM
I think i know the answer to this, but does anyone know of a way to loop through all the bitmaps effectively in a multiBitmap?

For example,

. instead of having to go

. bitmapA = openBitmap a, bitmapB = openBitmap a, etc


would there be a way to go,

. for bitmaps in $.material.maps[2] do.....


I know since i'm accessing bitmaps instead of actual values this doesn't really work, but writing it out individually seems kind of tedious.

Any help would be appreciated. Thanks.

Bobo
11-21-2007, 10:22 PM
I think i know the answer to this, but does anyone know of a way to loop through all the bitmaps effectively in a multiBitmap?

For example,

. instead of having to go

. bitmapA = openBitmap a, bitmapB = openBitmap a, etc


would there be a way to go,

. for bitmaps in $.material.maps[2] do.....


I know since i'm accessing bitmaps instead of actual values this doesn't really work, but writing it out individually seems kind of tedious.

Any help would be appreciated. Thanks.

Forgive me my ignorance, but what is a multiBitmap?

Rick Stirling
11-21-2007, 10:35 PM
Is that like a multisub?

For a multisub, assuming material 1 in the editor

howmany = meditMaterials[1].numsubs

for matLoop = 1 to howmany do
(
DTex = meditMaterials[1].materialList[matLoop].diffuseMap.filename
-- do something with our filename here. Maybe bung them into an array
)

You can also query the other maps, for example

STex = meditMaterials[1].materialList[matLoop].specularLevelMap.filename
BTex = meditMaterials[1].materialList[matLoop].BumpMap.filename

CGTalk Moderation
11-21-2007, 10:36 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.