PDA

View Full Version : Scripted texturemap plugins and Mental Ray.


ija151
04-15-2007, 04:57 AM
Hello, while I am not new to CGTalk, this will be my first thread. I am very familiar to 3dsmax but I am very new to maxscript, and my knowledge of it barely includes scripting maps an materials. My problem is that I cannot get any of my texture map scripts to render with mental ray. I have tried extending maps that come from max, and maps that are native to mental ray, I have also tried extending plugin shaders for mental ray. What is weird is that when I choose my script in the map browser on say a standard or mental ray material it doesn't seen to have anything applied to it. But when I have show end result turned off I can see my script working in the sample slot. Oh and when I run my script there is no errors at all. However mental ray will render my scripted material plugins. Also, when I extend maps that are meant for mental ray, its little icon to the side, shows up in yellow just like the other mental ray shaders, this is also true for the mental ray materials. I would really appreciate some help on this one, because I would rather be able to make my own shaders instead of materials, and I am a big fan of mental ray.


Here is an example of a script entending a mental ray shader from drUtilSuite v1.01 downloaded from maxplugins.de-


global drNullColor_v2

""plugin textureMap IA_Nullcolor
name:"IA_Nullcolor"
classID:#(0x3e8b33bc, 0x525b2216)
extends:drNullColor_v2
replaceUI:True
version:2

(


parameters main rollout:NCR
(
nc1 Type:#color ui:nc1
on nc1 set val do delegate.color = val
MB01 type:#texturemap ui:MB01
on MB01 set val do
(
delegate.color_shader=val
)
)

rollout NCR "Null Color" width:328 height:80
(
groupBox Null_Color "Null Color" pos:[4,5] width:300 height:58
colorPicker nc1"" pos:[100,30] width:80 height:25 enabled:true color:(color 255 0 0) title:"Choose a color"
mapButton MB01 "<<Map 01>>" pos:[190,30] width:107 height:25
)--end rollout
)--end plugin


Now here is an example extending a mental ray material with drNullColor_v2 applied to the surface slot, this cript does render in mental ray.-
global
M01
M02

""plugin Material IA_Nullcolor
name:"IA_Nullcolor"
classID:#(0x4154183b, 0x259fff18)
extends:mental_ray
replaceUI:True
version:2

(
parameters main rollout:NC
(
M01 type:#texturemap
M02 type:#texturemap
)
rollout NC "NullColor_v2" width:328 height:80
(
label lab1 "No Paremeters to Edit"
)--end rollout
on create do
(
M01=drNullColor_v2()
M01.color=(color 255 0 255 255)
delegate.Surface_Shader=M01
delegate.Surface_Shader.color_shader=M02
)--end init
)--end plugin


My main reason for writing scripts is so I can create an easy controls for complicated shader networks, so that other people can use them. Please can someone help me with this? BTW, I use max 9 sp1.

CGTalk Moderation
04-15-2007, 04:57 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.