Add/Remove a relationship between an object and the current shading group. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
add (add) | PyNode | ||
|
|||
remove (rm) | PyNode | ||
|
Derived from mel command maya.cmds.surfaceShaderList
Example:
import pymel.core as pm
# Create a NURBS plane.
pm.nurbsPlane( d=3, p=(0, 0, 0), lr=1, axis=(0, 0, 0), n='plane1' )
# Result: [nt.Transform(u'plane1'), nt.MakeNurbPlane(u'makeNurbPlane1')] #
# Make it red.
pm.sets( name='redMaterialGroup', renderable=True, empty=True )
# Result: nt.ShadingEngine(u'redMaterialGroup') #
pm.shadingNode( 'phong', name='redShader', asShader=True )
# Result: nt.Phong(u'redShader') #
pm.setAttr( 'redShader.color', 1, 0, 0, type='double3' )
pm.surfaceShaderList( 'redShader', add='redMaterialGroup' )
# Result: u'' #
pm.sets( 'plane1', e=True, forceElement='redMaterialGroup' )