PDA

View Full Version : Setting DXShader textures with MXS


RobGalanakis
10-14-2007, 12:50 AM
A bit new to maxscript and I'm having some trouble.

I ported our main BRDF shader from our engine into Max, everything works very nicely. The Art Director suggested a way to auto-load all our textures for an object, since applying 8 maps or so can be very tedious over and over and it'd save time in the long run, and all our texture names are standardized (just the object name and a trailer letter to denote the map type).

I've figured out how to do this easily enough with a standard material:
currentFile = getOpenFileName caption:"Open this Max File"
currentFilePath = getFilenamePath currentFile
currentFileFile = getFilenameFile currentFile

meditMaterials[2].diffuseMap = Bitmaptexture fileName:(currentFilePath + currentFileFile + "D.tga")

The problem though is that I have no idea how to get the equivalent of .diffusemap for a DX material. I have used showproperties for the shader and understand how to set it, but I am having serious trouble understanding what it wants for a "bitmap," the Maxscript help is very confusing on this issue for me. The shader wants "meditMaterials[1].DiffuseMap : bitmap" and I can't figure out what to use for bitmap to get the function to work.

Any help?

EDIT: Well after trawling through maxscript help over a big bowl of oatmeal, I think I found the answer... I will test tommorrow at work (it compiles now with what I'm doing), and say what the answer was if it does work.

CGTalk Moderation
10-14-2007, 12:50 AM
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.