Comps from Spreadsheet 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 comp with data from your spreadsheet used to update text or replace layers.



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 three different 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 have a text layer named ^date it will receive todays date (great if you're generating slates)
  • 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 are running the script as a dockable panel, there will be two buttons to automatically create either a text or layer 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 the 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. 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 set up more than one composition to receive data, you will need to have a column in your spreadsheet that holds the name of the comp to be used as the base. In the above sample spreadsheet the column 'Core Spot' will be used, so when the script is run, for the first line of data it will create a copy of the comp named "spot 1" to be used for that line.

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).


A word about Commas

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.



Running the Script

compsFromSpreadsheet needs to know which comps in your project have been setup for use with the script.

When you run the script a window will pop up with all the comps in the project in the left column . Double click on the comp names that are to be used to move them to the right "selected comps" column. Click continue when you have added all the comps to be used to the "selected comps" column.

If you only have one comp this window is bypassed.

If you put all your comps in a folder called TEMPLATES the script will bypass this window and assume that the comps in that folder are to be used



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, and a layer with a # will be replaced with the project item named in this 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.



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 "spotA" it is named "spotA_1", next line that uses that comp will name the new comp "spotA_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.



Setting Render Location

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 click the "Render Output Location" button you can select where you want the script to render your comps to.



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!)



Dockable Panels


The script can either be run as a dockable panel or as a traditional script.

If run as a dockable panel, there will be buttons in the panel to create target text or layer objects to be used with the script. Clicking "Run compsFromSpreadsheet" will bring up the comp select window

If the script is run the traditional way (by accessing it through file - scripts), you will be taken to the comp select window immediately, bypassing the window shown here.



Licensing

compsFromSpreadsheet may be downloaded and used free of charge for non commercial use. If it is to be used commercially, the License is $20