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

Synopsis

transferShadingSets [-sampleSpace uint] [-searchMethod uint]

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 be used more than once in a command.

MEL examples

// make a low res sphere with shaders
string $low[] = `polySphere -sx 6 -sy 6`;
string $lowShape[] = `listRelatives -fullPath -shapes $low[0]`;
string $redSG = `sets -r 1 -em`;
string $redMat = `shadingNode -asShader "lambert"`;
setAttr ($redMat + ".color") -type "double3" 1 0 0;
connectAttr -f ($redMat + ".outColor") ($redSG + ".surfaceShader");
string $greenSG = `sets -r 1 -em`;
string $greenMat = `shadingNode -asShader "lambert"`;
setAttr ($greenMat + ".color") -type "double3" 0 1 0;
connectAttr -f ($greenMat + ".outColor") ($greenSG + ".surfaceShader");
sets -e -fe $redSG ( $lowShape[0] + ".f[0:17]" );
sets -e -fe $greenSG ( $lowShape[0] + ".f[18:36]" );
// make a high res sphere
string $high[] = `polySphere -sx 20 -sy 20`;
string $highShape[] = `listRelatives -fullPath -shapes $high[0]`;
xform -ws -t 2 0 0 $high[0];
// transfer the shading sets
select -r $low[0];
select -tgl $high[0];
transferShadingSets -sampleSpace 1;