Hi, Suppose I made a blue blinn color material through MEL. There is anyway when I again click on the button it's assigning the random color or changing the color of the material from blue to Pink, Red kind off?
<p>window;<br>frameLayout -label "jayant";<br>flowLayout -columnSpacing 7 -w 20 -h 50;<br>symbolButton -w 40 -h 40 -image "blinn.svg" -c "blue()" ;<br>showWindow;</p><p>//It will create blue mateial and assign it to your seleted objectttrFilter1</p><p>proc blue()</p><p>{<br>string $sel[] = `ls -sl`;<br>$blinn = `shadingNode -asShader blinn`;<br>setAttr ($blinn+".color") -type double3 0.15 0.35 1.0 ;<br>setAttr ($blinn+".specularRollOff") 0.3;<br>$blinnSG = `sets -renderable true -noSurfaceShader true -empty -name blinnSG`;<br>connectAttr -force ($blinn+".outColor") ($blinnSG+".surfaceShader");<br>select -r $sel;<br>hyperShade -assign $blinn;<br>}</p>
Replies