我正在尝试从python maya api中的目标网格中找到blendshape变形器。我很确定我必须遍历依赖关系图来获得blendshape。在
这就是我要做的:
import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim
#Name of our targetmesh.
targetMesh = "pSphere1"
#Add selection.
mSel = OpenMaya.MSelectionList()
mSel.add(targetMesh, True)
#Get MObj
mObj = OpenMaya.MObject()
mSel.getDependNode(0, mObj)
#Make iterator.
itDG = OpenMaya.MItDependencyGraph(mObj,
OpenMaya.MFn.kBlendShape,
OpenMaya.MItDependencyGraph.kUpstream)
while not itDG.isDone():
oCurrentItem = itDG.currentItem()
blndSkin = OpenMayaAnim.MFnBlendShapeDeformer(oCurrentItem)
print blndSkin
break
不幸的是我没有混合变形器。在
同样的例子玛雅.cmds公司名称:
^{pr2}$任何帮助将不胜感激!在
所以我找到的解决方案是:
诀窍是我需要传递形状节点并且只使用OpenMaya.MItDependencyGraph.kPlugLevel). 在本例中,它查找blendshape的基对象。在
如果从可变形对象工作,则不需要“未来”标志:
为了得到实际的形状,你需要添加
^{pr2}$相关问题 更多 >
编程相关推荐