我试图让 Maya 检查列出的对象是否是 blendshape 节点。
这是我的代码:
def bake(self, *args):
self.items["selection"] = cmds.ls(sl = True)
self.items["shapes"] = cmds.listRelatives(self.items["selection"], ad = True)
shapes = ()
for i in self.items["shapes"]:
bs = cmds.listConnections(i, type = "blendShape", exactType = True)
if cmds.objectType(bs, isType = "blendShape"):
print bs
它返回# Error: RuntimeError: file X:/Documents/maya/scripts\jtBakeCharacter.py line 16: No object name specified
第 16 行是:if cmds.objectType(bs, isType = "blendShape"):
除了我指定一个对象名称之外,该对象名称是 bs .. 我已经打印了 bs 的结果,它列出了许多对象。许多。