mayapy/maya.standalone error: No object matches name: .aiTranslator

mayapy/maya.standalone error: No object matches name: .aiTranslator

当我在 mayapy 中 运行 时:

import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
cmds.file("/Users/Desktop/test.ma", open=True, force=True)

然后我得到这个错误:

RuntimeError: file: /Users/Desktop/dad.ma line 26: The camera 'perspShape' has no '.aiTranslator' attribute.
file: /Users/Desktop/test.ma line 26: setAttr: No object matches name: .aiTranslator
file: /Users/Desktop/test.ma line 43: The camera 'topShape' has no '.aiTranslator' attribute.
file: /Users/Desktop/test.ma line 43: setAttr: No object matches name: .aiTranslator
file: /Users/Desktop/test.ma line 59: The camera 'frontShape' has no '.aiTranslator' attribute.
file: /Users/Desktop/test.ma line 59: setAttr: No object matches name: .aiTranslator
file: /Users/Desktop/test.ma line 76: The camera 'sideShape' has no '.aiTranslator' attribute.
file: /Users/Desktop/test.ma line 76: setAttr: No object matches name: .aiTranslator
file: /Users/Desktop/test.ma line 90: The mesh 'pSphereShape1' has no '.aiTranslator' attribute.
file: /Users/Desktop/test.ma line 90: setAttr: No object matches name: .aiTranslator
Error reading file.
Error reading file.

但是当我在 Maya 中 运行 这个时:

import maya.cmds as cmds
cmds.file("/Users/Desktop/test.ma", open=True, force=True)

然后执行就好了。

test.ma 只是一个只有一个物体的新场景,没什么特别的。出于某种原因,运行通过 mayapy/maya.standalone 我得到这个错误

您可能需要检查是否加载了 mtoa。如果未加载,则在打开文件之前加载它。

import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
if  not cmds.pluginInfo("mtoa.so", q=True, loaded=True):
     cmds.loadPlugin("mtoa.so")
cmds.file("/Users/Desktop/test.ma", open=True, force=True)