scripting - How do I execute Maya script without lauching Maya? -
for example, want launch script creates poly cube, export .stl or .fbx command line.
i can in python using maya standalone cannot handle exporting other formats .ma apparently
why of course can. here's how you'd (for fbx):
from os.path import join maya.standalone import initialize import maya.cmds cmds import maya.mel mel initialize("python") cmds.loadplugin("fbxmaya") my_cube = cmds.polycube() cmds.select(my_cube[0], r=true) my_filename = "cube2.fbx" my_folder = "c:/somefolder/scenes" full_file_path = join(my_folder, my_filename).replace('\\', '/') mel.eval('fbxexport -f "%s"' % full_file_path)
hope useful.
Comments
Post a Comment