pymel.core.system.findType

findType(*args, **kwargs)

The findTypecommand is used to search through a dependency subgraph on a certain node to find all nodes of the given type. The search can go either upstream (input connections) or downstream (output connections). The plug/attribute dependencies are not taken into account when searching for matching nodes, only the connections.

Flags:

Long Name / Short Name Argument Types Properties
deep / d bool ../../../_images/create.gif
  Find all nodes of the given type instead of just the first.
exact / e bool ../../../_images/create.gif
  Match node types exactly instead of any in a node hierarchy.
forward / f bool ../../../_images/create.gif
  Look forwards (downstream) through the graph rather than backwards (upstream) for matching nodes.
type / t unicode ../../../_images/create.gif
  Type of node to look for (e.g. transform). This flag is mandatory. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.findType

Example:

import pymel.core as pm

pm.createNode( 'transform', name='silly' )
# Result: nt.Transform(u'silly') #
pm.createNode( 'transform', name='putty' )
# Result: nt.Transform(u'putty') #
pm.connectAttr( 'silly.tx', 'putty.tx' )
# Find transform nodes connected to node "silly"
#
pm.findType( type='transform', 'silly' )
silly
pm.select( 'silly' )
#
# Same again from selection list
#
pm.findType( type='transform' )
silly
pm.setKeyframe( t=10 )
#
# Find all time nodes
#
pm.findType( type='time', deep=True, e=True )
u'time1'
#
# Find all anim curve nodes
#
pm.findType( type="animCurve", deep=True )
u'silly_visibility', u'silly_translateX', u'silly_translateY', u'silly_translateZ', u'silly_rotateX', u'silly_rotateY', u'silly_rotateZ', u'silly_scaleX', u'silly_scaleY', u'silly_scaleZ'