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

Synopsis

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.

Return value

None

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

Keywords

shading, sets

Related

transferAttributes

Flags

sampleSpace, searchMethod
Long name (short name) Argument types Properties
sampleSpace(spa) uint createqueryedit
Selects which space the attribute transfer is performed in. 0 is world space, 1 is model space. The default is world space.
searchMethod(sm) uint createqueryedit
Specifies which search method to use when correlating points. 0 is closest along normal, 3 is closest to point. The default is closest to point.

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

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