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

Synopsis

copyAttr [-attribute string] [-containerParentChild] [-inConnections] [-keepSourceConnections] [-outConnections] [-renameTargetContainer] [-values]

copyAttr is undoable, queryable, and editable.

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.

Return value

none

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

Keywords

node, connection, container, copy

Related

container, listAttr, transferAttributes

Flags

attribute, containerParentChild, inConnections, keepSourceConnections, outConnections, renameTargetContainer, values
Long name (short name) Argument types Properties
-inConnections(-ic) create
Indicates that incoming connections should be transferred.
-outConnections(-oc) create
Indicates that outgoing connections should be transferred.
-values(-v) create
Indicates that values should be transferred.
-attribute(-at) string createmultiuse
The name of the attribute(s) for which connections and/or values will be transferred. If no attributes are specified, then all attributes will be transferred.
-keepSourceConnections(-ksc) create
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.
-renameTargetContainer(-rtc) create
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.
-containerParentChild(-cpc) create
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 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

// transfer input connections and values from locator1 to locator2
//
copyAttr -inConnections -values locator1 locator2;
// transfer only the translateX and translateY values
//
copyAttr -values -attribute tx -attribute translateY locator1 locator2;