Batch render layers

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Batch render layers

Post by ponysmasher »

Not sure if this is of any use to anyone else, but since I often composite my animations I use it all the time now and I might as well share it.
-->Download it here<--

The script saves each top layer in a file to a separate file and can create a batch file that will render all the files as png sequences.

The options:
Image
Save automatic batch file. If this is unchecked the other options won't matter.

Put each render in it's own folder. If unchecked all renders will be put in one folder. Some compositors, like After Effects, can still import them as separate sequences.

Number layers in descending order. All layers will be saved with a number in front so you know what goes where. With this checked it will start numbering layers from the top.

Directory of Anime Studio. Needed for the batch file.

Delete files after render. This will delete the separate .anme files that were created, NOT the original file or the rendered images.

After you've run the script just double click the batch file and the rendering will start.
Image
You won't get any progress, just the time when a new file has started rendering. This doesn't bother me much, I'll just start the render and start working on the next scene while it renders in the background.

Some notes:

-This will only work in Anime Studio Pro 8 on Windows.

-When you run the script it will save the currently open file so don't run it if you don't want to save it like it is right then and there.

-Layers with "_null" anywhere in the name will be skipped. This is pretty specific to my own workflow but it might be good to know.

-It could save to other formats than png but you'd have to edit the script file and replace any occurences of png with the format you want. Since I only use png I haven't bothered making it an option.
User avatar
GCharb
Posts: 2202
Joined: Mon Oct 10, 2005 2:31 am
Location: Saint-Donat, Quebec, Canada
Contact:

Post by GCharb »

I tried a few renders with it, it works fine and I was able to import in afx for composition.

But it is easier for me to export PSD though as they just load in all layers in afx in the right order in one action.

But I can see the usefulness of such a plugin, thanks for sharing! :)
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Yeah, I used to do the psd to after effects thing too but switched to this workflow for the following reasons:

-Much smaller file sizes with Png. Really, the difference is huge.
-A bit easier to replace a layer after making changes.
-I'm using other software than After Effects that don't support layered psd files as comps. (Recently bought HitFilm that has a great 3D particle simulator and other effects)

But like I said, this script is pretty specific for my workflow.
User avatar
GCharb
Posts: 2202
Joined: Mon Oct 10, 2005 2:31 am
Location: Saint-Donat, Quebec, Canada
Contact:

Post by GCharb »

Yeah, PSD can be huge, I might have another go at it, thanks again!
jonnymark
Posts: 1
Joined: Mon Jul 25, 2011 7:05 am

Post by jonnymark »

Render output

After selecting Render > Batch Render, a separate folder is created for each render layer in your images directory. Your render target output is saved to the masterLayer folder if its renderLayer input is either not connected, or connected to the masterLayer (in other words, defaultRenderLayer). If you've connected a different render layer to the render target renderLayer input, then the render target output is saved to the folder for that layer.

Rendered image filename options

Use render tokens to customize the filenames of your render output. Use the <RenderPass> token to add your render target name to the created subfolder or image file name.

For instance, in the example above, using a Filename prefix of <RenderLayer>\<RenderPass>\ will create separate folders for each render layer as well as separate folders for each render pass and the render target. The render target folder is saved to the masterLayer folder.
User avatar
uddhava
Posts: 315
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava »

ponysmasher,

This script looks useful for me as my video editor doesn't recognize PSD layers.
When I try to use it I get this message in the renderer...

Starting...
Rendering "script test_02_Layer 1" at 13:45:45.62 Mon 07/25/2011
The system cannot find the path specified.
Rendering "script test_01_Layer 2" at 13:45:45.65 Mon 07/25/2011
The system cannot find the path specified.

Done rendering at 13:45:45.66 Mon 07/25/2011
Press any key to continue

Any ideas?

uddhava
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

Yeah, it seems AS sometimes forgets which directory it´s currently in and saves the .anme file in the folder where it last saved to. I'll have to do some testing.
It works if you save the file with "save as" and then run the script though.
User avatar
uddhava
Posts: 315
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava »

ponysmasher wrote:Yeah, it seems AS sometimes forgets which directory it´s currently in and saves the .anme file in the folder where it last saved to. I'll have to do some testing.
It works if you save the file with "save as" and then run the script though.
Should I save the file to a certain folder?
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher »

No, just save it to wherever you want.
User avatar
uddhava
Posts: 315
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava »

I forgot to reply to this.

I "saved as" the file, but I still have the same problem mentioned above. Hope I can get this to work could be quite useful.

Thanks, uddhava
User avatar
capricorn33
Posts: 249
Joined: Sun Oct 02, 2005 9:49 am
Location: Finland
Contact:

Post by capricorn33 »

Very good and useful script!

Thanks for sharing, Ponysmasher!
capricorn ( - just call me "cap")
children's tv pro, character animator
User avatar
uddhava
Posts: 315
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava »

Hello,

I have tried this script, but I have not been able to get it to work. I was wondering if any one who has used this with success might be able to help me because it would be a very useful script for me.
Below is my original reply with the problem I have with the script.

Thanks, udd
uddhava wrote:ponysmasher,

This script looks useful for me as my video editor doesn't recognize PSD layers.
When I try to use it I get this message in the renderer...

Starting...
Rendering "script test_02_Layer 1" at 13:45:45.62 Mon 07/25/2011
The system cannot find the path specified.
Rendering "script test_01_Layer 2" at 13:45:45.65 Mon 07/25/2011
The system cannot find the path specified.

Done rendering at 13:45:45.66 Mon 07/25/2011
Press any key to continue

Any ideas?

uddhava
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Post by Stan »

This script seems to be very useful, but the link in the first post is dead. ponysmasher, can you please fix it?
User avatar
neon22
Posts: 51
Joined: Tue Aug 28, 2007 5:41 am
Location: New Zealand

Post by neon22 »

looks like all scripts on that site have gone 404
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Post by ulrik »

Post Reply