Render Batch for Autodesk Maya

Here's some basic stuff for command line render. Let's assume you have setup everything inside maya, your camera, your render layers, etc..etc.. And just in the midle of your animation, you wanna change the camera so it switch from camera1 to camera2, then back to camera1 on specific frames. And also you just need to render only three render layers... for now.

So, here's what u need to do. Create a new text document, either within ur project folder, or somewhere within ur desktop. I prefer create it in my project folder. Name it "render" or whatever, and change the extension to ".bat", so the file name would be "render.bat".

Next step is to fill out that empty file. Open and edit that file with notepad. Now... here comes the fun part. Let's assume the length of the animation is 250 frames. Frame 1 to 150, we render from camera1. From 151 - 200, render from camera2. From 201 - 250 back to camera1.

Type:
render -r mr -proj d:\My_Projects\My_3D -s 1 -e150 -cam camera1 -rl diffusePass,shadowPass,specularPass -rt 0 -finalRender.mb

render -r mr -proj d:\My_Projects\My_3D -s 151 -e200 -cam camera2 -rl diffusePass,shadowPass,specularPass -rt 0 -finalRender.mb

render -r mr -proj d:\My_Projects\My_3D -s 201 -e250 -cam camera1 -rl diffusePass,shadowPass,specularPass -rt 0 -finalRender.mb

Save this file.

To render the animation, just double-click this file. It will open some sort of dos window and showing the maya render information.

Now, here's some brief infos about what we wrote earlier:

render -r mr -proj d:\My_Projects\My_3D -s 1 -e150 -cam camera1 -rl diffusePass,shadowPass,specularPass -rt 0 -finalRender.mb

Render -r mr : we tell maya to render using mental ray (mr). If there is no -r flag, maya will use whatever rendere you specified in your scene file. But default settings are maya software.

-proj d:\My_Projects\My_3D : we define the project path. I used to use this for safe reason. If render using network, chang the path something like "//ComputerName/FolderName/ProjectFolder".

-s 1 -e 150 : simply set the start frame (-s) is 1, and end frame (-e) 150.

-cam camera1 : we render using camera1

-rl diffusePass,shadowPass,specularPass : Here is the flag for render layers (-rl). When u render multiple render layers from command line, dont use any space between commas, like "-rl shadowPass, specularPass". If there is a space like this between comma and letter "s" of specularPass, maya will generate error.

-rt 0 : here we tell maya to render using any available processors. I think this option only available when you render with mental ray from command line, but might check maya help later.

finalRender.mb: is the file we want to render.
Well, that's the options I always use when rendering from command line, of course, you may add more options to suit your needs. Like I said earlier, here's just some basic stuff when rendering from command line. For more available options for command line render, you should see maya documentations, of course lah..

Komentar