This tutorial is geared towards Maya users with little or no experience working in the Windows Shell.Â It was written to help students in a class I was in to help them better understand how to launch batch renders from the command line, and how to create batch scripts to execute a number of separate file renders automatically.
Command line rendering allocates more system resources to the render processes than if one were to render with Maya open.Â Additionally, in an environment using a license and a server (such as in most universities and large businesses) there are often more users than there are licenses!Â So, in addition to being less efficient and more unstable, batch rendering from within Maya locks up a license unnecessarily.Â All in all, unless it's for a preview, it's better to render with Maya closed!
Make sure you have set up a "project file" in Maya.Â This step should have been done at the very start of an assignment, but it can technically be done at anytime.Â To set up a project up go to: File > Project > New (Fig.01).
You will then get the New Project dialogue box (Fig.02). Click the "Use Defaults" button at the bottom and specify the name of the project and the location where you'd like it stored.Â Don't use any spaces or funny characters in your scene names or filenames - it's just easier in the long run if you don't!
For the remainder of this tutorial I'm going to use the project name "MidTerm".Â The location of the MidTerm project is going to be G:\DIGM211\MidTerm.Â To find your file path, navigate to your project and look at the file path box in the explorer window (Fig.03).With your project set, any files you save while working within the project will be stored in their proper folders.Â This is priceless!Â Maya does most of the work for you, but what you need to do before you start rendering animations is to go into the "images" folder of your project and MAKE INDIVIDUAL FOLDERS FOR EACH AND EVERY CAMERA AND/OR SHOT YOU ARE GOING TO RENDER!
OK, so you are working in a project, you have your camera moves, animations, lighting, and texturing all ready for a batch render.Â While it's possible to batch render from within Maya, this approach is incredibly inefficient.Â In reality, rendering anything other than previews in Maya is inefficient.Â The reason for this is that the Renderer and Maya are actually separate programs.Â So by rendering with Maya open you are going to be needlessly clogging your systems memory.Â On large scenes there is often no other alternative than rendering from the Command Line.Â As your work in Maya progresses you might end up working on scenes that can take 5-10+ minutes to simply OPEN.Â Rendering from the command line allows you to render whatever you specify without ever opening Maya.
The easiest way to begin Command Line rendering is to, from within Maya, open the scene you want to render and set all the render settings to how you'd like them. i.e.:
File Name Prefix:
Â I recommend using the camera name you are rendering from (you are using dedicated cameras for rendering, right?)
Â name.#.ext, or name_#.ext
Â LOSSLESS FORMATS ONLY (EXR, Targa or Tiff generally)
Â Whatever frame in the timeline you want the animation render to start
Â Whatever frame in the timeline you want the animation render to end
Â 1 usually; 2 is sometimes used if you want to render every other frame for a preview
Â How many number spaces are in the .ext of the frame render names.Â Let's say you have 350 frames you want to render - use 3 for the frame padding.Â That way the files will then start with frame number 001 and end at frame 350.Â Compositing programmes will be sure to understand the numbering this way.
Â BE SURE TO SET THIS TO THE RIGHT CAMERA FOR THE ANIMATION!
- Alpha Channel (mask) checked - on - if you are going to composite
- Depth Channel (zDepth) checked - on - if you are going to do depth of field, etc. in post-production
And finally, set the Render quality levels for whatever Renderer you want to use.Â Save your scene after the render settings are all perfect.
Take a deep breath and close Maya.Â The rest of this tutorial is going to assume you are working on a Windows machine.Â
Go to Start > Run (Fig.04)
You will get a little dialogue box - type "cmd" in it and click OK (Fig.05). This will open your Command Prompt.Â If you are on a Mac you can open a terminal window; UNIX users open a shell window - it's all basically the same thing (with different syntax) (Fig.06).
Fig. 06 - Click to Enlarge
My project's file path (if you'll recall) is: G:\DIGM211\MidTerm.Â So, as you can see from the Command Prompt in Fig.06, we are in the C:\ drive. Â To change drives, type the drive letter followed by a colon and hit Enter.Â For me: "G:" (Fig.07). Type "dir" to list the contents of whichever drive you are in (Fig.08).
Fig. 07 - Click to Enlarge
Fig. 08 - Click to Enlarge