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

Synopsis

listConnections([connections=boolean], [destination=boolean], [exactType=boolean], [plugs=boolean], [shapes=boolean], [skipConversionNodes=boolean], [source=boolean], [type=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

listConnections is NOT undoable, NOT queryable, and NOT editable.

This command returns a list of all attributes/objects of a specified type that are connected to the given object(s). If no objects are specified then the command lists the connections on selected nodes.

Return value

string[]List of connection plugs/nodes

Keywords

connection, dg, dependency, graph, plug, connect

Related

connectAttr, connectionInfo, disconnectAttr, getAttr, isConnected, listAttr, setAttr

Flags

connections, destination, exactType, plugs, shapes, skipConversionNodes, source, type
Long name (short name) Argument types Properties
connections(c) boolean create
If true, return both attributes involved in the connection. The one on the specified object is given first. Default false.
destination(d) boolean create
Give the attributes/objects that are on the "destination" side of connection to the given object. Default true.
exactType(et) boolean create
When set to true, -t/type only considers node of this exact type. Otherwise, derived types are also taken into account.
plugs(p) boolean create
If true, return the connected attribute names; if false, return the connected object names only. Default false;
shapes(sh) boolean create
Actually return the shape name instead of the transform when the shape is "selected". Default false.
skipConversionNodes(scn) boolean create
If true, skip over unit conversion nodes and return the node connected to the conversion node on the other side. Default false.
source(s) boolean create
Give the attributes/objects that are on the "source" side of connection to the given object. Default true.
type(t) string create
If specified, only take objects of a specified type.

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.sphere( ch=True, n='BALL' )
cmds.setKeyframe()
# List all connections to BALL
list = cmds.listConnections('BALL')

# List only incoming connections from BALL.tx
cmds.listConnections( 'BALL.tx', d=False, s=True )

# List connections from BALL to nodes of type 'transform'
cmds.listConnections( t='transform' )

# List connections on BALL, ignoring unit conversion nodes
cmds.listConnections( 'BALL', scn=True )