PDA

View Full Version : how to load a bitmap in a material as a variable.


Decency
11-20-2009, 07:27 PM
Hey everyone, I am trying to write a simple script on my own but having trouble getting started. I have figured out most of the commands I will need, but I am having trouble getting the first part down.

Here is what I have. Let's say in slot 1 of the material editor is a standard material. In the diffuse slot it has a bitmap map, which points to a file C:\Program Files\textures\wood.jpg.

I want to load the actual bitmap itself as a variable.
So something like myMap = the_bit-map_I_referred_to_above


I was trying to get it with

myMap = meditMaterials[1].DiffuseMap

myMap.filename

but this only returns the filename, not the actual bitmap. Any help would be awesome.

PiXeL_MoNKeY
11-20-2009, 07:44 PM
Look up BitmapTexture in the Maxscript Help:<Bitmaptexture>.bitmap Bitmap default: Bitmap:
The bitmap of the texture map. The script can perform any bitmap operations on this bitmap and the changes will be reflected in the texture map. In order to see the results of changing the bitmap in Material Editor and in the viewports, you need to modify any one bitmapTexture property in the Material Editor user interface.<Bitmaptexture>.filenameFilename default: "" -- alias: file_name

The name of the bitmap file.-Eric

Decency
11-20-2009, 08:02 PM
Thank you very much, I just located that and it seems to do what I need. I might just be able to finish the script now!:D

CGTalk Moderation
11-20-2009, 08:02 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.