PDA

View Full Version : Scripted materials: shellac


egz
05-26-2003, 05:35 PM
I'm currently working on a few scripted material wrappers, but have run into a slight problem. I'm new to maxscript so I might be overlooking something simple, but I have not been able to create a scripted Shellac material, and control the submaterials.

Is there anyone out there that have done/know how to do this and could point me in the right direction? Any help would be appreciated.

orpheo
05-26-2003, 08:24 PM
Hi
The syntax for shell materials is as follow:

b=box()
b.material= shell_material()
b.material.originalMaterial = standardmaterial diffusecolor:(color 0 255 0)
b.material.bakedMaterial = standardmaterial diffusecolor:(color 0 0 255)

you may look at bakersfield (on scriptspot.com), its a render to texture remake with shellac fonctions. It may help you

egz
05-26-2003, 09:15 PM
thanks, I'll take a look at that.

not sure if I can use the shell material for what I want to do, but maybe bakerfield can tach me something.

orpheo
05-26-2003, 09:23 PM
sorry, little confusion from myself...

b=box()
b.material= shellac()
b.material.shellacMtl1 = standardmaterial diffusecolor:(color 0 255 0)
b.material.shellacMtl2 = standardmaterial diffusecolor:(color 0 0 255)

should be better for what you want to do

egz
05-26-2003, 10:37 PM
well, I got a little further. Thanks so far!!

now what I am having trouble with is using something other than a standard material as the shellac materials. How would I do that?

this is what I have so far:

-- start script --

plugin material egzShellac
name:"egzShellac"
classID:#(0x3bf38d95, 0x6a9fae5a)
extends:shellac replaceUI:true version:0.6
(
parameters main rollout:params
(
col type:#color default: (color 255 0 0) ui:col
on col set val do delegate.shellacMtl1.diffuse = val
)

rollout params "Shellac Parameters"
(
colorpicker col "base color: " align:#center
)

on create do
(
delegate.shellacColorBlend = 100

delegate.shellacMtl1.diffuse = (color 255 0 0)
delegate.shellacMtl1.specular = white
delegate.shellacMtl1.specularLevel = 10
delegate.shellacMtl1.glossiness = 10

delegate.shellacMtl2.diffuse = black
delegate.shellacMtl2.specular = white
delegate.shellacMtl2.specularLevel = 300
delegate.shellacMtl2.glossiness = 70
)
)

-- end script --

orpheo
05-27-2003, 12:03 AM
I think that an easy way to change the material type would be to add a "materialbutton" command allowing you to browse for a new material

egz
05-27-2003, 12:19 AM
What I want to do is to put a VRay material in each of the shellac slots, hardcode most of the parameters, and create a UI for the few parameters that should be possible to change.

So I don't want the user to be able to switch material type.
If I can only figure out how to not use the standard material in the above situation I'd be all set.

I've only been scripting for a few days, so I'm sorry if I'm asking for obvious stuff here. I appreciate your help. :)

CGTalk Moderation
01-15-2006, 07: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.