//This is a script for making a samplerInfo-node and //a ramp-node, connect them and set the color in the //ramp to go from black to white. //To use it you must first write "source makeFresnel.mel" //and then you can execute it by typing "makeFresnel" //in the scripteditor or command line. //Written by Thomas Smestad 2006.03.02 with help from //Henning Birkeland. global proc makeFresnel() { string $nodeName = `createNode ramp`; //make ramp-node string $nodeName2 = `createNode samplerInfo`; //make samplerInfo-node connectNodes($nodeName, $nodeName2); //runs connectNode-prosedure rampColor($nodeName); //runs rampColor-prosedure } global proc connectNodes (string $a, string $b) { connectAttr -f ($b + ".facingRatio") ($a + ".vCoord"); //connects the nodes } global proc rampColor (string $a) { removeMultiInstance -break true ($a + ".colorEntryList[1]"); //removes one of the colors in the ramp setAttr ($a + ".colorEntryList[2].color") -type double3 1 1 1 ; //set color white setAttr ($a + ".colorEntryList[0].color") -type double3 0 0 0 ; //set color black setAttr ($a + ".colorEntryList[2].position") 1; //move color }