pymel.core.general.connectAttr

connectAttr(source, destination, **kwargs)

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. First argument is the source attribute, second one is the destination. Refer to dependency node documentation.

Maya Bug Fix:
  • even with the ‘force’ flag enabled, the command would raise an error if the connection already existed.
Flags:
  • force : f (bool) [create]

    Forces the connection. If the destination is already connected, the old connection is broken and the new one made.

  • lock : l (bool) [create]

    If the argument is true, the destination attribute is locked after making the connection. If the argument is false, the connection is unlocked before making the connection.

  • nextAvailable : na (bool) [create]

    If the destination multi-attribute has set the indexMatters to be false with this flag specified, a connection is made to the next available index. No index need be specified.

  • referenceDest : rd (unicode) [create]

    This flag is used for file io only. The flag indicates that the connection replaces a connection made in a referenced file, and the flag argument indicates the original destination from the referenced file. This flag is used so that if the reference file is modified, maya can still attempt to make the appropriate connections in the main scene to the referenced object. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.connectAttr

Previous topic

pymel.core.general.condition

Next topic

pymel.core.general.connectionInfo

Core

Core Modules

Other Modules

This Page