Automatically remapped bitmaps

Is there a way to return the actual location of the bitmap file loaded rather than the location specified in the bitmap?

Not entirely sure how to phrase this other than to explain it the long way.

Let's say you have a scene file "object.max"
This scene file has an object "teapot01"
This object has a material with a bitmap in the diffuse slot "bitmap.png"
The bitmap is in a folder called "maps" in the same folder as the max file

This scene file was created a while back on an old computer. Now, residing on a new computer, the map is pointing to "c:\oldComputer\maps\bitmap.png"

Since the map is below the max file in the file structure, Max finds it and applies it wothout any fuss. Unfortunately, it's still pointing at "c:\oldComputer\maps\bitmap.png" rather than the file that has actually loaded "c:\newComputer\maps\bitmap.png"

Is there a way to return the actual location of the bitmap file loaded rather than the location specified in the bitmap?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tomshannon's picture

Naturally, I have found my

Naturally, I have found my answer soon after posting online.

the trick seems to be to interrogate the bitmap reference using :

theRealPath = usedMaps (theBitmapReference)

then I can set the filename on them to the correct place:

theBitmapReference.filename = theRealPath[1] as String

Viola! Now rather than trying to find a network server/computer that's long gone, we're pointing to where Max found the file.

hope this helps somebody out there!

--Tom

colinsenner's picture

You can check out my Relink

You can check out my Relink Bitmaps script here in scriptspot to do what you want.

Here's the link:
http://www.scriptspot.com/3ds-max/relink-bitmaps

-Colin

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.