Go to: Synopsis. Return value. Python examples.
setDefaultShadingGroup(
string
)
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
setDefaultShadingGroup is undoable, queryable, and NOT editable.
The setDefaultShadingGroup command is used to change which shading group is considered the current default shading group. Subsequently created objects will be assigned to the new default group.None
In query mode, return type is based on queried flag.
import maya.cmds as cmds # Create a new blue shader blinn = cmds.shadingNode( 'blinn', asShader=True ) cmds.setAttr( blinn+".color", 0.15, 0.35, 1.0, type='double3' ) blinnSG = cmds.sets( renderable=True, noSurfaceShader=True, empty=True, name='blinnSG' ); cmds.connectAttr( blinn+".outColor", blinnSG+".surfaceShader", force=True) # Make it the default cmds.setDefaultShadingGroup( blinnSG )