CompsFromSpreadsheet for After effects
Get data from your spreadsheet into your After Effects comps automatically

Automated Versioning of your Comps

The compsFromSpreadsheet script allows you to quickly generate copies of your master comps with data from a spreadsheet used to update text or replace layers.

Version 5 available now

Getting Started

Before you can use the script you need to setup one or more template compositions to receive data from your spreadsheet. There are a few ways your template comp can be updated from the spreadsheet
  • Text layers that begin with ^(shift 6) will be able to receive data from the spreadsheet as the text for that layer.
    If you need a line break in a text layer DO NOT put a line break in your spreadsheet cell as this will cause the script to think it is the end of that line of data. Instead use <br> and the script will replace that with a newline in your text layer
  • If you have a text layer named ^date it will receive todays date (great if you're generating slates)
    default format is MM/DD/YYYY. You can switch to a different format by clicking on the settings window.
  • If you have a non-text layer in your comp that begins with #, it will be replaced by the project item named in your spreadsheet
  • If you have a non-text layer in your comp that begins with >, it will be replaced by a file. The script will import a file based on the path in your spreadsheet, then that imported file will replace the layer. If you have the same file referenced more than once in your spreadsheet, the script will only import it once and use that item for every other time the file is referenced
  • If you have a precomp layer in your comp that begins with !, any layer in the precomp setup for compsFromSpreadsheet will be updated from the spreadsheet.
If you are running the script as a dockable panel, there will be buttons to automatically create either a text, layer replace, or import object in the currently selected comp. When you create the layers this way a window will pop up asking for the name of the layer, do not put in the ^ > or # in this window as After Effects will do this for you.

So if you click on the button to create text object and type "title" in the window, After Effects will create a text layer named "^title" in the currently selected comp.



Setting up your Spreadsheet


The first line of your spreadsheet must contain the names for each column. When you run the script it will take each of these column names and and allow you to connect that column with elements in your template comp. If you name the columns the same name as the layers they are going to update, these items will automatically be selected. After you do this the script will go through the spreadsheet line by line, each line of the spreadsheet will become a new copy of one of your template comps, with data from that line of the spreadsheet updating the layers in the template comp copy that were targeted to receive it.

If you have more than one composition in your project, you will need to have a column in your spreadsheet that holds the name of the comp to be used as the base. You should name the column 'comp'.

Before After effects can read your spreadsheet, it needs to be converted into a tab-delimited text file (most spreadsheet programs do this easily). This is a universal text format that will allow After effects to read in your data and organize it by rows and columns.

When you run the script be sure to point it to this newly created text file and not your spreadsheet as After Effects cannot read any spreadsheet format (maybe I should call the script compsFromTabDelimitedTextFile).


Comma Issues

If you have commas in your data, they will probably get stripped. Why? I believe it is a bug in Excel. There are two major types of delimited text documents, tab-delimited (which we are using) and comma delimited text. If using a comma-delimited format, commas are used to separate columns, if there happens to be a comma in your data, the program will need to strip them out prior to saving as they will be falsely interpreted as the end of that column.

If saving as tab-delimited, tabs would likewise need to be stripped out from your data. Commas are fine and should not be removed, as they are NOT a separator. Sadly, Excel still strips out commas, even when you are saving as a Tab-Delimited text file.

To overcome this limitation, if you need a comma in a text field write <c> and the script will replace that with a comma.



Running the Script

When you click the "run compsFromSpreadsheet" button a window will pop up asking you to select your grid file. This is the tab-delimited text file that you created from your spreadsheet. Do not select your actual spreadsheet as the script will not be able to understand it.

Once you select the tab-delimited text file, the script will read the first line of it which needs to contain the names of all the columns. The field init window will pop up to allow you to sync the data in the text file to target layers in your comp.  
 
 
 
 
 
 



Synching Column Data to your Comp


When the script reads the first line of your spreadsheet, it needs you to tell it where the data from each column should go in your comp. The Field Init window opens. Each column name from the first line of the spreadsheet appears with a dropdown box underneath.

The dropdown box links the data from that column in the spreadsheet to elements in your template comps. The dropdown box contains the names of all the layers that were set up earlier to receive data (remember, the text layers that started with ^ will receive the data from this column, layers with a # will be replaced with the project item named in this column, and layers with > will be replaced by files imported from the location specified in the column.)

If a column name is the same as an element name in one of your comps, that will be automatically selected in the dropdown i.e. If you have a column in your spreadsheet "phone" and a text layer in one of your template comps named "^phone", that item will be automatically selected in the dropdown box. If however, your text layer is "^phone number" it will not be selected in the dropdown box.

If you have more than one comp to be used you will need to have a column in your spreadsheet with the name of the comp to be used for that line. Select 'COMP' from the dropdown box of the column that holds comp names, if you only have comp to be used 'COMP' will not appear in the dropdown as the script will already know which comp to use.



Importing Files Via Spreadsheet


You can have layers in your comps be replaced by files that are not in your project.

Any layer that begins with > will be replaced by a file imported from the path specified in your spreadsheet. To get the proper path format of a file click on the "Get File Path" button located in the main compsFromSpreadsheet window. When you click this button a window will pop up asking you to navigate to your file; when you click ok the proper path to this file will appear in a window that you can copy and then paste into your spreadsheet.

When the script runs it will import the file from the location specified in the spreadsheet and replace the layer. If you have the same file more than once in the spreadsheet it will only be imported once, and that copy will be used each time that particular file is referenced.



Naming Comps


The next step you need to tell the script how to name the newly created sequence, and where you want the rendered sequences to go. The default naming convention is line number, so the name of the very first Comp is "2" ( because line 1 holds the column names). and the next comp created is called "3" and so on until it reaches the last line of the spreadsheet.

Alternately you can have the script keep the name of the original template comp and append a number to the end. so the first time the script creates a comp from "TemplateA" it is named "TemplateA_1", next line that uses that comp will name the new comp "TemplateA_2"

Lastly, you can choose to get the name from one of your spreadsheet columns. So if you choose "FROM SPREADSHEET | name" from the dropdown, the comp will get its name from the 'name' column of the spreadsheet.



Render Settings


By default, every comp created by the script will be placed in the render que using the default settings for your render que. It will default to saving the renders in the same directory as your project. If you don't want your new comps put in the render que you can turn this off in the settings.

If you click the "Render Settings" button (on the "field init" window) you can select which render setting and output module to use for the script and where to put the rendered files. If you check the "Remember Settings" box these settings will be used every time tyou run compsFromSpreadsheet; if not checked, these settings will be used in the current run.
 





Settings

The settings button on the main UI panel allows you to change the default symbols the script uses to target layers in your Comps.
You can also set the number of columns that appear in the field init window.
And you can also change render settings from here, or uncheck the "add new comps to render que" to bypas this altogether and just crerate comps.

The date format section allows you to change the defualt date format. The default format is MM/DD/YYYY, you can change the order or have month names used instead of numerical (currently this only has english names for the months. If there is enough interest I will add multi language support in a future release).  
 
 
 
 
 
 
 
 
 



Conclusion

The script will run through your data line by line. For each line it will create a new copy of the template comp, put it in a folder called "compsFromSpreadsheet", update any target layers in that comp with data from the current line, finally, the comp will be placed in the render que using render que defaults and set to render in the same directory as the project (unless you set a different render location in the field init window.

Hit the render button and all your newly created comps will render (go out for a pint while it renders!)



Installing CompsFromSpreadsheet

The compsFromSpreadsheet script is meant to be run as a dockable panel. This means it needs to be saved in “Adobe After Effects CS(your version here)/Support Files/Scripts/ScriptUI Panels/” folder. Save the “compsFromSpreadsheet.jsxbin” file into the “ScriptUI Panels” folder Restart After Effects. Click on the After Effects “Window” menu. Way down at the bottom of the “Window” menu click on “compsFromSpreadsheet”, the compsFromSpreadsheet interface will load onto a new panel. A window will pop up allowing you to enter a license, or run a fully functional demo. In After Effects General Preferences, make sure that "Allow Scripts to Write Files and Access Network" is enabled.





Licensing

You can try a fully functional version of the compsFromSpreadsheet script free for 7 days. After the trial period a license will need to be purchased for $49.99 from aescripts.com/compsfromspreadsheet