View Single Post
# 4 29-05-2021, 10:29 AM
adev
Registered User
Join Date: May 2021
Posts: 1

A little script should be just the thing:

Code:
string $selectedObjs[] = `ls -sl`; //get selected objects
for ($obj in $selectedObjs){ //iterate on selected objects
	string $newMat = `shadingNode -asShader "lambert"`; //create a lambert
	string $rnMat = `rename $newMat ($obj + "_Lmb_Mat")`; //rename new material based on object [optional]
	string $newSG = `sets -renderable true -noSurfaceShader true -empty -name ($rnMat + "SG")`; //create a shading group
	connectAttr -f ($rnMat + ".outColor") ($newSG + ".surfaceShader"); //connect shading group to lambert
	sets -e -forceElement $newSG $obj; //connect material to object
}

Originally Posted by stwert View Post
such a lifesaver little script.. should be there in hypershade menu by default!
Thanks