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
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
