PDA

View Full Version : Mental Ray material access


LoneRobot
03-07-2006, 05:44 PM
woo hoo been a while since i posted so any help on this would be greatly appreciated.

Im trying to have maxscript setup some mental ray materials, which i'd asumed wouldnt be too much different to standard max ones. I can seem to access the shaders on things like dirtmap, ambient occ base or lume tools.

for example -

mrmat = mental_ray ()
mrmat.name = "mr access test"
mrocc = Dirtmap ()
mrocc.name = "test dirtmap"

mrmat.surface = mrocc

--- dirtmap parameters ----

mrmat.surface.probeenvironment = off
mrmat.surface.rayspread = 120
mrmat.surface.samples = 64
mrmat.surface.BaseColor = color 0 0 0 255

-----------------------------------
---dirtmap sub-shader access ????????

mrmat.surface.BaseColor.shader = Material_to_Shader ()

meditMaterials[1] = mrmat


the things like "samples" and "base color" i can set fine using this method. Ive done a showproperties on the variable mrmat.surface and have come up with a whole host of others like -

.BaseColor.connected ((null)) : boolean
.BaseColor.shader ((null)) : texturemap
.BaseColor.paramName ((null)) : string

i thought -

mrmat.surface.BaseColor.shader = Material_to_Shader ()

would work but it doesnt. nor does things like

mrmat.surface.BaseColor.connected = true


the macro recorder throws up -

meditMaterials[1][#Surface].BaseColor.shader = Material_to_Shader ()

but the same code does nothing when run in a script window.

help!!! :eek: how can i specify a dirtmap.basecolor shader through maxscript?

LoneRobot
03-07-2006, 07:41 PM
uuuuuuuuugggghhhh man i missed out the ' ' marks. that is lame.

mrmat.surface.'BaseColor.shader' = Material_to_Shader ()

all tickety boo now.

CGTalk Moderation
03-07-2006, 07:41 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.