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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -