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.
returns an empty list when the result is None
set, or frozenset, making it’s behavior consistent with when None is passed, or no args and nothing is selected (would formerly raise a TypeError)
When ‘connections’ flag is True, the attribute pairs are returned in a 2D-array:
[['checker1.outColor', 'lambert1.color'], ['checker1.color1', 'fractal1.outColor']]
the paired list of plugs is returned in (source,destination) order instead of (thisnode,othernode) order. this puts the pairs in the order that disconnectAttr and connectAttr expect.
added ability to pass a list of types
rtype: | PyNode list |
---|
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
connections (c) | bool | ||
|
|||
destination (d) | bool | ||
|
|||
exactType (et) | bool | ||
|
|||
plugs (p) | bool | ||
|
|||
shapes (sh) | bool | ||
|
|||
skipConversionNodes (scn) | bool | ||
If true, skip over unit conversion nodes and return the node connected to the conversion node on the other side. Default false.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
source (s) | bool | ||
|
|||
type (t) | unicode | ||
|
Derived from mel command maya.cmds.listConnections
Example:
import pymel.core as pm
pm.sphere( ch=True, n='BALL' )
# Result: [nt.Transform(u'BALL'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
pm.setKeyframe()
# Result: 10 #
# List all connections to BALL
list = pm.listConnections('BALL')
# List only incoming connections from BALL.tx
pm.listConnections( 'BALL.tx', d=False, s=True )
# Result: [nt.AnimCurveTL(u'BALL_translateX')] #
# List connections from BALL to nodes of type 'transform'
pm.listConnections( t='transform' )
# Result: [] #
# List connections on BALL, ignoring unit conversion nodes
pm.listConnections( 'BALL', scn=True )
# Result: [nt.AnimCurveTU(u'BALL_visibility'), nt.AnimCurveTL(u'BALL_translateX'), nt.AnimCurveTL(u'BALL_translateY'), nt.AnimCurveTL(u'BALL_translateZ'), nt.AnimCurveTA(u'BALL_rotateX'), nt.AnimCurveTA(u'BALL_rotateY'), nt.AnimCurveTA(u'BALL_rotateZ'), nt.AnimCurveTU(u'BALL_scaleX'), nt.AnimCurveTU(u'BALL_scaleY'), nt.AnimCurveTU(u'BALL_scaleZ')] #