MItDependencyGraph doesn't give all the nodes

170 views
Skip to first unread message

dav...@image-engine.com

unread,
Mar 22, 2019, 3:23:03 PM3/22/19
to Python Programming for Autodesk Maya
Hi Guys,

I run into an issue. The MItDependencyGraph doesn't give all the nodes.
I want the same result as using cmds.listHistory().
I tried many different settings, and flags but it didn't work.
Any idea?


import maya.api.OpenMaya as om2

cmds.polySphere()
cmds.polySphere()
cmds.blendShape('pSphere2', 'pSphere1')

sel = om2.MSelectionList()
sel.add('pSphereShape1')
mobj = sel.getDependNode(0)
it = om2.MItDependencyGraph(mobj, om2.MFn.kInvalid)
it.traversingOverWorldSpaceDependents = True
it.pruningOnFilter = False
fnNode = om2.MFnDependencyNode()

while not it.isDone():
currItem = it.currentNode()
fnNode.setObject(currItem)
print fnNode.name()
it.next()

# Result:
# pSphereShape1
# initialShadingGroup
# blendShape1Set
# tweakSet1
# Where is the blendshape, origin, etc node??

dav...@image-engine.com

unread,
Mar 22, 2019, 7:18:38 PM3/22/19
to Python Programming for Autodesk Maya
Ok I swapped upstream and downstream....it looks problem solved :D
Reply all
Reply to author
Forward
0 new messages