我试图在Python脚本的末尾打开玛雅场景.ma
,
路径看起来是这样的:G:\ProjectPath\Scene.ma
。
但是我唯一知道的命令是MEL命令:
file -f -options "v=0; p=17; f=0" -ignoreVersion -typ "mayaAscii" -o
"G:/ProjectPath/Scene.ma";
addRecentFile("G:/ProjectPath/Scene.ma", "mayaAscii");
有人知道用Python做这件事的方法吗?
发布于 2017-04-16 15:12:34
下面是一种通过Python快速实现这一功能的方法:
import maya.cmds as cmds
# Windows path version
cmds.file('G:/ProjectPath/Scene.ma', o=True)
# Mac path version
cmds.file('/Users/mac/Desktop/Scene.ma', o=True)
如果您收到类似于此# Error: Unsaved changes
的消息,请尝试此版本。
file_path = 'G:/ProjectPath/Scene.ma'
cmds.file(new=True, force=True)
cmds.file(file_path, open=True)
https://stackoverflow.com/questions/43437352
复制相似问题