Your Ad Here

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

Synopsis

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.

Flags

add, remove
Long name (short name) [argument types] Properties
add(add) DAGobject create
add object(s) to shader group list.
remove(rm) DAGobject 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.

Return value

None

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

  

Return to Autodesk Index


Your Ad Here