After Effects: Using The Essential Graphics Panel For Next Level After Effects Templates
Kat
Posted on November 12, 2024
Contents
- Introduction
- Setting Up Your Precomps
- Adding To The Essential Graphics Panel
- Adding A Dropdown Menu
- Advanced Text Options
- Changing Fill Options
- Limitations
- Other Ideas
- Conclusion
Introduction
Creating efficient After Effects templates is incredibly important, especially when passing the projects to clients who may not be as software savvy. In the past, this meant shy-guying layers away out of sight, locking everything down, and hoping they wouldn't be too confused by the concept of opening a precomp.
However, with the addition of the Essential Graphics panel, we can now put all of our template options in one place. And, if we combine this with some helpful expressions - we can create all sorts of options for our users.
Let me show you how I achieve this.
Setting Up Your Precomps
First thing first, design and animate your layout. You will want to get this nailed down first before you version your project (if necessary).
If your project will contain multiple options, for instance a different number of people, I suggest starting with the maximum number and working backwards. I have made this quick example:
Now that I'm happy with my layout, I need to make the rest of my versions, so I end up with this:
It is also important that your project is tidy before you start making your template, otherwise you may have problems down the line. I have separated each of my layouts with a precomp:
And all of my people are inside of their own precomps (with their images inside a further precomp for swapping out images later):
Now that my project is tidy and I'm happy with the animation and layout, I can begin importing information into my Essential Graphics Panel.
Adding To Your Essential Graphics Panel
If it is not already open, open the panel by selecting window
> Essential Graphics
. You will see the panel open. Select your main comp as your primary
composition, and name your template something appropriate.
In the spirit of keeping our template tidy, let's start with making 4 folders to store information for the 4 different speakers. At the bottom of the Essential Graphics panel, selecting Add Formatting
> Add Group
. Name your group, and repeat for all your speakers.
Now we are ready to add our layers. Navigate to the precomp which contains the layers you wish to edit as part of your template. For me, that is Person_01
.
For text layers, open up the layer options until you see Text
> Source Text
. Click and drag the Source Text option into your Person 01
folder in the Essential Graphics panel to add it to your template. At this point, you can rename your text field label if you wish.
For images, such as our display image, click and drag the image into your folder. Since my image is multiple layers, I create 1 more precomp and drag that into my template.
Repeat these steps for all your other precomps.
Once you are done, you can close all other timeline panels except your main composition. To test your template, edit the text in all your layers. You should see them update in your main comp, without having to go into all your individual precomps.
Great! Our text layers all work. But what about our images? To test your images, double click on them in your Essential Graphics panel. This will open up the exact precomp which contains the image. Drag in a new image from your project, then close the precomp. You'll see it updated in your main comp.
I prefer this method as it opens the correct precomp for the user, as opposed to them having to look for it. This is why I make sure my images are precomped nicely. If your images and precomps are correctly sized, the end users should only have to drag and drop assets (although you may also want to make a Photoshop or Canva template to help them scale their images too).
We have our basic template! Now we have to add a way to toggle between the layouts.
Adding A Dropdown Menu
Add a null layer to your composition, and name it "DROPDOWN". In the effects and presets panel, search for the "Dropdown Menu Control". Add it to your new null layer. You'll see it in your effect controls panel like so:
Press the edit button. You'll see another box pop up with 3 items by default in the menu. Add as many items as you need, and rename them to match your template. In my case, I will rename them after the number of people in my layouts.
When you're happy, press ok to close the box. Now we need to connect the menu to the opacity of our precomps. We can do this with some simple expressions.
Effectively, we want to create an expression so After Effects understands "When the 1 person option is selected in the dropdown menu, only display the 1 person precomp." And so on with all our other options.
This is easily achieved with an if
statement inside each precomp's opacity property.
Starting with our 1 person precomp:
if (thisComp.layer("DROPDOWN").effect("Dropdown Menu Control")("Menu") == 1) 100
else 0
If our dropdown menu has its first option selected, the 1 person precomp will be set to 100% opacity. If any other option is selected however, the 1 person precomp will be set to 0% opacity.
We can add this expression to all our other precomps, making sure to change it slightly to target the correct menu option for each layer.
2 people precomp:
if (thisComp.layer("DROPDOWN").effect("Dropdown Menu Control")("Menu") == 2) 100
else 0
3 people precomp:
if (thisComp.layer("DROPDOWN").effect("Dropdown Menu Control")("Menu") == 3) 100
else 0
4 people precomp:
if (thisComp.layer("DROPDOWN").effect("Dropdown Menu Control")("Menu") == 4) 100
else 0
With this, our dropdown menu is ready to test. Drag it to the top of the Essential Graphics panel, outside each of the folders. One by one, select each option, to make sure it is working.
Advanced Text Options
Now that our basic template is in place, we need to consider what other options need to be available for the end user. For instance, if the goal is to prevent the user from going into precomps for text, we should add an option for them to change things like text size. What if our name is too long at the current font size?
I've opted to change the text size across all of my precomps with one slider, so the text size stays consistent across the layout. However, if you want to have separate controls for each speaker, you can do so by repeating the following actions for each precomp separately, instead of inside the main comp.
First, I make a null object in my main comp and name it "FONT SIZE OPTIONS." Here, I add 4 sliders: Name Font Size
, Title Font Size
, Padding
and Position Adjust
. I then lock my effects panel, so I can still access these sliders while I'm inside the other layer precomps.
Next, I head inside my first precomp. Here, I'll add expressions to allow the end user to change the text size of both the name and job layers, as well as the padding between these layers, and the overall position in relation to the display image.
To begin, I turn my attention to the Name layer. To fix the anchor point of this layer, you can use this simple expression:
var copy = thisLayer;
var cWidth = copy.sourceRectAtTime().width;
var cHeight = copy.sourceRectAtTime().height;
var cTop = copy.sourceRectAtTime().top;
var cLeft = copy.sourceRectAtTime().left;
var x = cLeft + cWidth / 2;
var y = cTop;
[x, y]
The expression sourceRectAtTime()
works out the size of a layer at any given time. This means that as the text changes, After Effects is able to recalculate the size of the layer. Using this, we are able to work out the layer's width, height, top and left parameters.
Since I would like my anchor point to sit top-centre, my y coordinate = the layer's sourceRectAtTime().top
value. My x coordinate = the sum of the left and width, divided by 2 to find the middle.
You may have to move your layer back into position after changing the anchor point's location, but once you're done, the anchor point will always sit in the top-centre of the layer, no matter the layer's size.
Speaking of size, we're now ready to add an expression to affect the layer's font size. In the layer's Source Text property, we can use this expression to do so:
textSize = comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Name Font Size")("Slider")
text.sourceText.style.setFontSize(textSize)
First, we reference the slider from our main comp labelled "Name Font Size", so that this layer knows what to look for. Then, we use the sourceText.style
expression to set the font size to match the number on this slider.
Now that the name layer is complete, we can do the same again for the Title text layer. Copy and paste the same expression inside the anchor point property, and the Source Text property, changing the slider effect in the latter to "Title Font Size" so it has its own unique control.
textSize = comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Title Font Size")("Slider")
text.sourceText.style.setFontSize(textSize)
One final trick we need to set up is the position of both of these layers. Ideally, I would like to control the padding between these layers, and the position overall in case this needs a bit of tweaking. We can do this with some simple expressions in the position properties.
First, we can use this inside the Name layer:
y = value[1] + comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Position Adjust")("Slider");
[value[0], y]
To reference the "Position Adjust" slider in our main comp. This simply adds the value of that slider to this layer's position, allowing us to move it up or down.
For the title layer, to ensure the padding changes along with the name font size, we need to be a little more clever. First, parent the title layer to the Name layer. Then, we write this inside the position property:
nameLayer = thisComp.layer("Name Copy 01");
nWidth = nameLayer.sourceRectAtTime().width;
nHeight = nameLayer.sourceRectAtTime().height;
nTop = nameLayer.sourceRectAtTime().top;
nLeft = nameLayer.sourceRectAtTime().left;
padding = nHeight / 1.7;
paddingSlider = comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Padding")("Slider")
paddingNew = padding * paddingSlider;
x = value[0];
y = nTop + nHeight + paddingNew;
[x, y]
First, we create variables to store the data from our name layer's sourceRectAtTime()
values in our Title layer's position property. This will allow us to change position based on the size of the Name layer. Next, we work out our padding. The space between my text = the height of the name layer divided by 1.7. Yours may differ, so feel free to change the number 1.7 for something that is more suitable to your template.
I then reference my main comp slider "Padding", and multiply the value by my padding variable. This will allow me to change the padding value by a percentage, rather than addition, keeping the spacing consistent across text sizes.
Lastly, I establish my x and y values. Since I don't want there to be any adjustment in the x value, I simply keep it value[0]
. The y coordinate however should equal the sum of the name layer's top and height values, plus the variable paddingNew
, the percentage change to our default padding.
Phew! That was a lot of calculations. But after all that, we can return to our main comp and see whether or not it works. Drag each slider into the Essential Graphics panel, and then change the values one by one in order to test them.
It works! Now that we're happy with these, we can go ahead and copy and paste the expressions in the rest of the people precomps. Remember to update the expressions with the correct precomp layer names.
Once you have copied the expressions to all of the precomps, you'll be able to resize them all so they are uniform with adaptive leading between your text layers. Useful when you're handing the template over to someone who may not have a designer's eye!
You can just as easily have the title font size be adaptive based on the name layer size too, as well as the leading. In fact, with hindsight, this is probably what I would want to do to prevent overwhelming the end user with options. Providing the user with just a "Name Font Size" option (and perhaps an "overall position adjustment") would be enough to change everything proportionately!
For an adaptive Title Font size, simply use this expression inside of the Title Source Text property instead:
nameTextSize = comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Name Font Size")("Slider");
textSize = (nameTextSize/15)*9;
textSizeSlider = comp("MAIN COMP").layer("FONT SIZE OPTIONS").effect("Title Font Size")("Slider")
textValue = textSize * textSizeSlider;
text.sourceText.style.setFontSize(textValue)
The ratio between my Name text and Title text in this template is 15:9, which is why I divide the Name Font Size slider by 15, and then multiply it by 9. If your ratio is different, simply change these values to suit your project.
Changing Fill Options
Depending on your template, you may find you need a variety of other options for your template. One of the main ones I encounter is colour options. There are 2 ways which I tackle this in templates.
The first is simple, and allows the user to pick whatever colour they desire. Let's say we would like to change the colour of the circles in my template. Simply navigate to this layer in your project, and add a Fill effect. Then, drag that fill effect into the essential graphics panel.
Then from the main comp, you can change the colour of the circle to any other colour.
This method however may not be suitable for all users. What if the end user doesn't know the colour codes to use for their brand? When colours need to be matched completely, it's best to give the user less options. I achieve this by combining a Color Control effect with another dropdown menu.
Create another null and add a Color Control effect to it. Name it "Font Colour". We will use this to change the colours of all the fonts in our template.
In turn, go into each precomp and add a fill effect to each text layer. Then, inside the fill effect, write an expression referencing the Color Control effect in the main comp:
comp("MAIN COMP").layer("COLOUR CONTROL").effect("FONT COLOUR")("Color")
Do this to every text layer in every precomp. Once you are done, return to the main precomp and create a new dropdown effect. Name it "Colour Dropdown". Edit the dropdown to have as many options as you need colours. In my case, I am creating a purple, pink and black option.
Drag your dropdown menu into your Essential Graphics panel. After this, we can add our expression to our Color Control effect.
After Effects references colour with 4 arguments: Red, Green, Blue and Alpha. So we will need to create variables for each colour we plan to make.
//Purple
r1 = 102 / 255;
g1 = 36 / 255;
b1 = 131 / 255;
//pink
r2 = 240 / 255;
g2 = 82 / 255;
b2 = 118 / 255;
//black
r3 = 0;
g3 = 0;
b3 = 0;
Inside the Color Control effect, I create my RGB variables for each colour. I divide each entry by 255, since this is how After Effects processes colours for expressions.
Once this is done, I need to add a variable for my dropdown menu, and create a final if
statement to connect all the variables to the dropdown menu:
dropdown = thisComp.layer("DROPDOWN").effect("Colour Dropdown")("Menu");
//Purple
r1 = 102 / 255;
g1 = 36 / 255;
b1 = 131 / 255;
//pink
r2 = 240 / 255;
g2 = 82 / 255;
b2 = 118 / 255;
//black
r3 = 0;
g3 = 0;
b3 = 0;
if (dropdown == 1) [r1, g1, b1, 1]
else if (dropdown == 2) [r2, g2, b2, 1]
else [r3, g3, b3, 1]
If the menu has the first option selected, it will display the first colour (in this case, purple). If it has the second selected, it will display the second colour. If any other option is selected, it will display the third colour.
This method is a little more technical, but overall means that the user can never select a colour they are not supposed as part of the template.
Limitations
Of course, it's important to know the limitations of every template. After all, we should remember a template can never be all inclusive - some things we just have to do manually. But understanding why that’s the case goes a long way, and can help you explain to clients and coworkers quality work takes time, and cannot simply be automated.
In terms of the limitations I encountered in my project - sometimes you need to be mindful of using the text animator in conjunction with the fixed anchor point expression. Because of the way sourceRecAtTime
works, you may find your layer moves around while the text animator is in motion. I have gotten around this by duplicating my text layer and doing the following:
Paste the anchor point expression in layer 1. Then, parent layer 2 to layer 1 (without the anchor point expression). Your text animator motion goes on layer 2. Connect the source text property of layer 1 to layer 2, so layer 1's text automatically updates when layer 2's source text is changed. Finally, turn off layer 1 so it is not visible. Layer 1 will constantly be centred and updated with the same text as layer 2 - but layer 2 will have the added bonus of the Text Animator and be moved thanks to the parenting.
One other limitation to consider when making your template is its longevity. No one wants to make a template that is old news before a project is finished (or within a month for those ongoing projects). So it's important to consider the template's functionality. Will you, in the future, need more options than you have right now? If you know this to be the case, you should consider what will be the easiest course of action to update your templates later. Build your projects so that they work for you - not the other way around!
Other Ideas
You can go further with your projects than I did in this article. Here are some ideas:
You can connect data in your project with .csv files for your clients to use and update, should they understand spreadsheets better than After Effects. I've gone through the process in my Kinetic Text project here, for more information on how to achieve this.
Your template may need to change duration length depending on your options. This is something we can accomplish with on and off animations, if
statements, and a slider. You can find examples of how I tackle on and off animations in my linear
and ease
article, and work it out from there.
Conclusion
In conclusion, by deploying the Essential Graphics panel we can create much more responsive, easier to use After Effects templates than ever before.
Did this article help? Do you have any questions? Let me know in the comments.
Posted on November 12, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 12, 2024