Command Line Mental Ray batch render?

Hi,

I have a scene and I have 3 cameras in the scene. I want to make a batch render and get separate sequences for each of my cameras.

Since each cameras travels on path... it will be hard to use only one camera and change the position with "stapped" keyframes at cut points.

I currently use this technique:
mayarender_with_mr -file scene_camera1.mb -proj M:projectoutput_Camera1
mayarender_with_mr -file scene_camera2.mb -proj M:projectoutput_Camera2
mayarender_with_mr -file scene_camera3.mb -proj M:projectoutput_Camera3

but with this technique... i have to save individually configured files... which increases the risk of mistakes.

What is the exact command line that will call a mental ray batch render using the same maya file but accessing different Cameras and different time-line parts. (ex: Camera1 / 0-100, Camera2 / 101-200, Camera3 / 201-300)

I know that there are flags and lots of settings like:
-s -e -of -rd etc...

but it seems like those are compatible with Maya Soft render engine?

Thanks.

You could create a new camera, and by animating point and orient constraints and key the "cut"s - and render only this one. Actually I seem to remember a ready mel script at this site tailored for this purpose, but the name eludes me right now.

thanks...
I have found the script... it is here. The name is: ak_switchingCamera...

it is a great tool... but i think it is not working on MACs... I have created my scene on a PC... but the rendering was supposed to be done on a few MACs... so i did not use this script... instead i rendered separate scene files for each camera move... which was pain in the ass...

Maya scripts are system independent so unless the scripter was a total idiot then it wowould work on both windowes mac and linux.

Theres a better alternative tough. And its the way you did irt except its not pain in the ass.

Fisrt you create a instruction file that contains what frames wqhat cameras should render (maya can generate this just plain text). Then you do a simple batch scrtipts that reads each entry and sends a amya rednere instruction based on that. Ist rather easy. What shell language does your mac users predominataly use?

About 5 minutes of work that can be than capatalized on over and over agein untill the next version of maya coems out at wich time you may wish to chek tahat it still works.

Could you please explain how i can do that?...
How can maya generate that information?...
and... how will i turn that into a script?...

In this case you could explain it for the Windows platform... since i am new to MACs... it will be very hard to figure out what is going on...

Thanks...

with the -cam commandline option you can specify the name of a camera in the scene that will be used for rendering.

that should solve your problem.

-k

mayarender_with_mr -cam Camera1 -file scene.mb -proj M:projectoutput_Camera3

So this is the command?... i am a little bit confused about the render applications.... is it "render" or is it "mayarender_with_mr"... which flag works with which command?

how can i perform multiple command lines? multiple render commands in the *.BAT files does not seem to continue the render...

Sorry for being so dumb...

What version of maya are you using?
Since v 6.0 there is a unified render commmand (no need for mayarender_with_mr anymore). Just use the -r option with mr to specify the mentalray renderer (sw would be maya software renderer)
So go:
render -r mr -cam -im scenefile.ma
there are much more options check it out.

as for the bat files. On windows it would continue rendering with the next line. Don't know how to make a batch file on mac to be honest...

-k

BAtch on mac works more or less like the windowa one jsut a different flavour of interpretter syntax. wich is a boon as the windows batch comamnds are limtted to the extreme. (its jsut a bit smarter than the windows one tahts all)

Note because mac ia ?nix based as of OsX you cann have a variety of dsifferent shells in use. So the syntax depends on what shellscripting language you happen to like.

Thanks for the help...

I am using Maya 6.0... but will switch to 6.5 in a few days.

so the lines that i should include in the *.BAT file should be like:
render -r mr -cam camera1 -im camera1_output scenefile.ma
render -r mr -cam camera2 -im camera2_output scenefile.ma
render -r mr -cam camera3 -im camera3_output scenefile.ma

?

and run the *.BAT file on command prompt... and it will render?

You may wonder why i am asking but not trying it... Ok i just want to be sure... and do not run into a dissapointment

Thanks again.

Thanks Joojaa,

I am using Mac OSX... and i know only two things... there is a console... that works pretey much the same as output window on PC... and a terminal... so how should i prepare the batch file for rendering multiple files on a MAC... could you please help me?

thanks.

No! The idea is thge same the lingo is very different. You should Read some manpages on this they shipped with your osx, in *nix world you gaet a lot of freedom in this aspect so i suggest you invest some time to developping shellscripts. Personaly id prefeer zsh but let us contend with sh isntead.

Okeay lets create a file any name will suffce teh on firts line of that file define what shell interpretter you want to use. so type

#! /bin/sh
# now the shebang (sharp=# !=bang) line above is important to know
# what shell to use out of many. Theese lines are offcourse comments!

#now add the commands youd normaly execute:
render -r mr -cam camera1 -im camera1_output scenefile.ma
render -r mr -cam camera2 -im camera2_output scenefile.ma
render -r mr -cam camera3 -im camera3_output scenefile.ma

then save the file

Executing the file... well your not done yet.

you could type

sh filename

but on the long run this becomes tedious. so tpe chmod +x shellscript name and now you could execute it by thyping just its name.

Note its cutomary to have .sh extension for sh shellscripts tough not neccesery.

The language and cappabilities of different shells wary widely thets why i asked what shell you prefeer. its best to work with that what you use.

ok... thanks alot. You are right... first i have to learn about the scripting environment under OSX... I am really a newbie in the MAC stuff... it is hard for an old PC user to switch to MAC...

anyway... thanks... your message can be a good reference point for what should i research...