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

After Effects save location and ExtendScript

Community Beginner ,
Feb 12, 2014 Feb 12, 2014

Copy link to clipboard

Copied

I am pretty new to After Effects scripting and I'm fairly new to the programming world (1+ years experience).

My question has multiple possible answers I guess, I'm looking for a way to have After Effects save its .aep file into a very specific predetermined location.  The reason I need this is because I'm currently in the process of writing scripts and tools to integrate After Effects and the rest of the Adobe products into our pipeline, so here's the general idea below:

The supervisor sets up a project / sequence / shot folder structure using tools built into the pipeline

The supervisor marks specific shots that will be done in After Effects (or perhaps an entire sequence or project)

The artist now comes in to work on their shot, they set their environment in the pipeline and the pipeline launches After Effects

The pipeline:

  • Creates AE file with a specific name and save location (maybe creates and automatically saves the file into the save location for the first time? Or perhaps it just opens a new folder and tells AE where to put it)
  • Creates compositions in the AE file that correspond directly to the shots being worked on
  • Imports footage / sequences (etc...), that the artist is subscribed to
  • Builds the render queue with the compositions it created
  • Sets the render locations for all of the compositions

The artist now gets to work doing their magic

The artist hits save (cmd+s, ctrl+s, etc...), After Effects saves the project file into the predetermined location under the predetermined name.

The above will only occur on the first time the artist goes to work on the shot.

Now in this setup I will either need scripts to tell After Effects what the name of the new file is going to be and where to save it, or perhaps I need to have the script generate a new AE file and place it in the proper location.  The other idea I had was to just create a blank After Effects file and have the scripts copy that file into the location it needs to go and rename it (this option is an avoid at all costs).

So my question is: is this possible?  Is it possible to have Extendscript directly create a blank AE file and save it into a specific location without user interaction?  Or perhaps simply tell AE where it is going to save the currently open file and what the file's name is going to be?  The idea is more or less that the artist shouldn't be worried about the file structure or where things are going to go, the pipeline is going to handle all of that.

Ideally I need this working on After Effects CS5 and greater, but CS6 and greater is fine too, we are pretty much moving to CS6 anyway.  Also, presently this needs to work on Mac computers, we have OSX 10.6.8 on most of the machines but we are going to be moving to 10.8 any day now, so preferrably it has backwards compatibility with 10.6.8 but not essential.

TOPICS
Scripting

Views

5.3K

Translate

Translate

Report

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

correct answers 1 Correct answer

Advocate , May 12, 2014 May 12, 2014
more particularly the 'skip existing frames' option

Don't believe this is accessible via ExtendScript.

do you have a list somewhere of template names that can be passed into the parser?  Output modules for instance so that I can pick from among them depending on how I need to render out the footage?

OutputModule templates attribute on Pg. 112 of the After Effects CS6 Scripting Guide PDF shows the templates property.

Attribute:

     app.project.renderQueue.item(index).outputModule(index).templates

Desc

...

Votes

Translate

Translate
Advocate ,
Feb 12, 2014 Feb 12, 2014

Copy link to clipboard

Copied

Just a general workflow suggestion. Instead of relying on the user end to create and save files, which inevitably will fall apart at some point. Just human nature for it to. Flip the workflow around where the project files are already created for said artist to dive into and do work. My normal pipeline for AE setups are like this...

1) Create master project file that houses all shot footage loaded and synced to an edit (if one is available), otherwise the clips are sequenced end to end in one master comp.

2) Precomp every shot indiviually into a template setup that you want for your shots (LUT layers, reference clips, whatever...)

3) Now export out those shot precomps as individual AE project files to a central location (ideally a server).

4) Artist can go to central location, open assigned shot, do work, and save file

5) Project Supervisor can then pull rendered outputs from those shot projects into master project for QC and WIP outputs for review.

Since this setup has a central core for all project files, it'll keep things more managable and organized. There also is a script already built that saves comps out to project files as well. http://aescripts.com/save-comp-as-project/

Votes

Translate

Translate

Report

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
Community Beginner ,
Feb 14, 2014 Feb 14, 2014

Copy link to clipboard

Copied

David,

Thank you for your reply, however, this doesn't answer my question.  Perhaps I was being unclear, so allow me to explain further.  The set up we are already striving for is very similar to the one that you described above.  Currently, a lot of our footage work is done using Foundry's Nuke, and our pipeline is configured to handle that.

All the artist needs to do to get started working on a shot in Nuke is set their job, scene, and node (Job = project, scene = sequence + shot, node = comp, maya, houdini, etc...), and then they open Nuke.  The pipeline handles setting all of the environments and creates a Nuke file for the artist to work on, it also checks source footage that they are subscribed to and allows the artist to pull it into their comp when they open Nuke, so literally the artists simply need to set their job, scene, and node and then get to work on their Nuke file.  The pipeline also handles where Nuke renders to.

This is what I'm hoping to do with After Effects and some of the other Adobe products.  But with After Effects it is more effective to create a "master" project file on the sequence level and have that file contain shot comps so that the artist can distributed wanted / needed effects out over multiple shots.  What I need is a way to do this through Extendscript so that the "master" project file can be created and obtain all of the necessary information for the artist when it is first opened by the artist, and every time after this it needs to check the subscriptions for updates.

We also have versioning control built into the pipeline, and our thought is to have a copy of the "master" project file copied into the node level of the pipeline every time a shot is versioned up.

So what I'm looking for is a programmatical way to do this, I'm not concerned with what the artist does once they are in the file, I only want to know how to set up the file initially and get it saving to the correct location because the artist shouldn't have to worry about that.  Most of the artists don't know how to browse the folder structure that the pipeline sets up, and they shouldn't have to worry about it anyway because the pipeline is built to handle that.  The artist simply needs to set the environment and get to work with the appropriate program / application that they will be working out of.

Is there a way to have Extendscript create a blank file and save it to a specific location where the artist will be working out of?  Also, we have a different way for our project supervisor to review shots, After Effects is only a part of the pipeline and one of the programs that we use to complete the work that we need to do, but currently our entire workflow for After Effects is a manual process, and as you stated in your post- "inevitably will fall apart at some point. Just human nature for it to."  So we are trying to automate as much of the process that we can so that the artist can focus on doing what they do best.

I'm hoping for some tips on what Extendscript I should write in order to accomplish saving a project file to a specific location, or creating a blank project file and saving it to a particular location, then when the artist opens it up for the first time the rest of the setup process is completed.  I don't really want to spend money on a script that I will have no use for after I've looked at all the code.

Thanks,

Votes

Translate

Translate

Report

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
Enthusiast ,
Feb 14, 2014 Feb 14, 2014

Copy link to clipboard

Copied

Hi,

I know you mentioned that you don't want to spend money on a script, but some of the scripts that you can purchase are encoded so you cannot examine their source.

In any case, I just wanted to point you to Hyle by Sebastien Lavoie.  I think it may help you to setup a script that can do what you want.   I'm not suggesting this is the solution for you, but it may help you in your search for a solution.

Best,
Arie

Votes

Translate

Translate

Report

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
Advocate ,
Feb 14, 2014 Feb 14, 2014

Copy link to clipboard

Copied

Ah, that makes sense. I was under the impression it was mostly Adobe based. Very different pipeline.

The tasks you mention are scriptable mostly, but may require more non ExtendScript based coding. My knowledge is strong within AE for ExtendScript, but is limited once OS environment gets involved. With that,  ExtendScript executes within the Adobe environment, so it must be running to use any scripting. There is a "Startup" within the "Scripts" folder that will launch scripts on app launch. This may be useful for you to get the process started. Some of the tasks you're looking to do come very close to a script I built in this post here:

http://forums.adobe.com/thread/1388596?tstart=0

Post #15 being the final code that resulted.

Some modification will most likely be needed for you task, like the folder path, maybe a few other lines. Try starting with this and see if it helps.

Votes

Translate

Translate

Report

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
Community Beginner ,
Apr 30, 2014 Apr 30, 2014

Copy link to clipboard

Copied

David,

Thanks for that, it helped with a few other problems that I needed to take care of.  However, I now have some other questions that need to be answered, if you'll humor me for a while longer.  And I'm sorry I didn't reply sooner, I got pulled away from all of this on higher priority projects and I'm only just now getting back to all of this.

I would like to know how to set specific render options through extendscript, more particularly the 'skip existing frames' option that would allow us to render a single file simultaneously across 10 - 15 machines.  And another question I have is: do you have a list somewhere of template names that can be passed into the parser?  Output modules for instance so that I can pick from among them depending on how I need to render out the footage?

Thanks,

-Shaine Berube

P.S. Still didn't get anything as far as opening then saving a new blank file with the scripting, if you have any ideas on what language I should use to accomplish this I would appreciate it.

Also, and I apologize if this offends anyone, but I have to say this is the worst API I have ever worked with by far up to this point in my career, I keep asking myself why they would remove all of the useful functionality that would allow for greater optimization and automation.  I have come to the conclusion that either I'm missing something, or the Adobe suite isn't suitable for large VFX houses because the API is so terrible and doesn't allow the developers the access to automate certain processes and tasks.

Votes

Translate

Translate

Report

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
Advocate ,
May 12, 2014 May 12, 2014

Copy link to clipboard

Copied

more particularly the 'skip existing frames' option

Don't believe this is accessible via ExtendScript.

do you have a list somewhere of template names that can be passed into the parser?  Output modules for instance so that I can pick from among them depending on how I need to render out the footage?

OutputModule templates attribute on Pg. 112 of the After Effects CS6 Scripting Guide PDF shows the templates property.

Attribute:

     app.project.renderQueue.item(index).outputModule(index).templates

Description:

     The names of all output-module templates available in the local installation of After Effects.

Still didn't get anything as far as opening then saving a new blank file with the scripting,

Pg. 121 explains the save method. You just simply feed it a File object.

var myNewFile = new File("~/Desktop/myNewFile.aep");

app.project.save(myNewFile);

I have come to the conclusion that either I'm missing something, or the Adobe suite isn't suitable for large VFX houses because the API is so terrible and doesn't allow the developers the access to automate certain processes and tasks.

Yes ExtendScript does leave much to be desired, the deeper you get into it, but it still is very powerful for a lot of stuff. The only helpful advice I can give for the missing stuff is to request it through their feature request form. At the very least it notifies them of what people want, even if you may not see it for awhile. Adobe - Feature Request/Bug Report Form

Votes

Translate

Translate

Report

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
Community Beginner ,
May 13, 2014 May 13, 2014

Copy link to clipboard

Copied

Thank you David,

The:

Pg. 121 explains the save method. You just simply feed it a File object.
var myNewFile = new File("~/Desktop/myNewFile.aep");
app.project.save(myNewFile);

worked perfectly!  And you've helped out a lot answering questions that the documentation wasn't very clear on.  I appreciate it.

Votes

Translate

Translate

Report

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
Community Beginner ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

LATEST

Hey @David Torno , 

I have a question about the string ("~/Desktop/myNewFile.aep"). Is there a way to replace the Desktop callout with the folder the orginal file was saved in?


So say I have a folder structure that I copy/paste for each new job. Inside the folder template is an AE file that I use at the beginning of each new job. I open that file up and want the new file saved in the same folder I just opened the template file from.

 

How can you reference the folder that you opened the original file in? 

Votes

Translate

Translate

Report

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