Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

surfaceShaderList([add=name], [remove=name])

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.

Return value

None

In query mode, return type is based on queried flag.

Flags

add, remove
Long name (short name) Argument types Properties
add(add) name create
add object(s) to shader group list.
remove(rm) name create
remove object(s) to shader group list.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

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' )