This question is specific to Autodesk Maya. Using Maya 2014, SP 2. (Downloading SP 3 now...)
When using Version 1 of Maya Python API, to traverse DAG graph this works:
import maya.OpenMaya as OM
dagIterator = OM.MItDag( OM.MItDag.kDepthFirst, OM.MFn.kInvalid )
dagNodeFn = OM.MFnDagNode()
# Traverse the scene.
while( not dagIterator.isDone() ):
... do stuff with current node on iterator ...
dagIterator.next()
But now I try Version 2
import maya.api.OpenMaya as OM
dagIterator = OM.MItDag( OM.MItDag.kDepthFirst, OM.MFn.kInvalid )
which results in error
# Error: line 1: AttributeError: file <maya console> line 1: 'module' object has no attribute 'MItDag' #
Indeed, the Version 2 doc shows no MItDag.
How traverse the scene's DAG graph, using Version 2 API?