Hi I want to create a button for blinn material using MEL. As you can see in the image. Just I want to add only blinn material rest off them I will create it by myself.
Thanks
oglu said: ...
oglu said: i would use the shift+t shurtcut...
Obscura said: oglu said: ...
shadingNode -asUtility shadingEngine<br>connectAttr (blinn.outColor) (blinnSG.surfaceShader);<br><div>sets -e -forceElement blinnSG;</div>
oglu said: im hunted now.
sprunghunt said: Just that command will create a material without a shading group. You want to create a new shading group and add the material to it. shadingNode -asUtility shadingEngine<br>connectAttr (blinn.outColor) (blinnSG.surfaceShader);<br><div>sets -e -forceElement blinnSG;</div>That's the general idea.You'll need to make the above code work properly by using variables.
jayantbhatt007 said: sprunghunt said: Just that command will create a material without a shading group. You want to create a new shading group and add the material to it. shadingNode -asUtility shadingEngine<br>connectAttr (blinn.outColor) (blinnSG.surfaceShader);<br><div>sets -e -forceElement blinnSG;</div>That's the general idea.You'll need to make the above code work properly by using variables. // Error: Line 2.52: Invalid use of Maya object "blinnSG.surfaceShader".
connectAttr ($myBlinn + ".outColor") ($myBlinnSG + ".surfaceShader");
sprunghunt said: jayantbhatt007 said: sprunghunt said: Just that command will create a material without a shading group. You want to create a new shading group and add the material to it. shadingNode -asUtility shadingEngine<br>connectAttr (blinn.outColor) (blinnSG.surfaceShader);<br><div>sets -e -forceElement blinnSG;</div>That's the general idea.You'll need to make the above code work properly by using variables. // Error: Line 2.52: Invalid use of Maya object "blinnSG.surfaceShader". IYes I know it's not working code like that. Eg that line should probably look more like:connectAttr ($myBlinn + ".outColor") ($myBlinnSG + ".surfaceShader");but if I told you exactly how to do it you'd never learn anythinHHahaha I really love your trick... thanks for your help. I'm super noob.
Replies
You'll need to make the above code work properly by using variables.
Yes I know it's not working code like that. Eg that line should probably look more like:
but if I told you exactly how to do it you'd never learn anything ;-)