How to Animate a Lower Third Template with Expressions in Adobe After Effects | Part 2/3 | Sonja Geracsek | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

How to Animate a Lower Third Template with Expressions in Adobe After Effects | Part 2/3

teacher avatar Sonja Geracsek, Motion Designer | Video Editor

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

13 Lessons (1h 20m)
    • 1. Introduction

      2:24
    • 2. Class Project

      0:43
    • 3. Setting up the Composition

      8:32
    • 4. Left Align Text

      8:43
    • 5. Dynamic Text Alignment & Fixed Value Range

      10:16
    • 6. Moving Subtitle Inside Frame

      7:25
    • 7. Centering Text in Frame

      6:13
    • 8. Dynamic Frame Size & Subtitle Condition

      6:10
    • 9. Dynamic Subtitle Scale When Off

      3:45
    • 10. Dynamic Frame Height

      7:33
    • 11. Turbulent Displace

      9:17
    • 12. Drop Shadow & Essential Properties

      7:25
    • 13. Thank You!

      1:27
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

31

Students

--

Projects

About This Class

Have you ever needed to describe someone or something in your video? Maybe mention their name on screen, what they do, combined with a cool animation?

Perhaps you need some animated graphics for your Premiere Pro video project?

That’s what I am teaching you today!

 

691b4f98.gif

This class is part two of a three-part series on Motion Graphics Templates.

Each class in the series uses the knowledge and outcomes of the previous classes and builds on it.

You can head to part one of this course, if you would like to get a full learning experience and come back here after that.

 

Why You Should Watch

What we are creating in this course is a great addition to class up a YouTube or talking heads video. You will gain a set of branded graphics, to personalise your video marketing and infuse it with a pop of colour.

I will take you through the process of animating a title and subtitle with a frame, adding expressions to create a responsive design and setting up your template in the Essential Graphics Panel for use in Premiere Pro.

 

Who This Class Is For

  1. This class is perfect for intermediate learners.
  2. You might be more at ease with After Effects, if you have used it before but I will take you through everything step by step.
  3. No previous knowledge of creating motion graphics templates or writing expressions is required.
  4. Please download the assets provided in the resources.

What You'll Learn

  • Animating a template
    • You will learn how to take an existing title template and transform it
    • You will adjust expressions to create a lower third
    • You will learn how to keep different templates in the same style
  • Writing expressions
    • You will advance your coding knowledge
    • You will write complex code to create a responsive and modular design
    • You will learn new expressions functions
    • You will learn JavaScript terminology
  • Using the Essential Properties in After Effects
    • You will learn how to use a template composition in After Effects
    • You will be able to change and customise text and other properties in After Effects
    • You will learn the limitations and advantages of using the template in After Effects
    • You will understand the difference between the Essential Graphics Panel and Master Properties
    • You’ll be able to use multiple instances of the same comp in After Effects

 

What You’ll Gain

By the end of this class

  1. You will be able to create and use responsive animation templates in After Effects.
  2. You will be knowledgeable in how to use MOGRTS for your video projects
  3. You will advance your expressions coding skill level.

 

Materials / Resources

You will need Adobe After Effects to complete this class. Please download the assets provided in the resources.

 

Upcoming Classes

There is a bit more to learn about motion graphics templates that I didn’t cover in this class. I wanted to keep it compact and give you a comprehensive overview.

However, if you are interested in learning more about motion graphics templates and how to refine them, join the next class of this series, How to Animate Transitions & Backgrounds in After Effects, where I am covering how to create a looping template and transition slides of the same style as well as alternative expressions techniques to use in the lower third and template designs.

 

Check out part one of this course:

Follow me on social media and be first to hear about upcoming classes and bonuses!

Instagram - Facebook - Twitter - YouTube - Website

  

Further Reading

http://smad.jmu.edu/shen/webtype/lineheight.html

http://smad.jmu.edu/shen/webtype/margin.html

 

Attribution

Meet Your Teacher

Teacher Profile Image

Sonja Geracsek

Motion Designer | Video Editor

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction: Have you ever wanted to describe someone or something in your video? Maybe mentioned the name on screen, what they do, combined with a cool animation. Perhaps you need some graphics for your Premiere Pro Video Project. Hi, I'm Sonya. I'm a motion designer and online teacher, and that's what I am teaching you today. We'll be creating a responsive lower that animation in After Effects, you will be able to customize in Premiere Pro, as well as use inside After Effects. You will be able to bring a professional polish to your video keys. We will go through the process of taking an existing title template and transforming it into a lower third of the same style while learning new and advanced expressions to create a responsive and modular design. No more adjusting the design and animation when you make changes to the text or exporting video files of your graphics to add to your video project, you'll be able to use multiple instances of the same comp in After Effects and make individual changes without impacting the original comp, you will need Adobe After Effects for this class, this class is perfect for intermediate learners. You might be more at ease with After Effects if you have used it before, but I will take you through everything step-by-step. No previous knowledge of creating motion graphics templates of writing expressions is required. Please download the assets provided in the resources. By the end of this class, you will be able to create responsive animation templates in After Effects. You will be knowledgeable in how to use maggots and you will advance the expressions coding skill level. This clause is part 2 of a three-part series on motion graphics templates. Each class in the series uses the knowledge and outcomes of the previous classes and builds on it. You can head to part 1 of this class if you would like to get a full landing experience and come back to Part 2 after that, if you prefer to jump right into this one, make sure to download the assets provided in order to follow this class. What we are creating in this course is a great addition to class up a YouTube or talking heads video. Ready, let's get started. 2. Class Project: Hi, Welcome to my class. Let me tell you about the project assignment you will be tackling today. The project for this class will be to create a modular and responsive motion graphics template. I have created motion graphics templates like these for Adobe Stock, I would like to take you through the process of creating this type of templates step-by-step. For a successful project, you should have an animation created, an aftereffects exported as a video showing different stylistic options of your template. Feel free to use the assets I provided in the project gallery. Please share a video of your project in the project gallery. I would love to see what you come up with. Let's jump into the class. 3. Setting up the Composition: This class is based on the previous part of this class series. If you have taken that class, go ahead and use the project file you created in that class. If you haven't, you can download the assets needed from the resources. Let's import the title template project file. You can go to your folder location and drag it right into your project window. Or you can hit Control I and navigate to your project window and import it that way. I already have a few folders set up here. So I'm going to drag this imported folder into my assets and toggle that closed for now, you can create new folders by going onto the Create New Folder button. And it will immediately give you the option to give this folder and name. You can then hit Enter to stop writing, and you can hit Enter to rename that folder. You can also delete folders. The solids folder is an automatic folder that gets created whenever you create a null object, a solid layer and anything else that after-effects provides that gets automatically saved into the solids. So first things first, I'm going to take this comp and I'm going to duplicate it by hitting Control D and immediately renaming it to lowest Fed because we will be using all of its settings and properties in the Essential Graphics panel that we set up in the last class. And I'm going to drag it over to my pre-comps. You'll also see that you have solids in here, in your assets. These solids are now linked to both of these files. So make sure that you don't delete this template folder. Or if you do want to get rid of it at the end of this class, once you've finished with the entire template, make sure to drag this null to your operating solids folder and don't leave it in here and deleted because I can show you what happens then, because this control null object is that now here if I delete this folder, suddenly my brakes, so make sure to have an eye on that. If you do want to get rid of this template folder, I do want to keep it for now just in case I want to get back to some original settings. If some expression didn't work, I can check with the original expression what I've changed if I made a mistake or anything. So I always like to keep a duplicate of an original that I input into my After Effects project. I'm going to keep that null the, with the hope that I will not forget to pull it over to the if I decide to delete that folder. Now what we're going to do, we're going to drag this composition to create new comp. Then we're going to hit Enter and rename it to main. And I'd like to show you something about what was already set up here. We have these blue bars here, and those are protected regions. If you don't see these, or if you've changed the protected regions or any other markers in a precomp, you can right-click on that layer on the outside of this comp. And you can go to markers and you can update Marcus from source. So if you have a change markers, they can be updated on the layer on a parent composition. Now where we're going in, this is exactly what they are. And I'll show you why we set them up, because we have animation here they are keyframes. On the last keyframe is where we have this protected region where it finishes. And at the end, the animation also has a protected region. And what that does is when we squash this layer, you can see that the layer is getting smaller, but the protective regions stay exactly the same. And that's because we don't want to change the speed or the length of the in and out animation. Just for a second to go back to the composition settings. They are still the same as in the title composition. We are working in a frame rate of 25 frames per second, 1920 by 1080 square pixel aspect ratio. And eight seconds duration and an extra frame just so that when we go to those eight seconds, it actually says eight seconds. I've explained this a little bit in the last class, but I'll just repeat for those who didn't watch that class, the extra frame after the eight seconds is actually its own independent frame. So if I was to end this at eight seconds. And 0 frames, it would appear like this, seven seconds and 24 friends because this last frame where the eight seconds finish, that is that frame that we can't get to. And it has its ugly seven seconds and 24 frames. Look at it doesn't, in this case make a difference. If you doing loops, it does make a difference. But in this case, because we have an in and out animation, that little frame doesn't really make a difference, but I just like seeing the full eight seconds. So that's what I've chosen to do, to add that additional frame just to make that and nice rounded number. Now let's jump into that composition again. And we'll go somewhere where there's no animation, just in the center of the still frame. And we'll click on this control will press P to get the position of this. And right now, because it's the duplicate of the title, all of our texts layers and our frame are still in the center of the screen. And we want them at the lower left corner of the screen because a lower third is generally at the lower left corner. So let's do that. But let's not touch the x. Let's just put that down to 0 and the y, Somewhere around the 830 region. We will be positioning the exposition with an expression. We will align it dynamically in the next lesson. So you don't need to type anything in the 0. And if you are not seeing these guides that I have on my screen, you can go over here at the bottom of the composition screen, choose grid and guide options. And you can open title and action safe, or you can hit the apostrophe on your keyboard. And it's quite important to have these on because we want to stay inside of those guides when we're positioning our Lower. Third. What these title safe guides mean is back in the day when the screens were a little bit more curved and not flat the way they are nowadays. The edges of the frame or the picture would be slightly distorted. So the rule of thumb was to keep text inside the inner frame and keep motion inside of the outer frame so that the viewer wouldn't see important things distorted on the screen. So now we don't have that issue anymore, but it's still a best practices to stick inside of those titled guides. So we're going to try and do that. But right now, the number you type into your why isn't hugely important because we will be playing around with that a little bit later on. But for now, just position it somewhere at the lower left corner of the screen. And next, we will add a left alignment to the exposition. 4. Left Align Text: In order to use our template as a lower third, we need the text to expand away from the edge. Meaning when we are changing the text, we needed to be left aligned. When it's on the left side of the comp, we can add an expression to change that paragraph alignment. Let's first open the essential graphics. I can go into the lower third comp. I can right-click and go to Open Essential Graphics. Here are all the properties that we added in the title template class. So they are all still in here because we duplicated that comp and now we can give it a new name because it's a new comp and new properties essentially. Let's call this lower third. Then we can open the position property on the control layer by hitting P, We can hold Alt and click on the stopwatch to start writing our variable. And first, let's just address what's already in here. Value all hard brackets. So as soon as you start writing hot brackets inside hot brackets, the first set of brackets gets removed. So make sure that you start with a hot bracket. Then we have value 0. The 0 is again in a set of brackets, comma value one, and the one is in hard brackets and it's all closed often hot brackets again. And right now, this doesn't say any more than give me x and y of this property, which is the position property. Now we're going to start changing these values. This is also called an array. And the items inside of the array values, the first value actually starts with the index number 0, and the second value has the index number one. This applies to all values inside of an array. The first index starts with 0 and then continues counting after that, since we will only be targeting the x value. So the first index 0, we can just keep the y value as it is. So just calling whatever y is already set to. And now we're going to add a little bit more of an expression. So let's hit Enter at the start of this statement to add more information to the top, Let's write a variable. And variables can be anything with letters and numbers, without spaces. And I want to target the x size and I want to pick whip that to the slider control that we already have named x size. And how we can do that is by clicking on the pick whip, dragging it over here. And I also want to hold ALT so that this becomes a universalized expression. If I didn't hold Alt, then it would add the name of the slider, which can cause issues if you switching between different languages of After Effects. So to avoid that, I try to always hold ALT when I'm using the pick whip. And then it replaces the slider and the slider name with a little index number. Now, we can take this variable, I can copy pasted and replace that here. Now if you've forgotten what the x size is, it's the width of our frame, of our law. So the frame is a shape layer. The shape layer has a rectangle. And the rectangle size is being linked to the x size and y size sliders on our control layer. And these sliders are calculating the title width plus 2 times padding. So that's what exercises calculating is the width of the text plus the padding. That's the size of our frame. And now we've added that variable to our position property. We can use that value to calculate how far away from the edge we want the lower third to sit. So we've called the control layout, we've called the size slider. And now we actually need to do a little bit more calculation. Make sure that you end your variable statement with a semicolon after you've picked whipped to the slider control. Because our control layer is sitting in the center of our entire title, we actually need to calculate half of the width of our title. So let's add another variable. Let's add x position. But actually I don't want to use this expression x position because as soon as it turns purple, that means it's a reserved term by aftereffects and it can be used in other very specific calculations. So to not confuse, this reserved him, I'm just going to call it x pause equals, and then I'm going to take this previous variable, x size and divide it by two. Again, close it with a semicolon and then replace x size. With x pause and as soon as you start typing, it starts suggesting things. And you can hit the Enter on your keyboard on the numpad to take that suggestion. As soon as you're finished, you can also then hit Enter to close your expression. And now if I click on this frame, you can see that the edge of the frame is exactly at the edge of the screen. That's exactly what I want for now. Obviously, we don't want the frame to be exactly at the edge. You wanted to be a little bit away. So we're going to add a margin, and we already have a margin slider setup on our control layer. So why don't we add that to our calculation as well. So we'll add another variable and that being margin. And we'll pick whip to our effects. And again, I'm holding Alt, closing it with a semicolon. And you might have noticed that when I was clicking to various layers here, this Effects Control window has never disappeared. That's because I've clicked toggled view alloc. And if you can't see this effects controls window at all, you can hit control F5 to make it appear. Oh, actually, sorry. Control 5 was for effects and presets. You can go to Window and then you can open the effects controls for that layer. If you don't have that open already and so that this doesn't disappear every time I change layer, I've toggled the viewer lock. So now it's always that, okay, back to the expression, we have the margin. So now I'm going to add to this calculation plus margin. Now since we linked that margin variable to a slider, we can also change this value to get that frame a little bit further away from the screen, you can see that the subtitle is moving because it's linked to the same margin slider, but that's okay. We'll make changes to the subtitle anyway. So don't worry about that for now. When we change our title now, you'll see that it actually is left aligned. When we're typing, the text is expanding to the right and it's locked to the left side of the screen even though the paragraph settings are actually set to center. But due to this depression with forcing the text to be left aligned when it's on the left side of the screen. Next, we'll modify this expression so it has a fixed position range and dynamically changes the text to fright and alignment when the lower third reaches the right side of the comp. That way, it always writes in the correct direction depending on which side of the screen it is on. 5. Dynamic Text Alignment & Fixed Value Range: Currently, our Lower Third is left aligned. It is also fixed to the left side of the screen. If you try to move the global position slider in the essential graphics panel, you'll notice that you cannot change the value. You can skip this lesson. That is all you want to achieve. But if we want our Lower Third to a fully customizable, we need to be able to move it and we need an option for right alignment as well. So let's level up our previous expression. First, we'll open up the position property by hitting P or by hitting E twice to reveal all expressions on this layer. And we can remove any other layers or properties we don't want to see by hitting Alt Shift and clicking on that property, we want to disappear. We're going to remove the margin from the exposition calculation and we're going to replace the two values in our array. We want to create a clamp expression, which I'll explain in just a minute. But what we want to achieve will create a clamp for the x comma and a clamp for the y. And as soon as I leave this expression screen, after Effects is going to give me an error message because I haven't defined these two variables yet, but we'll do that in just a moment. So what is a clamped function? Let me explain that in a little bit of detail. So for the clamp x, for example, a clamp function has the following. Inside. It's got the property index. The thing that is targeting, it has a minimum value, and it has a maximum value. The clamp function limits the range within which the lower third can be moved and this function can be put on most other properties or layer has to offer. If you want to limit the size of something, if you limit the position, if you want to limit the opacity of something, the clamp function can be applied to all of these. In our case, we want the user of our template to be prevented from moving the lower third outside of the title safe area. And just to note, this function will not work if you're using it inside of After Effects, it will only work if he using the Moghul in Premier Pro. But nevertheless, it will also create a dynamic text alignment that will switch between left and right alignment automatically, depending on where on the screen the lower third is sitting. So that's additional functionality that it provides in our combination of expressions. We've removed the margin from the exposition calculation. Now we've changed the arrays statement. Now, we need to add the value of the margin to the position when the lower third is on the left side and subtract the value when the lower third is on the right side. So we need to add that calculation to the minimum and maximum values. And to make our life easier, we will create sliders for our minimum and maximum values. For the x value, we don't need any sliders, so we can input all of the information. Property index of the x clamp is the x position value. So we can highlight property index if you haven't already go ahead and copy the x clamp variables statement, including the clamp function with all of the values that I've written inside of that highlight the property index. Use the pick whip and guided to your X position property value that will now be replaced with transform.py position index number 0. Now let's go to the second value of this function. And here we want to calculate x position plus margin. So that is whenever the lower third is all the way at the left, this is the minimum position we want it to be in. And the maximum position we want it to be in is the composite with which in my case is 1920 by 1080. But this is fully dynamic and we don't have to change any numbers inside of our expression. I want to use After Effects terms and we can use this calm for that. And it's the width of this comp. So this comp dot width and you can use the suggestions after Effects is giving you for the Reserved terms that it has. Minus x position this time because plus is when we're going to the right minus is when we're going to the left minus margin. And we want to close off that entire variable with a semicolon. You won't see any results just yet because we still need to add the x clamp calculation. And to help us with the minimum and maximum values for that, we'll create some sliders. And since we already have a few slides on here. I'll just grab the margin slider because it doesn't have any expressions on it. With Control D, I'll duplicate it. I'll call it y clamp nin for minimum. And why clamp Max for maximum. And let's put some arbitrary numbers in here, something like 230 is at the top, the minimum, and let's say 850 is the maximum, will adjust those numbers as we go. But now we have those numbers accessible as sliders rather than having to go into the expression and changing those numbers when we change our mind. So now let's add all of that in here. Let's copy the x clamp expression or statement. Let's change this to y. Let's change the 0 to one because now we're targeting the second index, whi, which is one. And now we want to link to those sliders. We could just add that in here by pick whipping directly to the slider. But I think this is a little bit ugly. To have this a little bit cleaner, we can create these variables here, so that entire statement looks a lot cleaner. And we can create a y clamp. Men. I have an issue with spelling. Why clamp Min? And because that already exists as a variable, I can hit Enter on my Num pad keyboard and now we can pick whip to that, holding ALT, closing it with a semicolon. And why clamp max. It's not an R expression yet, so it's not suggesting it. And go to the slider holding all closing with a semicolon. And now instead of having this ugly long, it's not that long in this case, but it can get very, very long. So I always suggest creating variables for your sliders that you're linking to and then using those variables in your statements. And now our x and y clamp is working. Let's test it out. So I cannot go any further, but I can move it left and right. And as you can see, it's now stopping there. No matter how much I pull, it will not go further. And the same will happen with my y. I can pull and pull and it will not go further than 230 and will not go further than 850. So that's absolutely excellent. And if I, during the course of adjusting, want to change the numbers, I can change them here and they will be applied here. They will become the next minimums and maximums. And if aftereffects is giving you any errors, make sure you haven't misspelled anything. I have a habit of doing that. All haven't missed any semi-colons at the end of your statements. And all your statements have the right number of hard and round brackets. Especially when working with variables, it's very easy to misspell a word. And when using it multiple times the expression than cant find the correct variable. Go ahead and try moving your lower third and change the text. You should notice that you can't move the global position past the minimum and maximum values you have set. And that the alignment changes depending on where your text is sitting on screen. Let's check that. Let's put this all the way to the right. And now let's type. And it actually is expanding to the left. We will be playing around with the sizing and position of this Lower Third later. And I don't want to go into the expression to change the minimum and maximum values of the clamp. This is why I have linked those values to the sliders. Next, we'll change the subtitle position so it's below the title and inside of the frame. 6. Moving Subtitle Inside Frame: In part 1 of the class series, you have learned how to dynamically position the subtitle outside of the frame. Now we will learn how to position it inside of the frame, including repositioning the title depending on if the subtitle is turned on or off. Let's go to the control layer and toggle down until we get to why size. The y size is calculating the height of our title frame. And we want to clean this up a little bit. Let's rename title to Title 1 and also title Hide, Title 1, height and everywhere where it says title, we want to add one. Because now we're going to add the subtitle into the calculation which is going to be titled too. You can also distinguish between subtitle, entitle if you'd like, but I'm just gonna go with title one entitled to. Now I'm going to copy this entire thing. Paste that back in. And now I'm going to change everything to Title 2. And I want to link this to the subtitle layer, which in this case is called subtitles. So I could have just renamed this in here and it would have linked to the correct layer. And I'm going to replace every one with the two. And of course, because we are calculating the height, we don't need to change the height here that stays the same for the subtitle as well. We want to be calculating the height of the title and the subtitle. Now in the box calculation, we want to make those changes as well. And we want to add the calculation of the subtitle, so title to height gets added to that. And we need to calculate the line height between the title and the subtitle is well, there needs to be a little bit of spacing. So right now, the title, line-height or the spacing between the frame and the subtitle is calculated with the margin. But we'll change that, will add another slider control by clicking on one of the slightest that doesn't hold an expression, Control D to duplicate that, hit Enter. This is going to be the line height or the lead-in. Let's call it line-height. And now we need to link to that effect control. I'm not using the term lending because it's a reserved term within after-effects and it might mess up with the calculations. I'm creating a new variable called line-height, but letting is what defines the space between two lines of text. So that's living, but I'm calling it line-height. Now, I want to pick what to that and I'm holding Alt, and I want to go to the slider here. And again, I have my effects controls locked by clicking the toggle VO lock so that always visible no matter what layer I click on. Now we want to add that line-height into the calculation as well. As soon as aftereffects start suggesting it, I can hit the Enter on my numpad to take that suggestion. And we can remove this box at the end because the last statement is the one that gets executed. So we don't need to have an additional word of box at the end. So what has happened now is the height of a frame is now taking the height of our subtitle into account. The subtitle, of course, is still outside of the frame, but now it's calculating that size into it. Not much has changed in the terms of the position of the subtitle. So now we're going to fix that. Let's go to, let's toggle this closed and go to the subtitle and it's called the anchor point. By hitting a, you might be able to see that the anchor point is at the top center of the layer. So now I would like to change that to be in the center of the layer. To do that, I need to add layer height divided by two. At that lands the anchor point in the center of this layer. Now let's call the y position, hit P. That gives us both of the Separate Dimensions of the position. In the last class, we separated these dimensions so we could target the y position specifically. Now, let's make some changes here, just like with the box in the last expression, we can remove this to make this a little bit cleaner since the last statement is the one that executes the expression. So we can just remove the y pause since the White House statement does the same thing. So what we no longer need is the title height and the margin and the padding. I'd also like to change subtitle to title two. You can keep it at subtitle if that more understandable to you. But since I've decided okay, let's go with title one entitled to as the naming. I want to make all of my expressions follow the trend of clusters is titled to know, titled to height. And so I want to make sure that I naming is the same throughout all of my expressions. So it's nice and clean. Now we don't have the margin and the padding sliders anymore, but what I would like is the line-height. So let's add that in here. You can also just copy paste the variable from the last expression where we used it in. Or you can just add it in manually. Because the subtitle is parented to our control layer, our control layer acts as the 0. So now the subtitle is calculating from 0, take half of its own height plus line-height, and that's how far away it is from the title because currently I would title is also in the center at 0 at the control layer. So this is how the subtitle is now calculated this far away from the title, or rather actually far away from the control layer. Because if we move the title position, then that's no longer the case. It's no longer linked to the position of the title. It's just calculating from 0 how far down is going to be. You can also now change the line height and you can see the frame is changing size as well as the title. But there's still a few things wrong with it, and we're going to adjust that in the next lesson. Let's position the title dynamically. So both the title and subtitle are in the center of the frame together. 7. Centering Text in Frame: In our title template class, we setup our subtitle with a checkbox control, which we can turn on and off, and the subtitle disappears or is being shown. Now that the subtitle is inside our frame, we need the position of our title to adjust for this change in dynamic. Let's start by calculating the position of the title with a conditional statement, taking the on-off checkbox into account. Let's go into our title. Let's hit P to get the position. Right-click Separate Dimensions because we only want to target the y position, hold Alt and click on the stopwatch to start writing the expression. Now, first thing we want to do, we want to copy paste some of the expression that we already wrote in the subtitle expression. And what we want is this whole top part, the title, the title height and the line-height will make some changes, but at least we don't need to get the entire structure from scratch. So we want to change festival, the title to Title 1. And also targeting the title layer. If you have this changed to subtitled rather than Title one entitled to make those changes accordingly. And then we want to start our conditional statement. And a conditional statement means if this happens, do this, otherwise, do that, and it's an if-else statements. So let's start with if. We want some rounded brackets here at, then some curly brackets, then our first if statement. And that is minus title heights. Title one height divided by 2 semicolon. And aftereffects has helped us to close these curly brackets after the statements. That's great. Then we're going to start our else curly brackets again. If you hit Enter, it should creates the closed curly brackets. And here we're going to write our else condition, which is just 0. And inside of here is we need to define the if, if this happens, do that. So our IF is checkbox. When the checkbox does something, we wanted to do that, we need to add that variable in here. So let's add checkbox equals. Now we have to find that checkbox again. Unfortunately, my toggle viewer has turned itself off, so I'll turn on my toggle viewer, go back to my expression. And now I can pick whip to subtitle on, off checkbox. Always holding Alt and closing that off with a semicolon. Now I'm calling this checkbox now can use that variable in here, checkbox. So when this checkbox equals one and equals has two equals signs because that equals a double equals is a regular equals in calculation. And a single equals just means this variable means this. So if the checkbox equals one, which means if the checkbox is on, we want our title minus half its height up because at the moment, the anchor point is in the center of our title, which sits right on our control layer, which acts as our 0. That means if the subtitle is on, our title needs to be further up so they can both sit in the center of our frame. And at the moment, we're calculating the position of our subtitle based on the control layer, its height, the leading. So let's push the title up by half its height. And when the subtitle is off, we want it to be just at 0, which is our else statement. So let's have a look at that. Let's make the line height smaller. And you can see stuff is happening. The only thing that's now not quite right is that the frame is sizing up in both directions, up and down, even though the subtitle is only moving down. So that's something else we're going to have to fix. Let's make the line height a little bit smaller. And let's test what the title does when we change the font size. It's all good, but there's also some shifting going on. The frame isn't quite CAG calculating the title size correctly. So that's another thing we want to have a look at. Now, let's check what happens when we turn the subtitles on and off. So this is the subtitle on and this is the subtitle off. So now our title jumps to the center of the frame. When the subtitle isn't that, that's great. And as you can see, the frame isn't changing. So that's another thing we want to make, dynamic. If you have any errors in your code, make sure that you have the right amount of curly brackets and round brackets. You have all the semi-colons where they should be. And you using a double equals sign inside of your conditional statement. Normally, you don't need to have the semicolon in your conditional statements, so you can remove those as well. But I like to keep them because they don't really break anything and they make it clear that this statement is complete at that point. Now let's make the frame height dynamic based on the subtitle condition. 8. Dynamic Frame Size & Subtitle Condition: The wire size on our controller calculates the height of our frame. It's based on all the sizes of all the layers inside, which means that subtitle the title and padding, letting and so on, in order for the frame height to take the disappearance of the subtitle into account, we have to add the same conditional statement that calculates the position of the title. So let's title to the Y position. Just toggle open all of your contents here or hit E twice. And then with Shift and Alt, you can get rid of or you don't want to see, to get to the Y position will click into the expression field and just drag with the mouse click and drag. Then copy this conditional statement. And we'll put it in the y size slider control right here. Paste it in there, and now we want to make some changes. So we also need the checkbox control for this to work. So let's get the check box variable as well. Let's add that right underneath the line-height. So now this error shouldn't be appearing anymore because now it knows what it is, but obviously the calculation is wrong. So let's add that. So if the checkbox is on, which means if we see the title, we just want it to be the calculation of our box that we've already put together. So we just want that to be box and then it should be right back where it was. But else, if, if this is gone, then we wanted to be the title one height plus 2 times padding. And now if we turn off our checkbox, you see that the title jumps into the center of our controller and the frame is re-sizing with it. So that's excellent. That's exactly what we want to see if by any chance our subtitle is a longer than our title. First of all, the friend doesn't even take that into account. So that's one thing we need to change. And also, once we've added that calculation that the frame does take the length of the subtitle into account. Once we turn the subtitle off, we'll still take the width of the subtitle into account. So those are two things that we're going to look at. Let's first tackle the width of the subtitle. Let's go into our size slider expression. Let's open that up and we still have this old writing here. I'll just remove the last box and I'll also make some changes to the titling here. I'll just change that to the new naming that we've established so that everything is conforming to each other. And now we want to copy the title. Who as well. You can either duplicate this and rename width to height, or you can duplicate this and rename width to height and make sure that you change the transform scale index to 0 because 0 is x, one is y, and the width is x. So we want this to be 0. Make sure that all of the numbers are correct through out your variables and your expressions. And now we'll add a math.max to our box statement. So let's write our math dot max and will envelop the calculation that we already had in our brackets. And now we're going to say actually the padding is going to be outside of that. That's going to be added to the entire calculation. And now we want to say title one width comma title to width. When it says Wait, not width. So just wanna make sure that everything is spelled correctly. You don't want to have any spelling mistakes here. What this does is the math max function will ensure that the frame or the box outside of our texts will adapt to whatever is larger between the title and the subtitle. Make sure that when you're copying the height variables and changing them to width variables, that you also change the dot width on the source rect at time. So not only should you be changing the variable name, you should also be changing the source record time dot, width, and Transform Scale index number. So make sure you do that. And then we'll be able to change the subtitle width. And as you can see, the frame is changing. And now I can demonstrate why we need to also add something else to the width calculation of the frame. Because if I turn this subtitle off now, the frame is still calculating the width of the subtitle, even though it's off when now the frame should be shrinking down to the title sides. So we're going to add that next. 9. Dynamic Subtitle Scale When Off: In order for our subtitle to stop disrupting the width size of our frame. When it's off, we'll add a conditional statement to the size of it so that when it's off, it's at 0 size. So that way if it's longer than the title, you don't have to remember to remove the texts and the subtitle is just not interfere with the frame. So let's do that. Let's go to our subtitle. Hit S for scale, hit Alt, and click on the stopwatch to start writing our expression. We're going to copy paste the if-else statement from the title by hitting E twice will reveal all of the expressions and we'll grab the checkbox control and the conditional statement or copy paste that into our scale of the subtitle. And now we need to make some changes because obviously this is based on sizes, but actually what we want to do is change this to value. So when the checkbox is one, this is the scale of the subtitle will be 100% and else it will be 0%. But actually that fixes scale of the subtitle to 100. And if sometime down the line, you decide that you want to actually use the scale, maybe link it to a slider to make that customizable, I would recommend not to use a fixed number, but instead say value 0 and value one, which just means the corresponding sizes. So make no changes when the checkbox is on, but for it to be 0 when the checkbox is off. So we're going in with hot brackets and ending the whole thing with hot brackets. And we can remove the semicolon or we can leave it that, you know, whatever speaks to you. I usually like to keep them there just to make sure that this is the end of that line, doesn't interfere with the expression. So now, when we make this longest, signs, make this longer and the frame should react to that. When we turn off the subtitle, the frame is broken because the 0 also need to have two values instead of the separated position on the title, we're just targeting one of the two position values. But if the scale, there is no separation here, so we actually need both values. So we'll do the same thing. We'll add these hard brackets and goals do 0 comma 0. And then this shouldn't give us any issues. Let's have a look. Yeah. It jumps back to the size of the title plus it's padding and everything that we've calculated onto that. So that's already excellent. That's exactly what we want. If you play around with your letting value, you'll notice that the frame resizes from the center up and down. Even though the subtitle is only being pushed downwards, we will need to add an expression to the frame position to as just dynamically when subtitle or letting value change in size. This will also fix the scaling issue of the title. 10. Dynamic Frame Height: So if you play around with the line height, you can see that the frame isn't scaling correctly. We'll add the expression to fix that, and we'll do that by adjusting the position of the frame to allow for the downwards movement, we'll click on the frame layer will hit P to reveal the position and we'll right-click and separate dimensions. Then we're going to target the y position and we're going to grab the variables from the title. So hit P, open up the expression and vocal grab the title height. You can also do that from the subtitle where you have the subtitle variable. And we'll hold Alt to click on the stopwatch, will paste our copy the expression. And just so we don't have to correct any of the naming, I'll copy paste the variables for Subtitle 2 from the subtitle layer. You want to make sure that you're grabbing the height and not the width from any of the previous expressions. We'll also copy paste the line height variable. And now we'll create a y pause variable. And we want to calculate Title 2, height divided by 2, and then minus title one height divided by two plus line height divided by two. Now, what does this expression actually do? It makes sure that when the title is sizing up, the subtitle is always keeping the title and the subtitle in the center of the frame. And when with sizing up, the subtitle is repositioning itself in such a way that again, the title and the subtitle are always in the center of the frame. So right now it just looks like it's growing downwards, but actually it's growing into both directions, but repositioning itself. So the title and the subtitle are always in the center of the frame. That also means it's calculating the line height's change downwards. Because we now have added the position change, we need to add that to our subtitle on off conditional statement, this expression currently breaks the frame position calculation when the subtitle is off. So let's fix that. We'll add a conditional statement to the frame y position as well. Let's copy the existing conditional statement from the title or somewhere else where it's available. And let's keep the slider controls together. This is not necessary, but it makes it look a little bit cleaner. And now, when the checkbox is on, we want this calculation. So we want y pause and the first condition, and we want the title one position. So we'll add another variable here, and we'll call it Title one position. And that's the title 1, this column. And we can write this out or we can use the pick whip for this. And we want to call the transform of the y position. And now you can see why we haven't been using Y position as a variable because this is the case where it's being used. And now we can replace the 0 with title one position. And we have a typo here. So if you are including the title 1, which is this comp layer title one, you don't actually have to rewrite this, so let's remove that. That's why your targeting the layout with this first variable. And this is why we are replacing this comp layer and then the layer name with the variable of that layer. So now everything should work as expected. Let's turn off the subtitle. And now the frame jumps correctly again. Because for the title position, title one position, when the subtitle is off, it doesn't do anymore calculations here. It was still doing some calculations and it didn't take into account that when the subtitle is off, the frame should be indifferent position. Now it's no longer making that calculation is just looking for the position of the title and positioning the frame in exactly that same position. So make sure to all of your layers, the sizing, the scaling, the sliders. And if you don't have any errors, everything should react dynamically to each other now. And if we play this, you may notice that the animation has changed slightly from where we started. I'll just show you the difference between the original, the title animation. We only have that little bit at the end. So let's look at that again. So you can see there's a little bit of a difference in the animation. Let's go back into our Lower Third animation. And you can see that the here is kind of stuck in his position and the frame is doing all the movement. That's because of this position expression on the frame. There is another way to do this where the animation is intact, but some of the expressions needs to be changed. So if you would like to see how that's done, Come follow me to part 3 of this class series, where I show you the trick of changing these expressions. Of course, there is always a toll to be paid, in this case, the animation slightly different. In the other way of doing it. Some of the dynamics will be removed in order to preserve the animation. So there's always a trade-off, but that's essentially it for the expression side of this class. Now let's add a few more final touches to our design. 11. Turbulent Displace: Let's add some final touches, spruce up the look at some new properties to the EGP. And lastly, I will show you how to use this template in After Effects. Let's open up the essential graphics. You can do that by going to Window and then Essential Graphics if you don't have that open already. And let's go to our controller layer toggle that open, get all of the effect here. They're all toggled open. I'll just close them so I can see that better. And then I'll go to line height and I'll drag this slider into my global controls and I'll rename that letting or you can keep it at line-height, whatever you prefer. I'm also going to change the range from 0 to, let's say, 100, so that the slider is in the center, doesn't have to be that way. You can also just choose whatever values you think should be the minimum and maximum. We can do the same thing with all the other sliders. We have. These worms are already in the center. And we have the line thickness that could potentially also be moved to the center, which should be 19, because I don't want the line to be any thinner than 10. That's what I've set as my minimum, but you can change those values. And also you don't have to have the slide in the center just kind of makes it nice that that's the standard and you can go up and down. Now, since a lower Fed is usually not titles, but it's firstName, lastName. Let's change that here. Or you can write John Doe. And the bottom one kid, just be subtitle. And let's change the sizing a little bit, the lower that is in general quite large. It's bring this down to about a 100, and let's bring the subtitle to around 50 maybe. That means we can also change the letting or the line-height depending on what you want to call it. Then we can go for 25 and then I could change the range. I don't have to at this point. Fine. But maybe I want people to have the option to pull this very far away from the title. I just want to give them a limited range. It shouldn't make the value is too slim. So between 10 and 20, that would be too slim. Value range, but something between 0100, that's a predicted value range. Let's bring out the safeguards. If you don't have that already, That's the apostrophe on your keyboard. Or you can click on this Guides menu and choose title and action safe. And let's arrange the global position. Since we've added some minimum and maximum values to this already, we're going to have to go to our clamp Min and max, at least for the y position. Let's just make this very large so that we can actually get the, and let's just move this to our frame right about hits the action safe guideline, which is the outer one. So that's at about 1890. So let's make that, that number for the clamp max. And the clamp, the y column minimum can be a little bit less. Let's see. Let's just bring this all the way down and then we can slide it as far down as we want. About 200 is probably a good position. Let's make that the minimum for the x position. This is where we need to change the margin because that controls how far away from the edge. This is if you wanted to have that option for the Y as well, you could add the expression that we used on the exposition as well, on the Y position and add that margin to that as well. I'll leave that to your discretion. That can be an additional projects for this class to see if you understood the expressions correctly so that you can apply them to your own. Additionally to what we've done. So now this is right at the edge of that guide. Now let's add some looks. Let's add an adjustment layer to this entire design hold Alt Control Y to get an adjustment layer. And let's add a turbulent displace, hit Control 5 to get the Effects and Presets. Search for turbulent displace. Double-click on that. And now let's make some adjustments. Let's also rename this turbulent displace. And let's go into the settings of this. Let's make the amount, strike that down to 25. The size is way too huge. Let's bring that down to like three. And now we have this like tiny little grain. This looks so now it's not this giant wave, but it just adds a little bit of texture to this. And to make it a little bit more interesting so that it's not just a static texture, but I'm moving texture. Let's add a random seed. So let's go back to the controls and let's duplicate one of the slightest that don't have any expressions on them like maybe this one. I'll rename that Posterize Time and bring the value to something like eight in that range. Let's go back to the turbulent displace, and let's toggle this down. So I've hit U twice to get down here. And I want to open and close this turbulent displays that I want to open the evolution options until I get to the random seed. And the reason why I chose posterize time to be eight because that's the length of my AECOM. So if your comp is any other link, choose the number here at the value of the length of your comp. And now we're going to add an expression here. We also want a random seeds. So let's duplicate the posterize time and add random seed as well. And let's make this a really high value, something like 1, 0, 0, 0, 0, 0, 0, 0. Now let's hold Alt and click on the stopwatch on the random seed, and let's start writing an expression. Let's write posterize time. And inside of this, we're going to pick with two our Posterize Time Slider, close that with a semicolon. Then next line, we want a random expression inside of here. We're going to pick whip to the random slider. And I'm going to close that statement with a semicolon. Again, I have an error that's because I'm missing a bracket here, so this bracket isn't closed. So make sure that if you're taking suggestions from aftereffects, he makes sure that all of the right amount of brackets are present. And then when we play this, you can see that there is like a static kind of fuzziness going on. And I really like this look. If you like this look, you can add this look to the title design as well. And you can have a unique cohesive look across all of your animated graphics. You can also bring the random seed down. You can bring the size up. So it's not why it's so ugly. Or you can bring the size down to make the changes for that in, just play around with that to make it look as intense or less intense as you like, the amount will change how many of those you have. Obviously that doesn't, that shouldn't be too high, otherwise, you lose visibility of your text. But you can play around with all of those values. Now let's add one more thing. Let's add a drop shadow. 12. Drop Shadow & Essential Properties: So with the turbulent displace highlighted, Let's go to the Effects and Presets. And let's type drop, which brings us to drop shadow. We can double-click that. Add a drop shadow to this. Let's bring the opacity to 100 and we'll toggle the transparency of our grid so you can actually see the drop shadow right now, it's just pure black. But what we can do, we can bring up the Adobe color themes. And here you can search for colors on the Explore tab. And since we already set up this sort of pastel, a liquid, you don't have to follow at all. But since I have, I'll go back to one of the pastel colors that I've already chosen, and I'll pick one that kind of works with this. So something that's a little darker, probably darker than the front color that makes the background stand out a little bit, something that matches but isn't too aggressive. So just pick your favorites and make sure it goes with the color theme. We can also go back to the doc, but I think I want to stay on this calamity. The PAH polish color would work nicely. And of course, you can also go in and adjust the colors as you like, make it a little darker. Many kids, a little bit less or more saturated. And then you of course, want to add the colors to your EGP. So let's bring the color shadow color. Let's bring that in here. You can put it in the texts controls or you can put it in the global controls, uh, since that isn't a text color, I'll just put it to my global controls. And I also want to bring the opacity in. You can either bring in directly the capacity of your drop shadow and that way it can be turned off or made transparent. Or you can link this capacity to a slider or a checkbox control, and you can turn it on and off that way, however you prefer. Let's go into the main composition that we set up right at the beginning of this class. And let's have a look how we can use this lower third in aftereffects and any template really that you create an aftereffects can also be used as a template and aftereffects not just as a comp that you have to duplicate. So what you want to do is you want to ignore the essential graphics panel. Close that right out because you don't want to touch it if you want to use the comp as a template. So meaning multiple times using the same or different looks without changing the original design. So if you toggle open your layer, you'll find essential properties. You can toggle that open and you'll see all of your properties in here. Some of them might appear differently. For example, if we bring back the essential graphics panel, you can see that for the text, you have all of these photos, size adjustments, font, selection, faux styles, all of that is available here. You can also change the size, style, and font of the text properties. You don't have that option inside of After Effects. If you want to make those changes, you will have to go into the comp and that will make changes throughout all of your templates. But as far as any of the other controls go, all of these available here, you can make changes to the color and all of this sizing options. The clamp will not work inside of After Effects. The clamp function only works in Premier Pro as a moguls. So keep that in mind when you are changing your properties inside of After Effects. And you want to always be using the essential properties in side of here. As I will show you, if I have multiple instances of this comp and I make changes to positioning or sizing or anything. You can see that only this comp is changing, this other comp is staying the same. Well, let me change some of the color like the frame. You can see that these are different than staying and different because we're not changing the original properties inside of this comp with changing only the appearance. This is why we set up the essential graphics panel not only to export it as a mole good for Premiere Pro, but also we have the option to use it as a template inside of After Effects. And this is how you use that. In order to change the text inside of After Effects, you're going to have to create kind of an expression. So you go to your text property, you hold Alt and click on the stopwatch. And then inside of two quotation marks, you can write your text. And this is then how it appears in your lower third. If you don't have the quotation marks, this won't work. So you don't essentially have the same field, the same enter field as you would in your EGP. But this is how you can enter text inside of your After Effects template if you're interested to find out how to use the template as mogul in Premier Pro, the added T of video edits. You can check the previous class where I go into detail. And you can use all of these animated graphics to create cohesive animation and branding across your videos. You can also add any additional properties to the EGP that we haven't added, are ready to find out which Properties you can add users go into your comp and you can click Solo Supported Properties and it will show you all of the properties that you can make available in your template to be changed by the user or yourself in your template. Now we've added everything that I wanted to add in this class. And if you'd like to add more stuff, learn about other ways to create this lower third at some other expressions to bring back the original animation. Come join me in part 3 of this class series. 13. Thank You!: That's the end of our class. Today you learned how to create and use responsive animation templates in aftereffects, add conditions to your expressions and make your animation properties react dynamically to each other. Congrats, well done on completing this class, there is a bit more to learn about motion graphics templates that I didn't cover in this class. I wanted to keep it compact and give you a comprehensive overview. However, if you are interested in learning more about motion graphics templates, how to refine them. Joined the next class of this series, where I'm covering how to create a looping template and transition slides of the same style. I'm glad I could teach you something new. Getting the knack of expressions can be tricky though. Feel free to leave questions and comments in the discussion forum and I'll do my best to help. I'd also appreciated if you could leave a review for this class, it helps me tweak future contents so you get the most out of it. And it also helps other students to see the class. I'm looking forward to seeing your projects in the project gallery using the techniques you've learned in this class, follow me on Instagram, Twitter, and Facebook to get tips and tricks on animation and motion graphics. Check out my live streams on Twitch or YouTube for news about upcoming classes. You can also subscribe to my newsletter. Thank you for taking this class and see you next time.