Skip to content

Here’s a simple little time-saving tip utilising the names of your After Effects compositions…

We’ve recently finished working on the graphics for CBBC’s Max & Harvey FOMO.

The titles of the show involved a lot of screens which were to be filled in later in the process with clips selected by the producers.

Obviously it makes sense to number these so the client can say “Clip X goes in SHOW 1, clip Y in SHOW 2” etc…

A quick tip for this is to make one Placeholder composition and have the text change dynamically to show the name of that composition. Then you just have to duplicate and rename the composition, and let After Effects automatically update the text.

Labelled placeholder Compositions for Max and Harvey: FOMO

To do this just type – thisComp.name – as an expression in the Source Text property of a Text Layer.

Another part of the show involved creating multiple emojis of Max & Harvey. Being identical twins, the emoji animations were identical, except Max has a hat and Harvey doesn’t. The animations were built in a way that this was simply a case of toggling a few layers on or off in each composition.

However with approximately twenty animations of each, this would take some time, and if a tweak had to be made, both animations would need tweaking.

Max and Harvey Emoji

Max and Harvey Emoji

To make this process less complicated, we put a simple script on the layers which needed toggling on or off to depend on whether the composition had Max or Harvey in its name. This meant, the animations only needed doing for Max, then we duplicated them and changed the name to Harvey and they were ready to go.

Here is the expression script to turn on or off a layer’s opacity depending on the name of its parent composition.

cN = (thisComp.name.toLowerCase())

cN.indexOf(“max”) > -1 ? 100:0

The first line converts the name to lowercase and puts it in the variable cN. This allows for some typing errors – ”Max” “MAX” “MAx” etc…

The second checks if “max” exists anywhere in the cN variable (the composition’s name in lowercase).

If it does then the opacity of the layer is set to 100, if not then it is set to 0.

If you want to turn something off, you just swap the 100 and 0 around.

As well as saving time, this also eliminates a monotonous process which nobody enjoys, and leaves more time to spend on perfecting the actual animation.