ScriptSpot home

Forum topic · General Scripting

problem in making a material plug in

By Varinder S. · 2009-01-19

Description

hello all!

im new to scripting...
recently i was making a script for v-ray car paint

but on compiling ... the material dont appear on material slot... :(

heres... it

plugin material V_shader
name:"V-style shader"
classid:#(0x4a8b48c4, 0xe2b2078)
extends:standard replaceui:true
(
rollout harami "V-style shader main parameters"
(
group "Main parametes"
(
colorpicker car_col "paint color"
colorpicker ref_col "reflection amount"
)
)

parameters main rollout:harami
(
color type:#color default:[151,151,151] ui:car_col
color1 type:#color ui:ref_col
)

on create do
(
delegate = shellac()
delegate.shellacmtl1 = vraymtl()
delegate.shellacmtl1.name = "base"

delegate.shellacmtl1.texmap_diffuse = rgb_tint()
delegate.shellacmtl1.texmap_diffuse.red = [0,0,0]
delegate.shellacmtl1.texmap_diffuse.green = [0,0,0]
delegate.shellacmtl1.texmap_diffuse.blue = [0,0,0]
body_color = delegate.shellacmtl1.texmap_diffuse.map1 = output()
delegate.shellacmtl1.texmap_diffuse.map1.map1enabled = on

delegate.shellacmtl1.texmap_reflection = falloff()
middle_reflection = delegate.shellacmtl1.texmap_reflection.color1 = [0,0,0]
outer_reflection = delegate.shellacmtl1.texmap_reflection.color1 = [255,255,255]
delegate.shellacmtl1.texmap_reflection.type = 2

delegate.shellacmtl1.texmap_reflectionglossiness = falloff()
specular = delegate.shellacmtl1.texmap_reflectionglossiness.color1 = [255,255,255]
outer_reflection = delegate.shellacmtl1.texmap_reflectionglossiness.color2 = [0,0,0]

delegate.shellacmtl2 = vraymtl()

delegate.shellacmtl2.texmap_diffuse = rgb_tint()
delegate.shellacmtl2.texmap_diffuse.red = [151,151,151]
delegate.shellacmtl2.texmap_diffuse.green = [0,0,0]
delegate.shellacmtl2.texmap_diffuse.blue = [0,0,0]
--delegate.shellacmtl2.texmap_diffuse.map1.map1enabled = on
paint_color = delegate.shellacmtl2.texmap_diffuse.map1 = output()

slight_reflection = delegate.shellacmtl2.reflection = [255,255,255]

delegate.shellacmtl2.reflection_fresnel = on

delegate.shellaccolorblend = 100
)

)

and on selecting the material... theres no change in the material slot :(

see the pic
http://www.imagebam.com/image/0d1ab424080168

thankyou in advance.

Comments (5)
Varinder S.

emm... what is the correct syntax for calling a material other than standard material via material plugin...

sorry for my bad english.

Varinder S.

emmm? ...
is my script allright?

Colin Senner

Dumb response but it doesn't appear you have that material applied to anything in the scene...

Varinder S.

nope. its not visible in render too.

the script runs fine on standard material...

i mean... if we use the following code...

on create do
(
delegate = standard()
)
instead of "delegate = vraymtl()"

everything works fine ....

--- this script was an inspiration frm following tutorial.
http://www.cgcookie.com/articles/2008/11/22/custom-scripted-shader-in-3d…

dimwalker

Is it visible on the object when you render?