I want to get into the DIGM211 directory next, so use “cd” to change directories. Once in DIGM211, again type “dir” to list the contents (Fig.09).
(Fig09)
We have taken a very long route to get to this file to illustrate the basic steps in getting around using the command line. However, normally once in the G: drive, I'd just type: “cd DIGM211\MidTerm\scenes” (Fig.10).
(Fig10)
And here we have all the different scene files I’ve saved for the MidTerm project. Two things to take note of in particular are:
1: The individual renderCam files at the bottom of the list. These are individual copies of the final scene that I set up for each camera move or shot; each one has individual start and end frame settings and renderable camera settings and prefix names. While this isn't necessary, and anything you adjust in the Render Settings window in Maya can be achieved using flags in the command line (explained later), it will make things easier when you are starting out. It also allows you to work with smaller scenes due to the fact you can basically delete anything not visible in the shot.
2: Notice the .bat files – VERY IMPORTANT and explained in a bit!
OK, first things first. Flags are basically little variables that store the settings you'd like to use in your renders. There are a lot of them! So even though we specified a lot of things in the Render Settings window of our scene file, they can be changed from the command line. The saved file will not be affected, just the render. To see a list of the Maya Renderer flags, type: “Render –h” (Fig.11).
(Fig11)
3DTotal
Advertisement - We need your support!
This is a truncated list of the option flags that will be listed. I'm not going to go into what each one does – you can explore that on your own someday! The Maya documentation (F1 from inside Maya) has a great list and also goes over the Mental Ray flags. Third party render apps (PRMan, 3Delight, etc.) will have their own special flags, so read their documentation to learn more. I'll only describe a few of the Mental Ray flags that I use most often in this tutorial.
Now, you can either write your commands directly in the Command Prompt window, or you can use a text editor like notepad (notepad scripts are executed as .bat files, which are covered a bit later on) to write your code. Don't use a word processor!
On Windows: Start > All Programs > Accessories > Notepad (Fig.12)
(Fig12)
OK, in my MidTerm\scenes directory I have a file saved as “gears.mb”. Let’s say I want to render it. To just use the standard Maya Renderer, type: “Render yourFilenameHere.mb” (or .ma depending on how you have saved them) (Fig.13).
(Fig13)
If you hit Enter, this will launch the Maya Renderer and begin rendering the scene file you want, using all available processors, using the preferences you set up in the Render Settings window way back at the beginning of this tutorial, and saving all the images to the “images” folder in the project directory that Maya built for you.
Before you start rendering long animations, it's important to note that, while in the Command Prompt window, by holding down the Control key and pressing the letter “C”, you can interrupt the batch render. You can then type “Y” to affirm the quit command or “N” to resume rendering.
Let’s say you want to use Mental Ray: Render -r mr yourFilenameHere.mb (Fig.14)