SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Programming / Batch render different frames into different directories

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
 
Thread Tools
21-06-2012, 09:08 PM   #1
danielames
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?

  Reply with quote
22-06-2012, 06:01 PM   #2
danielames
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! 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
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
RENDER VS BATCH RENDER VS VECTOR! Albepie Lighting & Rendering 0 24-03-2016 12:56 PM
Help! Render Settings reset when i batch! Alefik Lighting & Rendering 0 03-07-2015 05:57 PM
Batch Render Always fails Stevenhanton Maya Basics & Newbie Lounge 9 26-03-2006 12:42 AM
Batch Render Problem mayakid14 Maya Basics & Newbie Lounge 0 22-08-2005 03:43 PM
batch render not available? soulcialism Maya Basics & Newbie Lounge 2 17-02-2004 04:38 AM