hi, I have created this little window so I can easily assign material to it. It's creating a material but not assigning material to the object.
window;
frameLayout -label "jayant";
// add the other controls
flowLayout -columnSpacing 7 -w 50 -h 50;
// create six symbol buttons with related mel command
symbolButton -w 40 -h 40 -image "blinn.svg" -command "shadingNode -asShader blinn";
showWindow;
Replies
proc createMat(){ string $sel[] = `ls -sl`; string $myBlinn = `shadingNode -asShader blinn`; select -r $sel; hyperShade -assign $myBlinn; } window; frameLayout -label "jayant"; flowLayout -columnSpacing 7 -w 50 -h 50; symbolButton -w 40 -h 40 -image "blinn.svg" -c "createMat()" ; showWindow;sir suppose I'm creating a button for Lambert and changing the command ( you've provided) it is automatically changing the command of Blinn material also. see my whole script the last one.
at last after running the command both materials are working as a Lambert.
PLEASE DONT MIND I'M SUPER NOOB.