Harry Frank over at graymachine.com wrote a great article with some additional help of Lloyd Alvarez on using external documents with After Effects for text input. This has obvious benefits for anyone that is making a tireless amounts of lower thirds, sports stat boards or projects that require 15 translations (yes I get those). If you want to learn the ins and outs of reading in a file, I suggest visiting the tutorial. However, In my first project using this script I came across two problems.
Problem one – What happens when I move this project to another machine that doesn’t have the same directory structure? What I ended up doing was breaking the file into 3 parts. 1 part Mac OS X directory style, 1 part Windows directory style and 1 part file name. I then calculate the filename to use in one spot, lessining the amount of scripts that have to run. I put these varibles (or text boxes) in a comp entitled “Globals” so that if my file locations change, I won’t have to preform a search and replace on 200 elements. Each time I call the function, it’ll just reference this composition for file location.
Problem two – After adding too many elements, render performance went downhill. At first the script was pretty speedy. But as I got into hundreds (about 250) of text elements to simulate a screen interface, After Effects render time was becoming less than impressive. The solution for this is to create your text layers in a stand alone comp, then use the Time -> Freeze Frame function on a precomposed set. The only back draw to this is if your are trying to do a fly through of all the text elements as making a pre-comp will kill it for you as the 3D gets lost. Otherwise, every time you have a text element reading the text file, After Effects will have to do a calculation and disk read. Trust me, if you have enough elements, it’ll make your machine crawl to its knees.
So since I came across these issues, I’ve created a default start point/demonstration file for future projects that will need external data read into After Effects. Hopefully, you’ll be able to benefit from this as well:
Note: After you download the project sample, you’ll have to setup your global variables composition with the path to the project. In order for the projects to recalculate the paths after you change them, use the menu item “Edit -> Clear” That should force After Effects to re-calculate the script. If that doesn’t work, save your changes, and close the project, then re-open. Now open up the composition “Slow Render” and preform a ram preview which makes AE render time slow, but then compare this with a ram preview of the optimized “Fast Render”. You’ll see the benefits of pre-comping text elements with a freeze frame.
Update: To make things easy, use http://aescripts.com/compsfromspreadsheet/