pymel.core.rendering.surfaceShaderList

surfaceShaderList(*args, **kwargs)

Add/Remove a relationship between an object and the current shading group. In query mode, return type is based on queried flag.

Flags:
Long name (short name) Argument Types Properties
add (add) PyNode ../../../_images/create.gif
 
add object(s) to shader group list.
remove (rm) PyNode ../../../_images/create.gif
 
remove object(s) to shader group list. Flag can have multiple arguments, passed either as a tuple or a list.

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

Previous topic

pymel.core.rendering.surfaceSampler

Next topic

pymel.core.rendering.textureWindow

Core

Core Modules

Other Modules

This Page