Complex UV Layout in Maya
Over the last couple of years UV layout in Maya has changed for the better. In this course we're going to be taking a look at some of those changes as we UV map an entire character
# 1 21-06-2012 , 09:08 PM
Subscriber
Join Date: Jun 2011
Posts: 17

Batch render different frames into different directories

I just want to automate this with mel. I thought "How hard could it be?"... HA!

I just to make a mel script that will:
render frames 1-10 into images\chunk01\name.1.png thru name.10.png
render frames 11-20 into images\chunk02\name.1.png thru name.10.png
render frames 21-30 into images\chunk03\name.1.png thru name.10.png
... you get the idea.

Note that I want each directory (images\chunknn) to contain 10 frames that are renumbered from 1 to 10 each time. Here's what I do NOT want...

images\chunk01\name.1.png thru name.10.png
images\chunk02\name.11.png thru name.20.png
images\chunk03\name.21.png thru name.30.png

Multiple problems I've run into so far:

"batchRender" doesn't give me any way to specify which frames I want rendered.
"render" doesn't give me the control I need either. I've found examples all over the internet like "render -s 10 -e 20", but maya 2011 doesn't recognize the -s or -e flags.

I've tried many other techniques as well to no avail. To keep this post as short as possible, I'll omit them for now.

Am I making this more complicated than it really is?? How would you do it?

user added image

# 2 22-06-2012 , 06:01 PM
Subscriber
Join Date: Jun 2011
Posts: 17

SOLVED!!

I found a way! So in my initial inquiry I mentioned that -s and -e don't work in maya 2011... Well I suppose that's because I was trying those flags by calling 'render' from within Maya's Script Editor. After some digging, I came to realize that they were talking about the render command executable that can be found in "C:\Program Files\Autodesk\Maya2011\bin" (or where ever you installed maya).

Sooo...
1) I added C:\Progra~1\Autodesk\Maya2011\bin to my path. (Note that I used the '~1' version of the name, not the "Program Files" version. The space will confuse render.exe...)
2) Now I can use render.exe from the command line! Like this:

render -r sw -im myName -of png -s 1 -e 10 -b 1 -pad 4 -rd images\chunk01 scenes\myScene.ma

3) Which means that I can write a windows batch script to do what I want! user added image Like this:

render -r sw -im myName -of png -s 1 -e 10 -b 1 -pad 4 -rd images\chunk01 scenes\myScene.ma
render -r sw -im myName -of png -s 11 -e 20 -b 1 -pad 4 -rd images\chunk02 scenes\myScene.ma
render -r sw -im myName -of png -s 21 -e 30 -b 1 -pad 4 -rd images\chunk03 scenes\myScene.ma


...or I could use a 'for' loop.

For a description of what the different flags are, go to Maya Help (from within maya or at autodesk.com), and navigate to User Guide > Rendering and Render Setup > Rendering Utilities > Rendering Utilities Tools > Common flags for the command line renderer

Hope this helps someone!
d

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads