render batch animation layers

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  12 December 2017
render batch animation layers

I want to batch render a scene as many times as there are animation layers in it (except for the BaseAnimation layer).
So every time with 1 animation layer ON and the other animation layers OFF. The rendered png's having the name like so: animationLayer_001.png 

It's a script I'd put in a .bat file, so far I managed to always use code lines like this one below to render out my scenes:
"C:\Program Files\Autodesk\Maya2018\bin\render.exe" -r redshift -rd "D:\GameDevelopment\_Unity Projects\Sparks Prototype\Assets\Graphics\Animation QuickTest" -cam RenderCam -of png "D:\GameDevelopment\_Maya_Projects\Our Game Characters\Bowman\scenes\Walk\"

but this time it requires a more complicated process, does someone know how to solve this?
  12 December 2017
You are overcomplicating this.
Go to the render settings and in the file name prefix in the common tab you will see (not set; using scene name), or who knows, maybe you added a name
Well, right click there and chose from the popup what do you want to use. In your case you will use <RenderLayer>.
As a habbit, I put there renderOutput/<Scene>_<RenderLayer>/<Scene>_<RenderLayer>. So this will make a Renderoutput folder and there a folder named with the scene and layer, and then the file with the scene and layer.

The bat file can be a lot simpler as well:

set PATH=%PATH%;C:\Program Files\Autodesk\Maya2017\bin
render -proj LOCATION_OF_YOUR_PROJECT scenes\
echo "OMG, the rendering is finished, yeeey"

And that's it. In this case it will go trough each layer one by one and render it.
the first line will add the maya bin folder to the path environment variable so you can just type render, instead of the full path. The second line is just the command, with the flag for your maya project and of course relative path to the scene. echo "OMG, the rendering is finished, yeeey", will just print that line to the window. And pause just asks you to press any button to close the window
In the second line you can specify which layers to be rendered and which not. I prefer to set this up in the maya scene and set up the cameras as well.
the one button to render them all
  12 December 2017
why not save out several maya files... or export direct to .ass or .vrscene.?
  12 December 2017
For Leionaaad:
Ah yes, thanks for the tips but what you propose is not for ANIMATION layers but RENDER layers.

The reason I need this is because I want to render different animations, my bowman must shoot in various directions:

During this video I'm enabling a new animation layer and disabling the previous one every few seconds.

For oglu:
Because I want to be able to change the base animation easily should the animation have to change in the future, navigating from file to file takes time.
  12 December 2017
Ok I managed to make a Maya script mel script to change animation layers one by one. It works within maya but strangely enough when adding this:

- preRender "windowsPathToMelScript"

in the render.bat file it's not doing anything.

Here's the script:
string $root = `animLayer -query -root`;
string $layers[] = `animLayer -query -children $root`;
int $index = -1;
for ($layer in $layers)
int $isMuted = `animLayer -query -mute $layer`;
print $isMuted;

if ($isMuted == 0) break;
// mute all layers
for ($layer in $layers)
animLayer -edit -mute 1 $layer;
animLayer -edit -lock false $layer;
//set next layer on
$index = ($index + 1) % size($layers);
animLayer -edit -mute 0 $layers[$index];
print $layers[$index];
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:11 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.