Jan 15, 2014

Change Multiple Comps from a Single Master Composition with Expressions



Okay, here's the scenario, an editor has created promotional material for a few shows. The channel he's working on has specific graphics that I need to make. So, I need to make, for each show, a graphic that shows the name of the show and different versions that say "Tonight at [specific time]", "Next Week", "This Week", "Coming Soon" and so on. Here's how one of them looks:



The problem is there's 6 versions and 4 shows, 24 comps in total. I can't keep rendering, changing text, rendering; it is kinda tiresome and is more prone to mistakes!

This tutorial will take a look at how to set-up your project so all you have to do is change ONE composition and create all 6 variations per show in one go. So technically, I only have to change and render 4 times, as compared to 24.
As always, this technique can be used for anything that requires batch editing and rendering, so adjust it for your specific uses.


First, we need the graphic. You can use your own project, create a random one or download my project file here (CS6 and up). (150KB) You'll need the font Dosis.



Feel free to place your own image in the background.
Go through the project file and get a good idea of what's going on. Of course, you're free to create your own and use it as you follow through.

MASTER!

As always, we need to make a master comp. One comp to rule them all.
Before we proceed, it's important that your comp is in its final state. Make sure your text is aligned, your timings and animations are on point, motion blur is on for the layers that need it etc.

We'll start by renaming the "Frame" comp to "MAIN". We should also drop it into a folder to keep things neat.

We first need to figure out the easiest way to approach this. This step is extremely important.
Since we want to render in batches, we'll need multiple compositions. Each composition should have the title of the show and a time section. The versions needed are:
  • [time]
  • Coming Soon
  • Next Week
  • This Week
  • Tomorrow at [time]
  • Tonight at [time]
Considering the time also needs to be copied through two of the comps, we can use the first [time] comp as the main one and connect everything to it. The bottom two are our main focus here as they are using a reference but with some text before it.
Before we begin, we need to clean up our master comp a little:

This won't do!
So, first we need to name the title layer to "TITLE", and the other text layer to "TIME".

Much better!

First Child

We're going to deal with the tomorrow and tonight comps first.
We'll go to the MAIN comp and change the time from "Tomorrow at 20:30" to "20:30". That's the first [time] comp in the list done!

We can now work on the "Tomorrow" comp. In the project panel, select MAIN and hit Ctrl+D to make a copy of it.


Double-click "Tomorrow" to open it. Make sure you're not editing "MAIN".

Under the text layer, expand the layer and expand the "Text" section to reveal the "Source Text" property. 


We need to tell this property to reference the Source Text of the TIME layer in the MAIN comp. This way when we change the TIME layer in main, we automatically get "Tomorrow at TIME" in this comp. This will be the first expression.

For the reference, we could either pick-whip or type it in manually. I usually type manually (its pretty easy), but if you're not familiar with the syntax pick-whipping will do.
To do this, we need to reposition our panels so that we can see both comps at once. Grab the title of the composition (the panel) and drag it to the bottom section of the blue-overlay that appears...

click to view larger


This will place it right below, which is awfully convenient for the pick-whip. But before we get to that, we need to add something first.

"TOMORROW AT"+

Then pickwhip all the way up to the MAIN's TIME's Source Text to make it:

"TOMORROW AT"+comp("MAIN").layer("TIME").text.sourceText


Looks like there's a space missing between AT and the time. If you look at the expression, it's pretty obvious. There's no part of that code that tells it to separate the two. The easiest way would be to add a space after the "AT", so we finally have this:

"TOMORROW AT "+comp("MAIN").layer("TIME").text.sourceText

We're not done yet. We need to tie the title. This one will be a direct link:

comp("MAIN").layer("TITLE").text.sourceText

And we're done here!


For TONIGHT AT, we'll duplicate the "Tomorrow" composition, rename it as required, and change the expression in the TIME layer. We won't have to touch the TITLE expression as it's still correct.

Second Batch

The second batch are a lot easier than the first and involve some manual work.

Ctrl+D the "Tomorrow" comp and rename it to "Coming Soon".
The TITLE will remain the same, but we should select the "TIME" layer and remove the expression by Alt+clicking on the stopwatch. Change the text of the layer to "COMING SOON", and we're done!

From here on out, it's to duplicate this composition and change the "TIME" layers to what we need them to be. NEXT WEEK, THIS WEEK and so on. Make copies of the "COMING SOON" layer and finish up the project.

I like to add an Underscore at the beginning of Main so it's placed at the top of the tree.

An alternate method would be to change the expression in "TIME" to:

thisComp.name

Which would make the time the same as the title of the composition, but changing the text layers one by one isn't that difficult... right?

Testing

Perhaps the most fun part of this is testing. Select all the comps and double-click to open them. Next, go into the MAIN comp and change the title and time, then go through the comps checking that everything looks okay.


YAAAY! It works great!

Rendering

I need to render the comps to folders named after each show. An easy way to add them is to add the first comp to the render queue, give it a destination and then select and drag the rest underneath. AE will automatically send them to the same folder, and because we named them so conveniently, they'll all have the names of what they represent.

Perhaps the best part is that we can easily give this to the editor, tell him what he needs to change and he can do it himself while we deal with greater graphic issues.

It's a Wrap!

In case you got lost somewhere, you can grab the completed project file here.

Thanks for reading. Don't forget to leave a comment if you found this helpful and share your new workflow with a friend. It helps me make more!

No comments :

Post a Comment