我想讓瑪雅來檢查列出的對象是否是一個Blendshape節點或不。Python瑪雅 - 如果objectType返回「沒有指定對象名稱」
這是我的代碼:
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"):
除了I AM指定對象名,對象名稱是BS ..我有打印了bs的結果,並列出了許多對象。許多。