Rendering animations


#1

Newbie question here:

Is the batch render option inside Maya the only way to render animations or is there a better, faster way?


#2

The best way to batch render is from a Command Prompt in windows or a terminal/console in *nix. Honestly I have used Maya since 1.0 and never once tried to batch render inside the package. The nice thing about using a command prompt is you can built .bat files in windows or scripts in *nix to render multiple files at once. Also, you can telnet into other machines for simple and primitive network rendering.

To render with the maya software renderer, type ‘Render’ at the command prompt to see all the options. A sample command might be:

Render -s 1 -e 100 -b 1 -pad 4 -rd F:\frames\stuff -im super_duper -n 0 F:\jobs\stuff\scenes\wow.ma

To render with mental ray for maya, try ‘mayarender_with_mr’. However this is super-lame, because it does not allow you to override options (such as start frames, etc.). A better way is to use a mel script. As an example, make a file called ‘MRender.mel’ and place it somewhere in your MAYA_SCRIPT_PATH. Inside the file:

global proc MRender( int $s, int $e, int $b,
string $rd, string $im, int $pad )
{
setAttr “mentalrayGlobals.startFrame” $s;
setAttr “mentalrayGlobals.endFrame” $e;
setAttr “mentalrayGlobals.byFrame” $b;

workspace -rt images $rd;
setAttr -type “string” mentalrayGlobals.imageFilePrefix $im;
setAttr “mentalrayGlobals.extensionPadding” $pad;

mrBatchRender_v15;
}

Now, to do a mental ray for maya render, try this:

mayabatch -command “MRender( 1, 30, 1, “c:/tmp”, “goog”, 4 )” -file mr_render_test.ma

Unfortunately you need those nasty \ to pass the quotes to the procedure correctly. That’s the pain. To get around this, write a perl wrapper…

As for batch rendering from a command line with maya’s other renderers, I have no experience but it can probably be done…

Hope some of this helps,

  • Matthew Durante

P.S. You may need to do the following in your file for that MR stuff to work:
setAttr “mentalrayGlobals.animationFromMaya” 0;
setAttr “mentalrayGlobals.animation” 1;
Honestly I forget… To get around this, you could try:
setAttr “defaultRenderGlobals.startFrame” $s;
setAttr “defaultRenderGlobals.endFrame” $e;
setAttr "defaultRenderGlobals.byFrameStep " $b;

  • in the script instead…

#3

I’m on XP and I go to the Command Prompt, type Render, and nothing happens. Am I missing something?

EDIT: Nevermind. I found out I had to switch to the Maya\bin directory.


#4

Normally maya’s /bin directory should be in your PATH already. You might want to add it if not… It’s also possible windows first found some other program named ‘render’ that is also in your path…

  • Matthew Durante

#5

I got an error in DOS:

Cannot find procedure “mrBatchRender_v15”

I’m using Maya 5.0.1. I searched for the script in the Maya directory and found this one in this folderAliasWavefront\Maya5.0\scripts\others :

mrBatchRender_v5

is this the one your script should be pointing to in Maya 5? It seems to work when I change it to v5 instead of v15


#6

That’s right, mrBatchRender_v15 is for Maya 4.5 I believe…

  • Matthew Durante

#7

I ddin’t see if someone already mentioned this or not, but in XP(I think in Win2K as well) if you just right-click on your maya file, there’s a “Render” option right below where it says “Open”.

Just make sure all of your settings are the way you want them, then close Maya and right click and render your scene.

I think this is basically the same as going through the Command Prompt, but without all of the menus and stuff.


#8

That does work, but this is about batch rendering a whole lot of
files, in order, with mental ray so you don’t have to keep starting
individual renders.

I made a mr_render.bat file and put this in it.
It works to create mental ray batch renders:


mayabatch -command "MRender( 573, 574, 1, \"H:/_demoReelMaya/cameleonBoy/images/mr/\", \"mr_gm_\", 4 )" -file H:\_demoReelMaya\cameleonBoy\scenes\bkgds_master_01.ma
mayabatch -command "MRender( 768, 769, 1, \"H:/_demoReelMaya/cameleonBoy/images/mr/\", \"mr_gm_\", 4 )" -file H:\_demoReelMaya\cameleonBoy\scenes\bkgds_master_01.ma
mayabatch -command "MRender( 140, 258, 1, \"H:/_demoReelMaya/cameleonBoy/images/mr/\", \"mr_gm_\", 4 )" -file H:\_demoReelMaya\cameleonBoy\scenes\bkgds_master_01.ma

make a bat file like this and it’ll work!


#9

What does the c:/temp in that demo-batch-file above from MDurante do?
The scriptline that gets this variable is: workspace -rt images $rd;
but I don’t know what this is supposed to do. I thought this would maybe be the location where the images should be rendered to, but when I try it isn’t, they are still thrown into mentalray/images.


#10

does anyone know how to do this in OSX


#11

I am trying to do this in OSX and it also seems to be possible

when I run a command like:
mayarender_with_mr -s 1 -e 15 -b 0 “Users/mimo/Documents/maya/projects/default/scenes/hupfball_fg.mb”

a second terminal window is popping up … the render report … telling me the maya to mr pluggin could not be loaded … anyone knowing how to help this

here´s the errormessage:

***** Error:
file: /Applications/AliasWavefront/maya5.0/Application Support/scripts/startup/autoLoadPlugin.mel line 37: initializePlugin function failed (Mayatomr)

Error: line 1: initializePlugin function failed (Mayatomr)
Error: line 1: Plug-in, “Fur.lib”, was not found on MAYA_PLUG_IN_PATH.
Error: line 1: Plug-in, “xfrog.lib”, was not found on MAYA_PLUG_IN_PATH.
Error: line 1: Plug-in, “AM_VelvetShader_30.lib”, was not found on MAYA_PLUG_IN_PATH.
Error: line 1: Plug-in, “AM_Velvet_30.lib”, was not found on MAYA_PLUG_IN_PATH.

thnx


#12

Hi!
Not sure, but thsi sounds like you haven’t set your pathes correct.
Don’t know how to do it with OSX, but on win you open a shell and Type: SET MAYA_INSTALL_PATH =“c:\mypath”
and thats it. So maybe you just have to do this with your MAYA_PLUG_IN_PATH and point it to your plugs directory!


#13

I am a total scripting noob - mel or terminal - but I will give it a try

so i type this in the terminal (osx shell)
SET MAYA_INSTALL_PATH =“c:\mypath”

and for “c:\mypath” I put in where mental ray lays on my machine … that would be :
“harddisk:\Applications/AliasWavefront/maya5.0/mentalray/…”

my mental ray folder contains:
maya.rayhost
maya.rayrc
and 3 folder named
devkit
include
lib

so is this how I can set the path to MR in my shell, and which file should I put in stead of the …

:bowdown:
thnx for helping a shell-fool


#14

mimo8 why don’t you use a render manager? it’s easier to set up… check this one for OSX:

SEB

It’s just alpha, but it’s nice.

The Windows version can also net render animations and splits single renders too


#15

maxx10 … why dont I use a render manager … its so simple … cause I didnt know that exists for OSX

:applause: :bounce: :applause:

THANKS A MILLION
havent tried it out but it would be too great if that would work

:thumbsup:


#16

:thumbsup:
goodnews: seb works and it seems to be a cool tool … although it doesnt support more than 1 computer under OSX … yet

:cry:
seb starts the external batch renderer but then the terminal still gives me the same errormessage:
***** Error:
file: /Applications/AliasWavefront/maya5.0/Application Support/scripts/startup/autoLoadPlugin.mel line 37: initializePlugin function failed (Mayatomr)

Error: line 1: initializePlugin function failed (Mayatomr)
Error: line 1: Plug-in, “Fur.lib”, was not found on MAYA_PLUG_IN_PATH.
Error: line 1: Plug-in, “xfrog.lib”, was not found on MAYA_PLUG_IN_PATH.
Error: line 1: Plug-in, “AM_VelvetShader_30.lib”, was not found on

can anyone guide me through that problem or send a link … I allready tried to type in

SET MAYA_INSTALL_PATH =“harddisk:\Applications/AliasWavefront/maya5.0/mentalray/…”

in different ways, but beeing knowing nothing abbout comands I dont know if I did it right

by the way: in maya itself I can render single mental ray images … so MR is there … the external batch renderer or the terminal just doesnt find it … cannot install it …
:hmm:


#17

when I set the render globals to software render it works fine … that is great

now it would be too :cool: to render MR sequences as well


#18

uhm, haven’t tried it with mentalray yet, I use maya native render for all my stuff, although it should work and as for network rendering under osx it’s coming :wink: If you have problems try to contact Marco, SEB’s author (you can find his email in the “info” panel), he’s a nice guy… maybe a bit too busy, but I’m sure he’ll be supportive

… in the meanwhile send me an email, I can send you a MEL script that might help you


#19

ooopppsss… my bad, at the moment SEB doesn’t work with mentalRay :blush:


#20

For setting a path you do not have to define a file, just leave out the “…”.
I do not really thing that a rendermanager will find you Paths if they aren’t set correct in you system. But I might be wrong and a rendermanager is a big help anyway…