Go to: Synopsis. Flags. Return value. Python examples.
surfaceShaderList([add=DAGobject], [remove=DAGobject])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
surfaceShaderList is undoable, queryable, and editable.
Add/Remove a relationship between an object and the current shading group.| Long name (short name) | [argument types] | Properties | ||
|---|---|---|---|---|
add(add)
|
DAGobject
|
|
||
|
||||
remove(rm)
|
DAGobject
|
|
||
|
||||
import maya.cmds as cmds # Create a NURBS plane. cmds.nurbsPlane( d=3, p=(0, 0, 0), lr=1, axis=(0, 0, 0), n='plane1' ) # Make it red. cmds.sets( name='redMaterialGroup', renderable=True, empty=True ) cmds.shadingNode( 'phong', name='redShader', asShader=True ) cmds.setAttr( 'redShader.color', 1, 0, 0, type='double3' ) cmds.surfaceShaderList( 'redShader', add='redMaterialGroup' ) cmds.sets( 'plane1', e=True, forceElement='redMaterialGroup' )