PDA

View Full Version : Mel Scripting for Contour Shader/Mental Ray


feralkiwi
11-10-2009, 02:13 PM
Hey guys!

First post- so hopefully everything is formatted correctly. I'm trying to write a little mel script that creates a contour shader and automatically changes the render settings for the user so it's all set to go for contour rendering. The part where I'm having trouble is getting it to render the features- it creates the shader, changes the render setting to mental ray and changes the settings to enable contour, but it still won't render properly (just gives you blue screen).
this is the script so far:

global proc contourRender()
{
if (`window -ex contourWin`)
deleteUI contourWin;


select -cl ;
string $material = `shadingNode -asShader lambert -name myLambert`;
string $SG = `sets -renderable true -noSurfaceShader true -empty -name myLambertSG`;
connectAttr -f ($material + ".outColor") ($SG + ".surfaceShader");


setAttr "myLambertSG.miContourColor" -type double3 0.143583 0.172185 0.627;
setAttr "myLambertSG.miContourEnable" 1;
setAttr "myLambert.color" -type double3 0.91736 0.91736 0.91736 ;
setAttr "myLambert.color" -type double3 1 1 1 ;


//set render settings

setCurrentRenderer mentalRay;

setAttr "frontShape.renderable" 0;
setAttr "perspShape.renderable" 0;
setAttr "sideShape.renderable" 0;
setAttr "topShape.renderable" 0;
setAttr "cam1Shape.renderable" 1;


setAttr "mentalrayGlobals.renderMode" 1;


fillSelectedTabForCurrentRenderer;
setAttr "miDefaultFramebuffer.contourEnable" 1;
setAttr "miDefaultOptions.contourPriData" 1;
}





any thoughts? thanks in advance!
cheers!
~t

phix314
11-11-2009, 04:28 AM
No. Way. I was in class today doodling possible mel scripts that I could write in my free time and this was one of em! Haha crazy.

This is throwin me errors left and right. I'll try it when I get home.

CGTalk Moderation
11-11-2009, 04:28 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.