Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
transferShadingSets([sampleSpace=uint], [searchMethod=uint])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
transferShadingSets is undoable, queryable, and editable.
Command to transfer shading set assignments between meshes. The last mesh in the list receives the shading assignments from the other meshes.None
In query mode, return type is based on queried flag.
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
sampleSpace(spa) |
uint |
|||
|
||||
searchMethod(sm) |
uint |
|||
|
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. |
import maya.cmds as cmds # make a low res sphere with shaders low = cmds.polySphere( sx=6, sy=6 )[0] lowShape = cmds.listRelatives( low, fullPath=True, shapes=True )[0] redSG = cmds.sets( r=True, em=True ) redMat = cmds.shadingNode( "lambert", asShader=True ) cmds.setAttr( redMat + ".color", 1, 0, 0, type='double3' ) cmds.connectAttr( redMat + ".outColor", redSG + ".surfaceShader", f=True ) greenSG = cmds.sets( r=True, em=True ) greenMat = cmds.shadingNode( "lambert", asShader=True ) cmds.setAttr( greenMat + ".color", 0, 1, 0, type='double3' ) cmds.connectAttr( greenMat + ".outColor", greenSG + ".surfaceShader", f=True ) cmds.sets( lowShape + '.f[0:17]', e=True, fe=redSG ) cmds.sets( lowShape + '.f[18:36]', e=True, fe=greenSG ) # make a high res sphere high = cmds.polySphere( sx=20, sy=20 )[0] highShape = cmds.listRelatives( high, fullPath=True, shapes=True )[0] cmds.xform( high, ws=True, t=(2, 0, 0) ) # transfer the shading sets cmds.select( low, r=True ) cmds.select( high, tgl=True ) cmds.transferShadingSets( sampleSpace=1 )