Go to: Synopsis. Return value. Related. Flags. Python examples.
connectAttr(
sourceAttribute destinationAttribute
, [force=boolean], [lock=boolean], [nextAvailable=boolean], [referenceDest=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
connectAttr is undoable, queryable, and editable.
Connect the attributes of two dependency nodes and return the names of the two connected attributes. The connected attributes must be be of compatible types.(Refer to dependency node documentation.)string A phrase containing the names of the connected attributes.
In query mode, return type is based on queried flag.
| Long name (short name) | argument types | Properties | ||
|---|---|---|---|---|
lock(l)
|
boolean
|
|
||
|
||||
force(f)
|
boolean
|
|
||
|
||||
nextAvailable(na)
|
boolean
|
|
||
|
||||
referenceDest(rd)
|
string
|
|
||
|
||||
import maya.cmds as cmds cmds.createNode( 'transform', n='firstGuy' ) cmds.createNode( 'transform', n='secondGuy' ) # Connect the translation of two nodes together cmds.connectAttr( 'firstGuy.t', 'secondGuy.translate' ) # Connect the rotation of one node to the override colour # of a second node. cmds.connectAttr( 'firstGuy.rotate', 'secondGuy.overrideColor' )