PDA

View Full Version : Batch render multiple files - how?


Cartesius
03-16-2007, 05:17 PM
(Second try, my first post disappeared.)

I need help! I usually have a bunch of scenes I need to render overnight but I can't get any batch commands to work. Let's say I have 5 Maya 8.0 scenes I want to render. They are all still images, they all have their proper render layers set up and named, Render Globals is adjusted to correct render size and engine (Mental Ray) - everything is ready to go, all I have to do is render. But how do I batch render multiple files? I've tried right-clicking on the files and selecting "render" but this will render the files using standard software, not Mental Ray. I've downloaded scripts and applications from Highend3D.com but couldn't get any of them to work. I've browsed the forum here and tried writing my own .bat-files but although I can get at least one file to render it's not rendered using Mental Ray.

When using C4D I set up the scenes as I want them, specify the paths in C4D's batch render menu, click OK and go to bed - all scenes will be rendered by the morning, with all render settings respected (layers, specific render engines, sizes, etc.). How do I achieve this with Maya? Like I said, all files are ready to go, I just need to find out how!

Any help is appreciated!

/Anders

dr.rastaman
03-16-2007, 05:51 PM
Hello,

you can achieve this as follows:
Create a textfile with the text:
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile1.mb
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile2.mb
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile3.mb
...
and save it as render.bat

(The ' -r mr ' sets Renderer to Mental Ray)

Then simply doubleclick render.bat and go to bed ;o)

royter
03-16-2007, 10:35 PM
i created a txt file called render.bat
in it i wrote:
render -r mr -s 1 -e 2 C:/Documents and Settings/batenjen/Desktop/Jeux_musical_demo/scenes/101.ma

i double clicked the txt file, it jus opened and nothing hapened...

Eclectic
03-17-2007, 01:35 PM
most probably filename is not correct, meaning that your filename should be render.bat, not render.bat.txt or something similar.
Check file extension, it must be .bat

Cartesius
03-17-2007, 11:51 PM
Thanks, I will try this first thing on Monday!

/Anders

Hello,

you can achieve this as follows:
Create a textfile with the text:
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile1.mb
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile2.mb
render -r mr -s startframe -e endframe c:/pathTo/yourScenefile3.mb
...
and save it as render.bat

(The ' -r mr ' sets Renderer to Mental Ray)

Then simply doubleclick render.bat and go to bed ;o)

Cartesius
03-19-2007, 10:46 AM
No luck. :sad: I created a text file and added the following two lines:

render -r mr -s 1 -e 1 C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb
render -r mr -s 1 -e 1 C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test2_MR.mb

And saved the file as render.bat, but when executed the command prompt window just displayed rolling text. I've checked the files and everything is OK (camera is renderable and so on) but it doesn't work.

Any ideas?

/Anders

Edit: the space between m and b above (in test1_MR.mb and test2_MR.mb) is not present in the bat-file, of course, it's formatted like that in this post only for some reason.

isoparmB
03-19-2007, 11:30 AM
Save as .bat, but make sure to save as type: all files, and not as text, if you're using notepad. That might be it.

Cartesius
03-19-2007, 11:48 AM
Save as .bat, but make sure to save as type: all files, and not as text, if you're using notepad. That might be it.

Thanks for the suggestion but the file is saved as .bat: all files. I have really no idea why it's not working! :banghead:

/Anders

dr.rastaman
03-19-2007, 12:14 PM
Sometimes it helps to specify the full path to render.exe.
Try something like:
c:\program files\alias\maya7.0\bin\render -r mr ...

pjswam
03-19-2007, 01:20 PM
Hello,
I can see major problem with yours .bat files. The name of yours render path has whitespace so this is why your batch render isn't work properly. You have to put your paths into quotation-marks.
e.g.

Wrong: C:\Documents and Settings\anders.kjellberg\...\scenes\test1_MR.mb

Correct: C:\Documents and Settings\anders.kjellberg\...\scenes\test1_MR.mb

By the way, this link (http://www.jawa9000.com/technical/batch/batch-rendering.htm) could be helpful:)

Cartesius
03-19-2007, 02:30 PM
Still no luck, I'm afraid. I tried:

C:\Program Files\Alias\Maya8.0\bin\Render.exe render -r mr -s 1 -e 1 "C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb"

but the command prompt just flashes once briefly and then nothing. (I put the quotation marks around the file path as I read somewhere that if you have spaces in the path you need them but even if I remove them nothing happens.)

I also tried placing the .bat-file in the scenes directory and shortening the string to this:

C:\Program Files\Alias\Maya8.0\bin\Render.exe render -r mr -s 1 -e 1 test1_MR.mb

but still no go. However, when I removed the path to Render.exe, like this:

render -r mr -s 1 -e 1 test1_MR.mb
render -r mr -s 1 -e 1 test2_MR.mb

and had the.bat-file in my scenes directory it worked! Both files were rendered using Mental Ray and all my render layers and settings were respected and intact! It's a bit of a snag that I have to have the .bat-file in the scenes directory but I can live with that :)

Thanks for all your help, guys, I really appreciate it!

/Anders

dr.rastaman
03-19-2007, 02:55 PM
Still no luck, I'm afraid. I tried:

C:\Program Files\Alias\Maya8.0\bin\Render.exe render -r mr -s 1 -e 1 "C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb"
Should have been like this:

C:\Program Files\Alias\Maya8.0\bin\render -r mr -s 1 -e 1 "C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb

Good luck :)

Cartesius
03-19-2007, 03:11 PM
Should have been like this:

C:\Program Files\Alias\Maya8.0\bin\render -r mr -s 1 -e 1 "C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb

Good luck :)

I tried it but nope, nothing. The command prompt says that "'C:\Program' is not recognized as an internal or external command" so the process ends after a few seconds. But as I'm in hacker-mode right now (ie. I have no idea what I'm doing!) I added quotation marks around the path to the render application as well, like this:

"C:\Program Files\Alias\Maya8.0\bin\render" -r mr -s 1 -e 1 "C:\Documents and Settings\anders.kjellberg\My Documents\maya\projects\ProjectX\scenes\test1_MR.mb"

and the file rendered without a hitch! This is great as I can control which version of Maya/Mental Ray I want to use for rendering plus I can both edit and run the .bat-file from say the desktop.

Thanks! :thumbsup:

BPorter
03-22-2007, 11:58 PM
go to a command prompt in windows and type:

echo render -r etc.... -proj pathToProject scene.mb > render.bat


go to the directory where your shell is currently and right click on the render.bat file and edit it if you want to add more renders.

CGTalk Moderation
03-22-2007, 11:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.