Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

execute script with aerender

Explorer ,
Jan 24, 2014 Jan 24, 2014

Hi,

I have a project that Im trying to do an automatic render using aerender.  However I would need to run a script after the composition.  The scripts sets up a bunch of stuff and modify certain properties. 

So I was wondering if there is a way of running the script either through AERender or maybe an expression within AE project before the automatic render?

TOPICS
Scripting
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 28, 2018 Mar 28, 2018
LATEST

Why not use the shell that you are using to start aerender? This is exactly the kind of thing that the command line is for.

So if you're on mac that means (probably) bash, or on windows either cmd, powershell (or even bash these days if you've got the linux subsystem enabled, but I'd bet cash money you don't. Matter of fact, these days powershell runs cross platform too, so you could be using powershell on mac, but once again you're almost certainly not).

In all cases the command line  interpreter will execute everything you type when you hit return, (unless you're inside a conditional or loop or something), so to put multiple commands on one line you use a semicolon to separate the commands, e.g. command1 -options etc; command2 -option etc.

But you can go one better - you can execute the scripts only if the previous command has succesfully completed. To do this in bash (on a mac or windows with bash installed) you'd open a terminal and do:

/Applications/Adobe After Effects/can't remember the full path/aerender -project /path/to/the/project & /path/to/the/script/you/want/to/run

What the "&" does is execute the command after it if the first command completes successfully. If you want the script to run regardless, just use a ; (semicolon) to separate the two commands.

On Windows you go Windows+R and type in powershell (because why would you ever want to use cmd when you've got powershell?) to open up a powershell window. Then you'd go:

& 'C:\Program Files\Adobe\Adobe After Effects CC 2018\Support Files\aerender.exe' -project C:\users\me\path\to\my\project; if ($?){& c:\users\me\path\to\my\scripts.bat}

Same deal, except: the & tells powershell to execute the command that comes next (not strictly necessary) the semicolon separates commands on the same line, and the if ($?){…} means do the stuff inside the braces if the previous command completed successfully.

Pro Tip:

don't do all the typing yourself; that way lies madness. To get the path of say the aerender executable you can either drag the icon for the app into the command line window, or use tab completion. So on mac you type /App<tab> and the shell will fill in /Applications/ then you type Ado<tab> and the shell will fill in Adobe, then Ado<tab> and you get Adobe After Effects 2015 because it hasn't been uninstalled yet, so hit tab again to get Adobe After Effects 2018, and so on. Same same on a PC (except you don't have to get the case right because powershell is case-insensitive).

The command line is powerful. This is just scratching the surface. For example you can use it to start multiple instances of aerender if you want to use multi-core machines effectively, or compress the renders and upload them somewhere, or shut-down to save the planet after all the aerender instances have finshed etc., etc..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines