Notifications
Clear all

[Closed] Get Bitmap Info

Is there a way to access the bitmap info held in the diffuse slot to apply to your current object selected? I’m trying to get at this info so I can basically do the same thing BitMap Fit does, but in one click. I’ve got a couple of lazy guys I’m trying to assuage
Thanks

Geoff

2 Replies

There’s a couple ways to go about this… In the max help index under Bitmap / Values you’ll find the properties .height and .width… So you’d just have to create a new bitmap object with your image in it… Then just check its width/height… For a more direct approach, and if you’re not adverse to installing the AVGuard extension it provides a GetBitmapInfo function that returns all kinds of useful bitmap info…

The following is from the avg_dlx70.txt file (found in the zip below)…


getBitmapInfo {<filename> | <bitmap>}
Returns information on the specified bitmap file as an 13 element array. Array elements
are:
1. Expanded bitmap file name as String
2. Device name as String
3. Bitmap width as Integer
4. Bitmap height as Integer
5. Number of bits for each RGB component value as Integer
6. Number of bits for alpha component as Integer.
7. The aspect ratio of the bitmap as Float
8. The gamma of the bitmap as Float
9. Whether the bitmap has alpha as a Boolean
10. First frame as Integer
11. Last frame as Integer
12. The bitmap type (from BitmapInfo::Type()) as Integer. See topic “Bitmap Types” in the SDK help file
for more info on the bitmap types.
13. The bitmap flags (from BitmapInfo::Flags()) as Integer. See topic “Bitmap Flags” in the SDK help file for
more info on the meaning of each bit.

You can get the extension at [ http://www.scriptspot.com/extensions/web_upload/Larry%20Minton/avg_dlx70_9.zip ]( http://www.scriptspot.com/extensions/web_upload/Larry%20Minton/avg_dlx70_9.zip) 

Yes, this stuff is good, but shouldn’t I be able to do something like selection[1].material.diffusemap = b1, then pull the info from the bitmap already applied to the object, and modify the UVW mapping based upon this info? Its really just a lazier version of the FitBitmap alignment method, I just can’t grasp how its (the Bitmap Fit align tool) getting its info. thanks for the help though. I need some coffee.