Given two nodes, transfer the connections and/or the values from the first node to the second for all attributes whose names and data types match. When values are transferred, they are transferred directly. They are not mapped or modified in any way. The transferAttributes command can be used to transfer and remap some mesh attributes. The attributes flag can be used to specify a list of attributes to be processed. If the attributes flag is unused, all attributes will be processed. For dynamic attributes, the values and/or connections will only be transferred if the attributes names on both nodes match. This command does not support geometry shape nodes such as meshes, subds and nurbs. This command does not support transfer of multi-attribute values such as weight arrays.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
attribute (at) | unicode | ||
|
|||
containerParentChild (cpc) | bool | ||
For use when copying from one container to another only. This option indicates that the published parent and/or child relationships on the original container should be transferred to the target container if the published names match. Flag can have multiple arguments, passed either as a tuple or a list. |
|||
inConnections (ic) | bool | ||
|
|||
keepSourceConnections (ksc) | bool | ||
For use with the outConnections flag only. Indicates that the connections should be maintained on the first node, in addition to making them to the second node. If outConnections is used and keepSourceConnections is not used, the out connections on the source node will be broken and made to the target node. |
|||
outConnections (oc) | bool | ||
|
|||
renameTargetContainer (rtc) | bool | ||
For use when copying from one container to another only. This option will rename the target container to the name of the original container, and rename the original container to its old name + Orig. You would want to use this option if your original container was referenced and edited, and you want those edits from the main scene to now apply to the new container. |
|||
values (v) | bool | ||
|
Derived from mel command maya.cmds.copyAttr
Example:
import pymel.core as pm
# transfer input connections and values from locator1 to locator2
#
pm.copyAttr('locator1','locator2',inConnections=True,values=True)
# transfer only the translateX and translateY values
#
pm.copyAttr('locator1','locator2',values=True,attribute=['tx','translateY'])