PDA

View Full Version : Need help in finishing the material maxscript plugin


bloodlocust
07-03-2002, 12:46 AM
Hello everyone!

The following is an extract from a call I'm doing. It's a custom material I am making as part of my toolset for game development.



mapbutton layer0 " Empty " tooltip:"Select texture for layer 0"

on layer0 picked texmap do
(
delegate.diffusemap = texmap -- write to diffuse layer 1
layer0.text= texmap.filename -- write filename back to button
)


The trouble I am having is, that I am trying to create a simple button, which when clicked on, automatically takes us to the Bitmap material browser. Right now it requires the user to choose from the materials/maps dialog - I want to avoid this and just load the bitmap to the diffuse slot. I like the bitmap chooser though as it has a preview window...

Any advice would be appreciated! :)

nates
07-04-2002, 03:22 AM
assuming that delegate is your material object, try something like:

(
bMap=selectBitMap()
delegate.diffuseMap = Bitmaptexture filename:bMap.filename
)


just a suggestion, try opening the listener and enabling it. Then go through some of the actions that you want your script to perform. It usually won't display all of the functions that you need, but it may give you enough to start with. Also, look at the name of dialog boxes that pop up. Sometimes they will give a nudge as to what the name of the function is that activates them

CGTalk Moderation
01-13-2006, 10:00 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.