Sunday, April 27, 2008

Command line rendering and render queues in Maya

One little nifty trick one can do is to use the command line renderer that ships with maya. Or rather: When you start the Batch render -process from within maya, you are actually starting a separate process. Thing is, you can start this process from outside of maya, using just the command prompt. There are some advantages to this, two of these are
- Not having to spend system resources on Maya itself, the renders are slightly faster
- With a simple trick, you can put multiple scenes on queue.

The basics are simple, just open a command prompt from windows (or open the Maya Terminal in OSX). type Render myscene.mb.

Now, there are many flags you can set when using this command, but if everything is set in maya, that is all there is to it. Some other useful flags follow here:

-x int and -y int : The resolution of the Render
-s int and -e int: The starting frame and the last frame of the render
-rd : output directory
-im : output image file name

Render Queue

In windows, you have something called batch-files. These are text files that can contain several command prompt commands. For instance, you can create a file called myRenders.bat. In it you have two lines
Render scene1.mb
Render scene2.mb

When you run the batch-file (double click it or type myRenders.bat in the command prompt, the two commands will run after each other. In this case, you will render out first scene1 and then scene2.
This is useful if you have multiple scenes you want to render overnight. Just type a number of Render-commands in a batch file and you are ready to go.

With the use of flags, you can make multiple renders of the same scene as well. For instance, it would be easy to make a batch-file that did both the entire scenes, and also rendered out a particular frame from each scene in higher resolution (if you would want something like that.)

1 comment:

Chris said...

Batching In os x -

I write out each of my render commands in text edit and paste them all at once into terminal. The return after each line batches them one after another.