pymel.core.modeling.transferAttributes

transferAttributes(*args, **kwargs)

Samples the attributes of a source surface (first argument) and transfers them onto a target surface (second argument).

Flags:
Long name (short name) Argument Types Properties
after (af) bool  
   
afterReference (ar) bool  
   
before (bf) bool  
   
colorBorders (clb) int ../../../_images/create.gif ../../../_images/edit.gif
 

Controls whether color borders are preserved when transferring color data. If this is non-zero, any color borders will be mapped onto the nearest edge on the target geometry. 0 means any color borders will be smoothly blended onto the vertices of the target geometry.

deformerTools (dt) bool  
   
exclusive (ex) unicode  
   
flipUVs (fuv) int ../../../_images/create.gif ../../../_images/edit.gif
 

Controls how sampled UV data is flipped before being transferred to the target. 0 means no flipping; 1 means UV data is flipped in the U direction; 2 means UV data is flipped in the V direction; and 3 means it is flipped in both directions. In conjunction with mirroring, this allows the creation of symmetric UV mappings (e.g. the left hand side of the character on one side of the UV map, the right hand side on the other).

frontOfChain (foc) bool  
   
geometry (g) unicode  
   
geometryIndices (gi) bool  
   
ignoreSelected (ignoreSelected) bool  
   
matchChoice (mch) int ../../../_images/create.gif ../../../_images/edit.gif
 

When using topological component matching, selects between possible matches. If the meshes involved in the transfer operation have symmetries in their topologies, there may be more than one possible topological match. Maya scores the possible matches (by comparing the shapes of the meshes) and assigns them an index, starting at zero. Match zero, the default, is considered the best, but in the event that Maya chooses the wrong one, changing this value will allow the user to explore the other matches.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

name (n) unicode  
   
parallel (par) bool  
   
prune (pr) bool  
   
remove (rm) bool  
   
sampleSpace (spa) int ../../../_images/create.gif ../../../_images/edit.gif
 

Selects which space the attribute transfer is performed in. 0 is world space, 1 is model space, 4 is component-based, 5 is topology-based. The default is world space.

searchMethod (sm) int ../../../_images/create.gif ../../../_images/edit.gif
 
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.
searchScaleX (ssx) float ../../../_images/create.gif ../../../_images/edit.gif
 

Specifies an optional scale that should be applied to the x-axis of the target model before transferring data. A value of 1.0 (the default) means no scaling; a value of -1.0 would indicate mirroring along the x-axis.

searchScaleY (ssy) float ../../../_images/create.gif ../../../_images/edit.gif
 

Specifies an optional scale that should be applied to the y-axis of the target model before transferring data. A value of 1.0 (the default) means no scaling; a value of -1.0 would indicate mirroring along the y-axis.

searchScaleZ (ssz) float ../../../_images/create.gif ../../../_images/edit.gif
 

Specifies an optional scale that should be applied to the z-axis of the target model before transferring data. A value of 1.0 (the default) means no scaling; a value of -1.0 would indicate mirroring along the z-axis.

sourceColorSet (scs) unicode ../../../_images/create.gif
 

Specifies the name of a single color set on the source surface(s) that should be transferred to the target. This value is only used when the operation is configured to transfer a single color set (see the transferColors flag).

sourceUvSet (suv) unicode ../../../_images/create.gif
 

Specifies the name of a single UV set on the source surface(s) that should be transferred to the target. This value is only used when the operation is configured to transfer a single UV set (see the transferUVs flag).

sourceUvSpace (sus) unicode ../../../_images/create.gif
 

Specifies the name of the UV set on the source surface(s) that should be used as the transfer space. This value is only used when the operation is configured to transfer attributes in UV space.

split (sp) bool  
   
targetColorSet (tcs) unicode ../../../_images/create.gif
 

Specifies the name of a single color set on the target surface that should be receive the sampled color data. This value is only used when the operation is configured to transfer a single color set (see the transferColors flag).

targetUvSet (tuv) unicode ../../../_images/create.gif
 

Specifies the name of a single UV set on the target surface that should be receive the sampled UV data. This value is only used when the operation is configured to transfer a single UV set (see the transferUVs flag).

targetUvSpace (tus) unicode ../../../_images/create.gif
 

Specifies the name of the UV set on the target surface( that should be used as the transfer space. This value is only used when the operation is configured to transfer attributes in UV space.

transferColors (col) int ../../../_images/create.gif ../../../_images/edit.gif
 

Controls color set transfer. 0 means no color sets are transferred, 1 means that a single color set (specified by sourceColorSet and targetColorSet) is transferred, and 2 means that all color sets are transferred.

transferNormals (nml) int ../../../_images/create.gif ../../../_images/edit.gif
 
A non-zero value indicates vertex normals should be sampled and written into user normals on the target surface.
transferPositions (pos) int ../../../_images/create.gif ../../../_images/edit.gif
 
A non-zero value indicates vertex position should be sampled, causing the target surface to “wrap” to the source surface(s).
transferUVs (uvs) int ../../../_images/create.gif ../../../_images/edit.gif
 

Controls UV set transfer. 0 means no UV sets are transferred, 1 means that a single UV set (specified by sourceUVSet and targetUVSet) is transferred, and 2 means that all UV sets are transferred.

Derived from mel command maya.cmds.transferAttributes

Example:

import pymel.core as pm

import maya.cmds as cmds

# Transfer all UV and color sets from pCube1 onto pSphere1
pm.transferAttributes( 'pCube1', 'pSphere1', transferUVs=2, transferColors=2 )

Previous topic

pymel.core.modeling.torus

Next topic

pymel.core.modeling.transferShadingSets

Core

Core Modules

Other Modules

This Page