If you start Maya from the command line, there are various startup options you can specify. For example, you can open a file at startup using the -file flag:
maya -file filename maya.exe -file filename
To see the available startup flags, type the following:
maya -help
Maya can be run in several distinct modes that affect its overall manner of operation, two of which allow you to execute Maya commands without the interface, -prompt and -batch (on Windows, use mayabatch.exe instead of maya -batch).
maya -batch -file someMayaFile.mb -command "file -save"
For Windows:
mayabatch -file someMayaFile.mb -command "file -save"
These are additional flags you can use when starting up Maya from the command line (maya on Linux/Mac OS X; mayabatch.exe on Windows).
-archive [file] |
Displays a list of files required to archive the specified scene and then exits Maya. |
-command [mel command] |
Runs the specified command on startup. The command should be enclosed in double quotes to protect any special characters, including spaces. |
-log [file] |
Copies all standard output and error messages (those that normally appear in the Output Window) to the specified file (use complete file name). This flag is for Windows only. |
-noAutoloadPlugins |
Do not auto-load any plug-ins. |
-optimizeRender [file] [outfile] |
Processes the specified scene file to optimize it for rendering, puts the result in outfile and then exits. Use maya -optimizeRender -help for more options. See -optimizeRender flags. |
-proj [dir] |
Looks for scene files in the specified project directory. |
-recover |
Recovers the last journal file. |
-script [file] |
Sources the specified file (which is expected to be a MEL script) on startup. |
-v |
Displays the product version and cut number, and then exits. |
-3 |
Enable Python 3000 compatibility warnings. |
Beginning Maya 2012, for the Linux and Mac platforms, there are checks to ensure that the directory pointed to by lastLocalWS is accessible before Maya attempts to use it. The directory must have 555 (r-xr-xr-x) permissions. Otherwise, if the directory only has 444(r--r--r--) permissions, Maya cannot use it; even cd or ls do not work.
In addition to lastLocalWS, there are other workspaces that Maya tries to use on startup, and the same check is being applied to these workspaces also. The order in which Maya tries to use these workspaces are as follows:
Use this command to optimize the specified scene file for rendering, send the result to an output file and then close Maya.
maya -optimizeRender [options] [file] [outfile]
The available [options] are:
-botRes [int] |
Specify a minimum file texture resolution that will cause BOT files to be produced. For example, specifying “-botRes 256” means that all file textures bigger than 256x256.will be converted to BOT format. |
-botLoca [name] |
Specify the directory in which BOT files reside. The default is in the same directory as the original file. |
-help |
Displays all the flags available for use with -optimizeRender. |
-noBOT |
Does not create BOT files. |
-noCleanup |
Does not clean up useless data. |
-tessFreeze [startframe] [endframe] [byframe] |
Calculates NURBS tessellation that gives the best image quality based on the camera projection. |