It’s been a long time coming but I’ve switched over to a blog-style site to make it easier to share what I’m up to and get comments and feedback in general!
Today I thought I would post about After Effects and a couple of scripts that I created during a recent project for BMW. The project included an interactive 360° pan of a BMW car with various labels pulling out different features at different times.
From an animation perspective, not particularly tricky other than the fact that there were ~50 labels that all needed to be positioned and animated. Again, slightly time-consuming but not difficult. However, knowing that the text was likely to change, that the size and weight of the text may change, that labels may be added or removed (affecting the position of all surrounding labels and their animations), I was aware this could quickly turn into a painful exercise. Going through and updating 50 comps, their background sizes etc is never much fun in AE.
So I’d like to introduce you to two AfterEffects Scripts: PopulateCompWithTextFile and AnimateSelectedLayers!
The first script allowed me to create a template for all the labels and then automatically generate all the ones I needed via a text (csv) file. This saved me a great deal of time as when the text was updated I simply ran the script again and hey presto, all done. I also added the ability to resize the background based on the size of the text so that each generated label even had the correctly sized background.
The second script is also pretty handy. It allows you to select a bunch of layers and point to another text file that specifies how to animate all of them.
i.e. I create a text file containing the line:
“opacity”,[ in, in + 1, out - 1, out ], [ 0, 100, 100, 0 ]
…then run the script.
This simple line sets the opacity property of every layer I select to as many values as I specify at whatever times I specify. In this case at the in-point the opacity is set to 0, at the in-point + 1 second the opacity is set to 100 etc. Simply put, run this and every layer will have keyframes added for fading in and out every layer wherever they are on the timline!
I took this a bit further by adding randomness, easing and multi-dimensional properties (e.g. the position property has an X, Y & even Z when in 3D).
Just in case this could ever be useful to anyone or if anybody would like to contribute, I’ve set up a GitHub project here: https://github.com/BoxOfClicks/AEJazz
The scripts aren’t perfect – I’ve even written a basic CSV parser in the code to deal with it all. If anyone would like to take this further or improve on it, I’d love to hear from you. The example AE file is CS5.5 but I should think these scripts will work back a few versions.