如何使用Maya Python API查找所有上游DG节点? [英] How to find all upstream DG nodes with maya python api?
问题描述
我可以使用
hypershade -listUpstreamNodes
以获取它们,但是此命令在maya批处理模式下不可用. 我想我应该使用 MItDependencyGraph 吗?有人可以给我一个简短的例子吗?谢谢!
to get them, but this command is not available in maya batch mode. i guess i should use MItDependencyGraph ? can someone give me a short example ? thanks !
ps:我想在动画控件上找到所有动画曲线(它们可能在动画图层中).我可以使用的另一个地方是找到与给定网格关联的所有着色节点.我不想多次使用listConnections或connectionInfo并编写一个长函数来做到这一点.
ps: i want to find all anim curves on anim controls( they may be in anim layers). another place i can use this is find all shading nodes associated with a given mesh. i don't want to use listConnections or connectionInfo multiple times and write a long function to do it.
推荐答案
在香草玛雅蟒蛇中
import maya.cmds as cmds
cmds.ls(*cmds.listHistory (mynode), type = 'animCurve' )
应该做同样的事情.在这两种情况下,您还都必须寻找将在结果中显示的诸如驱动键之类的东西.
Should do the same thing. In both cases you'll also have to look for things like driven keys that will show up in the results.
这篇关于如何使用Maya Python API查找所有上游DG节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!