Transcripts
1. Welcome: Animation can be time consuming. So anything that cuts out
repetitive tasks is a win. Here's a repetitive task, creating a new shape layer
every time you need a textbox. This class, I'll show
you a better way. You'll learn how to
create a textbox in after effects that automatically
resizes to fit your text. No extra steps required. Need to tweak the text
later. No problem. The box adjusts automatically. You can even animate
the box in two ways, following the text or
moving independently. Once you've built this
auto resizing textbox, I'll guide you through saving it as an after effects preset, so you can reuse it across projects without
starting from scratch. We'll also turn it into a
motion graphics template so you can easily customize it in
after effects or Premiere Pro. I'm Megan Prius, and
I'm an explanimator. I write, illustrate, and
animate educational animations, mostly focused on health
and environmental topics. I've become somewhat
obsessed with creating reusable assets like this because they save
me so much time. This class is perfect
for motion designers or video editors who
are comfortable with the basics
of after effects. If you're new to after effects, I'd suggest checking out one of my beginner classes first. Throughout this
class, I'll explain the what and why behind
making this textbox, so you'll have a solid
understanding of how it works. However, if you're
short on time, you can instead purchase a pre made auto resizing textbox that's all set up
and ready to use. No extra steps required. The link is below, or if you're ready to learn,
then let's get started.
2. Set Up Text Box: I'm starting with
a new composition, and if you want to, you can use the same settings as I am. First, let's create all the
layers that we'll need. So I'll start with text. Make sure that your
text is left justified, and an easy way to access this is with the
properties panel. I'm also just going to center my text with the align tools. Now to create the textbox, make sure that the
text is not selected, and then I'm just
going to go up to the rectangle tool
and double click it, and this will create
a full screen box. I'm going to move this below
and then rename it textbox. The reason that I created
this box by double clicking the shape tool
here instead of just clicking and
dragging to draw out a box around the text is because the transform property for the anchor point is
going to be 00 this way, and the position will be
directly in the center. Also, underneath the rectangle underneath these
transform properties, these position and anchor
points will be zero. And that can be
useful so that things don't get unaligned later on. If you just click and drag
to create a rectangle, then the transform
properties might not be 00. And you can always just
go in and zero them, but I kind of like
doing it by double clicking this shape because
it saves me a couple steps. Next step is to create
an expression control. I'm going to right click
on the rectangle layer, go to effect
Expression Controls, and then layer Control. This should open up the
Effect Controls panel, but if you don't see this,
look under Windows for it. Expression controllers
are properties that don't do anything
on their own, but you can connect them to things so that they're useful. So for this expression control, it's going to allow us to
select which layer the text is. So that's going to be this first layer number one text box. You can also rename expression controls so you
know what they do. So just hit Enter and let's
rename this text layer. Now let's use this expression controller in an expression on the size property
that will update the size of this box based
on the size of the text. Underneath here, you want
to find the size property, and then to start
writing an expression, option or I'll click
the stopwatch. First, we need to
define a few variables. So if you're not super
familiar with expressions, variables are
basically just names for things that
we can use later. So I'm going to do
VAR for variable, and then you make up your
own names for variables. I'm just going to keep this
simple and do S for source. And then that equals, and then I'm going to take the
pick whip here next to the size property and drag it up to this expression
controller. And what that does is
basically just types out for me what I like to think of as the address of this
expression control. And then at the end of each line of code, you need a semicolon. Let's create another variable, and I'm going to name
this W for width. And we want to find the
width of the text layer. So I'm going to do S to use that variable to
get the text layer, and then I'm going to do dot and use a function
called source wrectetT. We can leave the
parentheses blank for now because what we
want is the default. And then I'm going
to arrow over and do dot width, and then semicolon. Then we also need a
variable for the height. So same thing, S
sourcerect at time, and then just dot
height. And semicolon. The last thing to
do here is define the X and Y size
of this rectangle. This is going to be a
list of values X and Y, you always have to define
those in brackets. X is just going to be the
width of the text layer, which is W, and then Y is just going to be the height of
the text layer, which is H. Then when I click out of
this, you can see that the box is now fitting the text. Now let's try changing
what the text says. If I make this text longer, you can see that the
box is updating size, but now the text box and the
text are no longer aligned. And this is because
the text box and the text layer change size
from a different location. When the size property of
the rectangle is changed, it changes from the center. Let's call the point
where the rectangle changes size from
its origin point. You might think that
the origin point would be the anchor point, but that's actually
not the case. There are two anchor
points for a shape layer, one for the entire layer, and one for the shape itself, because a shape layer can have
multiple shapes within it. But as you can see here, if I move the anchor
point for the layer, and then change the size, I still changes size
from the center. And if I move the anchor
point of the shape itself and then change the size, the size is still
changing from the center. So the origin point does
not equal the anchor point. The text layer also
changes size around an invisible origin point and this origin point is based
on its justification. For this left justified text, if I change the size of this
by adjusting the font size, you can see that it changes size from the
bottom left corner. Center justified text will change size from
the bottom center, and right justified text will change size from the
bottom right corner. This also happens to be where the anchor point
is set by default. But if you move the anchor point with the pan behind tool, the text still scales from the original location based
on its justification. Again, origin point does
not equal anchor point. To make this text box work, we need the text
and the text box to change size from
the same location. In other words,
they need to have the same origin point so that they always
stay in lined up. To do this, we can add an expression to the
position property of the rectangle to shift its origin point so that it lines up with the
text origin point. There are multiple position properties for the text layer, but the one that we want
is going to be the one that's underneath
the size property. So this one right here. By adding the
expression to this one, we still have the
freedom to adjust or animate the position
property of the layer. We'll need these same variables that we created for
the size property, so I'm just going to
go in and copy these. And then option, I'll click the stopwatch on the position property and paste these in. We can also use the source
rect at time function to get the left position and top
position of the text layer. So I'm going to do VAR
and then L for left, and then source erect at time, dot left, semicon and then VAR, T for top, S, source
rect at time. Dot top semicon. Now let's define X
and Y in brackets. The rectangle needs
to be shifted over by half the width of the text to move its origin
point to the left. W divided by two. We also need to factor
in the left position of the text by adding
plus L. This way, the box will stay in place, even if the text is not left
justified because it will base its position off the
left edge of the text. Then, and then let's define Y. For y, the rectangle needs to be shifted by half
of the height, so H divided by two, and then we also
need to factor in where the top of
the text layer is, so plus T. And then
if we click out, the text box has shifted, but it's not lined up
with the text still. So what we need to do is parent the text box to the text layer. Then I'm going to go underneath the transform position and anchor point and zero
out these values. And now the text and the
text box are lined up. The reason that this
works is because by parenting the text
box to the text, these values are now relative to the parent,
which is the text. So by zeroing out these values, the box is in the exact
place as the text. You can even see that
the anchor point is lined up with the
anchor point of the text, which also happens to be the
same as the origin point of the text and now the origin
point of the text box. You can see that this is true by changing the
size of the text, and the box stays in line. You can also change
what the text says. And everything still works. You can also change the
justification of the text, and everything still works. Changing the justification
works because of this plus L and plus T. So we factored in the left
and top of the text layer so the box will always stay aligned no matter the
justification of the text. This textbox that we're creating doesn't just have to
be used for text. Here I have just a simple
star shaped layer. I can go into the textbox layer and in the effect controls, change the text layer,
the source layer from the text to the star. Now if I take this box, parent it to the star and
then zero out the position, you can see that the box is
fitting the size of the star.
3. Adjust Appearance: I Right now, the box is
fitting exactly to the text, which is maybe not the
look that you want. So to fix this, one way to
do it would be to go to the Add button on the box
layer and choose offset paths. And this will add this
offset that you can adjust, so it makes the entire
box bigger or smaller. But what if you don't
want as much space on the top and bottom as
you do on the sides? Ofset paths, you don't
really have any options. So instead, let me show you
another way to do this. I'm going to delete
the offset paths, and then I'm going to right
click on the textbox layer. Go to Effect
Expression Controls, and Let's grab a slider control. I'm going to name
this padding width, and then I'm going
to duplicate this one and name this one height. I want to be able
to use these values to add some padding
to the text box. Right now, they're
not connected, so they're not doing anything. So we need to factor
these padding values into the size expression. So I'm going to click into the expression and
create a new variable. Let's call it padding
W for the width. And then I'm going
to pick whip up to the padding width slider
and then semicolon, and then same thing
for the height. Pick whip up to
the padding height slider and then semicolon. And then I'm going
to go into where we define X and Y or width
and height and add plus padding W. And then for the height
plus padding height. You can see that's
already updated, and if I wanted
to further update the padding for
either the height or the width or
both, I can do that. And everything still works if you were to adjust what the text says or adjust the font or the size or
anything like that. You can also adjust the
look of the textbook by doing basically
anything that you could do to any
other shape layer. You could go into the
roundness property and give it rounded corners or
you could add a stroke. You could even hide
the fill if you want this look and one other
optional thing that you can do is that you can add these properties so that all of your controllers
are in the same place. We already have these
controllers for which layer is the text
layer and the padding. But if you wanted to bring
any of these properties, so they're easily
adjustable with all of your other controllers, let
me show you how to do that. What you need to
do, let's say you want to add the
roundness property. I'm going to right click
on the Textbox layer, go to effect
Expression Controls, and then grab a slider control. Let's just name this roundness. And then we need to grab the
roundness property here, take the pick whip and
drag it up to this slider. Now this slider is going to control the
roundness property. You can tell that a layer
is being controlled by an expression or a parent
because its text will turn red. You could also do
this for color. So let's say we want to take this stroke color and add
a controller for it here, you can right click
on the layer, go to effect
expression controls, and then grab a color control, and then pick whip this
color up to this color. You can rename
this stroke color. Doing this step is totally
optional because you can just change all of these properties within the textbox layer itself, and it's especially easy
with the properties panel, but this can be handy to have all of your
controllers in one place.
4. Animate Text: Now, let's animate the text and make sure that the text box still automatically
resizes based on the size of the text. To animate the text, I'm
going to use text animators. So to do that, you
want to toggle open the text layer and
click the animate butt. I'm going to animate
the scale property. That's going to
create a new animator with the scale property and this range selector where I can animate the letters
based on this scale. So I want the scale
here to be zero, and then I'm going to animate
the start value 0-100. So you can see that this
animates the text and the box. I'm not going super in depth into how text animators work in this class because I
have a whole class dedicated to text animators. So definitely check that out if you're interested
in learning more. Let's also animate
this text out. So I'm going to click on this animator and just
rename it by hitting Enter, name it in, and then I'll just duplicate it by hitting Command D. Let's name this one out. And then I'm going
to toggle it open, grab the range selector, and then I'm going to
click the stopwatch to get rid of these keyframes
on the start value, and let's set the start to zero, and let's also set
the end to zero. The text is visible,
and let's go to 2 seconds and
animate this out. To do that, I'm going to
animate the end value 0-100. Now we'll animate
the text out in the opposite way. So now
let's play this back. The text box is resizing
with the size of the text, but there's a couple of
things that are weird. The first is that it starts out with this small
little box here. But the easiest way
to fix this is just going to be to take this
text layer and drag the front back just
one frame so it's not visible at the start and then
it will start with that T. The other thing
that's weird is that the B is a little
bit taller than the T. So you can see that the height of the textbox
changes right here. So to get rid of that, first, let's trim our layers. I'm just going to trim the box and the text layer right here when the
animation finishes. In that way, it'll also solve the weird part at the end
where there was a small box. Then we need to go back into the expression on the size
property of the text box. When we use the source
wrecked at time function, we just left the
parentheses empty and that's because we just wanted the default,
which is time. That means that this
function is going to look at the size of the text layer
at the current time. But that's causing
this weird issue where the B makes the height
of the box change. To fix this issue, it would
be better if we just grab the time of the height when
the box is in the middle. It's not animating in anymore and it's not
yet animating out. It's just in the middle
of this text layer. Let's add that to
this expression. I'm going to click into
the expression and then go after where we define the text layer and create a new variable and
call this midpoint. Midpoint is not something that after effects already
knows what it is, so that's why I'm creating
it as a variable. But one thing that after
effects does know is the point of the layer and
the outpoint of the layer, so the start and
end of the layer. So we can use that to
figure out the midpoint. First, we're going
to need parentheses. And then it's going to be S, defining that text layer, dot and then outpoint. That's going to grab the
end of the layer and then minus s in point. That's going to grab
the start of the layer. So by subtracting those, we get the length of the layer, and then on the outside
of the parentheses, I'm going to do
divided by two to get the center of this layer,
and then semicolon. The reason that we needed
these parentheses is because expressions follow
the order of operations, which you probably learned
about in math class. So it's going to do the subtraction first before dividing because of
the parentheses. Now we need to use
this midpoint variable that we created in
this height variable. So I'm just going to add midpoint in the
parentheses here. It's important that you created this midpoint variable above the height variable
so that you can use the midpoint in
the height variable. Then if you click out of the
expression and play it back, you can see that the
height is not changing, but it's actually just bumping up a little bit right here. That's because we need to add that midpoint to the
position property. I'm just going to copy this
midpoint variable and then go into the position
expression and paste it in and then add in
next to the height, the midpoint, and also in this top variable,
add the midpoint. Now if we play this back,
it looks a lot more smooth. There's one more potential
issue that we need to address, and that is, if your layers don't start at the
start of your timeline, say you don't want them
to come in until later, you can see that the
text is still animating, but the box is just
already there. To demonstrate why
this is happening, you can see that
the animation on the text takes about 15 frames. So if I drag this back
to say ten frames, you can see that
the box is going to start like two thirds
of the way through, and then it will keep animating. While the text is animating in. So something is weird
with how the text box is measuring the timing
of this text layer. So by leaving the parentheses empty in the source
wrect at time function, it's using the default,
which is time, which just means
the current time. But this isn't factoring
in the start of the layer. So that's why we're getting this weird thing where it doesn't completely animate if you're not at the beginning
of the timeline. So what we need to do to
fix this is to go into where the width is defined by source rect at
time dot width. And in these parentheses, we need to factor in the
start time of the layer. So we can do that by doing
time minus st point. And so now you can
see that the box is animating the whole time from the very start of its layer, but the positioning is off. We also need to go back into the position expression and add the same thing for
the width and the left. So time minus I point. Now that we have that in
three different places, the width for the size, the
width for the position, and the left for the position, now everything
should be working no matter where your layers
are on the timeline. You can move them
back. S working or you could even move
them to the start of the timeline and we haven't
messed that up either.
5. Animate Box Independently: If you want the textbox to
animate in with the text, you should already
have what you need and are ready to
save the textbox as a preset or motion
graphics template to make it easy to reuse. But if you want to
animate the text and the box independently, but still make the box automatically fit the
size of the text, I'll show you how to
do that in this video. I'm going to start
by just duplicating this original textbox so I can make another version that
animates independently. And then I'm going to go
in and change the colors just so you can visually see that this is a
different thing. All right, starting from here
with the textbox that we created that
automatically resizes based on the size of the text, let's create a
textbox that animates independently of
the text animation. First, I want to animate this
text in a different way. Right now it already has these
two text animators on it, but I'm just going to
go up to animation, remove all text animators. Then I'm going to create
a new text animator by going to the animate button, and let's do position, and then I'm going to
do add and then scale, both the position and scale. Then I'm going to adjust
the position property so that it starts from lower. Obviously this is moving
the box with the text, and that's not what
I was going for, but this will work
out in a second. I'm also going to set
the scale to zero. Then let's animate this
with the range selector. I'm going to go
into advanced and then choose the
shape to be ramp up, and then I'm going to go to 20 frames and set the
offset to be 100%, so it's all the way animated in and then back at the
start of the timeline, I'll set this to
be negative 100. Let's also set Easlow to 100%. Here's what we have so far.
Let's also animate this out. I'm just going to rename this in and then Command
D to duplicate it, rename this one out,
and then let's go in. Then I'm going to
click the Stopwatch to get rid of the
existing keyframes. I'm also going to go
underneath Advance and change this to ramp down. Then this offset value needs
to start at negative 100, this is visible and then
it'll animate out to 100. I'm just going to hit
you on the keyboard to see all the
keyframes and I just need to drag this back one frame so that it ends like this. Here's what I have so far. You can just call this done and maybe one thing to make it
nicer would be to go to toggle switches modes and then choose next to the
track map for the text, the text box and then turn
the text box back on. That way, the text will only be visible when it's
inside of the box. This is also a nice
looking animation. But again, for this video, I
wanted to show you how you could have the
textbox animate with its own animation
that's different than the text animation.
Let's do that now. First, I need to toggle open the text box layer and go back into those expressions on the size property and on
the position property. We need to update the
expression so that it measures the size of the
text at the midpoint. So I'm just going
to go in and add in these parentheses here for
the width variable, midpoint. And the height already
has the midpoint in there, so that's
going to be good. And then for the position, I need to go in and
do the same thing. And also, let's do
it for the left. Now if I play this
back, you can see that the box is not changing
size when the text changes size because it's taking the measurement of the size
of the text at the midpoint, right in the middle
of this layer. I want to animate
the box scaling in vertically from the top down. But if I were to just go into the scale property underneath
Transform rectangle one, it's going to scale
from the anchor point. When you're adjusting the
size property of the box, it's going to change size
from the origin point. But when you're adjusting the
scale property of the box, it's going to adjust
from the anchor point. The anchor point of this
shape, not the layer, but the shape itself
is right here and that happens to be where
the origin point is too. But we can move this
anchor point so that it scales from a
different location. You could just move this anchor point with the pan behind tool, but if you do that and
change the size of the text, then the anchor point won't be in the right place anymore. We need to dynamically set this anchor point
with expression so that it's always
in the right place no matter the size of the text. I'm just going to undo and
then we're going to set an expression on the transform rectangle one anchor
point property. Since we're going
to need a lot of the same variables that
we've already used, I'm going to go up to
the position expression here and just copy and paste
all of these variables. So option or I'll
click on the Stopwatch for the anchor point and
then paste those in. We'll also need the variables
for the padding so that we can factor that in to get the anchor point
on the very edge. So I'm going to go up to
the size property and just copy these
padding variables. And once you click an expression that's not finished, you're
going to get an error, but you can just ignore it
because we know we're not finished. And then paste those. Then I'm going to define this anchor point in brackets because it's
two values X and Y. So it's going to be the left, so the left edge of the text, and then minus the
padding for the width. But the padding is a total
amount added to the whole box. So on either side, it's
only half of that. Padding divided by two, and then a comma and
then let's define Y. That's going to be
T for the top of the text minus the
padding for the height, and again, divided by two. So now if you click
out of the expression, the box has shifted, but
there's a quick fix for this. You can take the
position that's right underneath this anchor
point both under transform rectangle
one and just parent this position to
this anchor point and that'll put it
right back in place. Doing this on the
anchor point and the position of the shape and not the entire layer
keeps the position of the layer unaffected
or expression free, so you still have
the option to adjust or animate the layer's
position if you want to. Now I can animate
the scale property for the shape and it'll animate from the top because that anchor point is in
the top left corner. You can see it if I zoom
way in, it's right here. I'm just going to set keyframes
for the scale property. Then I'm going to select
them, D F nine to add Easy Es and then go
into the graph editor and just make this graph a
little bit more interesting. I'll make it a
little bit faster at the beginning and then really
ease into its final scale. Then the opposite for
the animation out. Here's what it looks
like. It's also possible to have
the box scale from a different edge or corner
instead of just the top left. So to do that, all you
need to do is go back in and redefine where
the anchor point is. Let's change this to scale
from the bottom right. So I'm going to go back in, and then we can start with
the left side and then add the width of the box so that we get
to the right side, so that'll be plus W. And then instead of
subtracting the padding, we need to push it over
to get to the very edge. So it's going to be plus
padding divided by two. And then to get from
the top to the bottom, it needs to be the
top, plus the height. And then we need to push it
all the way to the edge, including the padding, plus the padding for the
height divided by two. And now if I play this back, you can see that it's
scaling from the bottom. Also, if I just mess
with the scale here, you can see that that also
is scaling from the right. With the same logic,
you can figure out how to scale from
any edge or corner. If you want your text box to
have a stroke but no fill, let me show you a quick tip to make it actually look good. First, I'm just going to turn the eyeball off
to hide the fill, and then let's add a stroke. But just increasing the stroke weight and we can't
see the text, so I'm going to go to
Toggle Switches Modes and then just turn
off the track map. As it is now, when
the textbox scales, the stroke is scaling
to and it looks weird. What you can do to
fix this is take this stroke property and move it outside of this rectangle. The easiest way to do
that is just to drop it on contents and
it'll bring it below. You want the rectangle
one to be here, and then the transform rectangle one where we're animating the scale property is going to happen before the stroke
is applied to this shape. That way, when the box scales, the stroke doesn't scale, it doesn't get squished in a weird way, so it
looks a lot better. But now we have a problem where the text is visible
outside of the box. If you still want
that matted look, then what you need to do is
just duplicate this text box and then go back in and add the fill back and then mat the
text box to this box. Another thing you
could do if you think you might be making adjustments later is that you could
parent this box to this box, and instead of having these properties just be
scaling on their own, you could instead parent them to this box so everything
will stay aligned, and also probably
it's a good idea to give this a name so
you know what it is. Now, the stroke on
this box looks a lot better because it's
not getting squished. If you don't like how this text is on top of the stroked box, you can just bring
this box to the top.
6. Save as Preset: Et's save this textbox as a preset so it can be used in
any after effects project. The nice thing about
presets is that you don't need to import anything
in order to use them. They're just available to use in any project right from the
Effects and Presets panel. I'm on the first textbox that I showed you that animates
in with the text. But whether you save this one or another variation, the
steps are the same. Presets can only
be a single layer. So we'll just be saving
the text box as a preset. But we made it easy
to select which layer the box should align to
with this layer controller. So it will still be easy to use. To save this textbox
layer as a preset, we need to select all parts of the layer that we want
the preset to include. So for this, it's going to be contents because that includes the rectangle and
all the expressions that we wrote to
make it resizing. Then we also want to include the effects because
that includes all of the expression controls
that we set up for padding and
selecting the layer. I'm not going to select the transform properties
because right now the text box is
parented to the text, so the position is 00 if I were to save the transform properties as part
of the preset, it will always put the textbox
in the upper left corner, which is the 00 coordinates. I'm just going to skip selecting the
transform properties. That way, the textbox
will be centered, and then I can select
the text layer that I want and zero it out, which
you'll see in a second. With contents and
effects selected, I'm going to go up to animation
save animation preset. By default, this is
probably going to direct you to save the preset in a folder that Adobe created for you that's called user presets. I'll show you where this is
on your computer in a second. But let's just give this
a name and save it. I'm going to go and
create a new composition and then go into the
Effects and Presets panel, open up animation presets and then user presets and the textbox should
already be there. If you don't see it,
then you can go to this menu and choose
refresh list. To use the preset, you can
just double click on it. Now we need a text layer. And then on the box,
I'm going to go into Effect Controls and then select that text layer
from the drop down. And then I need to take the shape layer,
that's the text box, parent it to the text, and then go into the
position property and set this to zero. And that will align
it with the text. And then if I update the text, you can see that it's working. If you're going to
be using a lot of textboxes and you need them
all to be the same style, it can be worthwhile to save multiple different
versions of your textbox. So for example, say I'm
working with a client and I'll be using the same style of
textbox with the same colors, rounded corners and padding
over and over again. Instead of using the preset I've made and changing
the colors, corners, and padding each
time, I can just make these adjustments once and
save this as another preset. That's going to be a lot faster. You can also save
animations in the preset, just make sure that
the keyframes are part of the selection
when you save the preset. If you want to share your preset with
others on your team, you just need to give
them the dot FFXFle. If you saved it in the
same location that I did, you can find it on your
computer under Documents, Adobe, the current
version of After effects, and then the user
presets folder. They'll need to take
your dot Ffx file and put it in the same
folder on their computer. Then in After effects,
if they go to the Effects and Presets panel
underneath user presets, your preset should come up. If it doesn't go to the menu
and choose refresh list, but you shouldn't
have to restart after effects or
anything like that.
7. Essential Graphics: Awesome. Another way to easily reuse auto resizing textboxes is to save them as motion
graphics templates or Mgurts. Motion Graphics
templates can contain multiple layers of all types and can include animations
and controllers to customize the template
each time it's used. They can be used in after
effects or premiere, this can be a great way to add graphics or custom stylized
text to your video projects. To save your textbox as a
motion graphics template, first, we need to open the
Essential Graphics panel. I like to do that by
just right clicking in an empty area in the timeline
or composition viewer, and then choosing open
and essential graphics. The essential graphics panel is where you assemble
the template. First, we need to
give it a name. And then it can be helpful
to set the poster time, which is just the thumbnail
that you'll see in premiere. Anywhere where it's
visible is good, so I'll just hit
Set Poster Time. The next step is
to drag into here any properties
that we want to be customizable in the template. In effect controls for the expression controls
that we set up. The first one to select the text layer we're actually
not going to need to use in this template
because the template is already going to
include the text layer. But we will want these
padding sliders. You can't actually drag from Effect Controls into
essential graphics, so we need to open these
properties up in the timeline. An easy way to do that is
just to double click on them. Now I can drag the
padding width slider into the Essential Graphics panel and then same thing for
the padding height. The values that you
have set here in the Essential Graphics panel are going to be the default values. I also want the text box and text color to be able
to be customized. I'm going to go into
contents and then find the fill color and just drag the color into
essential graphics. Let's name this box color. When using this
template, I might also want to create a version
that has a stroke. I'm going to drag in the stroke width so that you can change it from
something other than zero. We can just name
this stroke width, and then I'll also
want the stroke color. I also want to have the
option of rounded corners, so I'm going to go into
the rectangle path and drag the roundness
property in. Let's move on to the text. Right now, the text doesn't have a color that we can drag into the Essential
Graphics panel. To add one, you can go to
the animate button and then fill color and
then RGB is good. Then you can change the color and also drag it into
essential graphics. Let's name this text color. I'll also rename
this animator color. It's also going to
be important that we can change what
the text says. In order to do that,
you want to drag in the source text into
essential graphics. I'm just going to
name this text. With text, you also have these additional options if you click the Edit
Properties button. This allows the user of your template to be able
to change the font, change the font size, and do things like make
the text fake bold. Because of the way that
we use expressions to make the textbox resizing, all of these options
will still work, even though they
change the text size. I'm going to enable them all. All the values that you see in the essential graphics panel are going to be the defaults. So you can make any changes that you want to right
from this panel. Another thing that you can do to make this template
a little bit more organized and user friendly
is you can add formatting. The options are
to add a comment, which if you just
want to leave a note or some instructions
on how to use it, comments are good for that,
and you can also add groups. I'm going to add a group, and
let's just name this box. And then I'm just going to
drag all of the properties that have to do with the
text box into this group. I'll create another group for the text and drag everything that has to do with
the text into this group. I'm also just gonna bring the text group above the box group.
8. Essential Properties: Now that the essential
graphics are set up, we can use this as a
template in after effects or export it as a motion graphics template
to use in premiere. Let's first look at how you could use this in after effects. I'm going to create
a new composition. Then I'm going to take
this textbox composition, the one that I set up this
essential graphics for, you can see that that
comp is selected here and I'm going to drag it
into my new composition. Then if you toggle
open this comp, you can see the
essential properties. In here is the text group and the box group that we set up with all of those
properties that we added to the Essential
Graphics panel. Now you could customize or even animate any of
these properties. Let's say I wanted to change the box color and
the text color. And let's change
what the text says. This one's not
quite as intuitive. You need to right click where it says text and choose Edit value. Let's add some rounded corners and also change the
padding for the width. Now if you play this back,
all of the animation is still happening in the exact same way as when we set it up. I notice that even though we've changed a lot of
these properties, if you go back to your
original textbox composition, everything is still
the defaults. This is a great way to create multiple different
versions of a textbox.
9. Responsive Design - Time: Awesome. There's one more thing we can do to add another level of customizability
to this template, and that's to make the
amount of time that this textbox lasts customizable. So to do that, I need to go
back into this textbox comp. And then first, I'm
just going to trim the comp to the
length of the layers. So I'm doing that by
adjusting the work area, and then you can
just right click on the work area and do
trim comp to work area. I'm going to hit
U on the keyboard to see where the keyframes are. I need to know that the
animation in lasts 15 frames, and then I'm going to go to
the start of the timeline and do Control eight
to create a marker. You can also drag markers
out from this button here, and then I'm going to double
click on the marker and set the duration of
this to the length of the animation in 15 frames, and then check protected region. And that's going to create
this area on your timeline. So what this is going to do
is it's going to allow you to extend or shrink the
length of this composition, but it will preserve this area. So it won't mess
with the timing of this area because this is where the animation
is happening. But this whole area in the middle where
nothing is happening, we can adjust the
timing of this, just make it longer
or shorter so that the textbook stays on screen for a longer or
shorter amount of time. You'll also want to add
a protected region to the end of the composition to preserve that animation out. So I'm going to put my playhead where that animation out starts. Control eight to
create a marker. Double click the
marker and then set that protected region for 15 frames and check
protected region. From here, I can go back into my composition where I imported this text layer and then right click on this layer
and do markers, update markers from source. Now you can see those blue protected regions on
this composition. If I drag the end of
this composition, you can see that the blue
region didn't change, so it still is going
to animate in. It's going to stay on screen for a longer amount of time
and then animate out. And then same thing if I were
to drag this to be shorter, it'll just stay on
screen shorter, but the animation
stays the same.
10. Adjust Mogrt in Premiere: Now let's export this as a motion graphics template
to use in premiere. So I'm going to click Export
Motion Graphics Template, and it's gonna want to
save the project first. This is going to export
dot MogRtFle by default, it's probably going
to want to save it in the Local Templates folder, which is fine. You
can save it there. But if you want to
share the MogartFle to share your template
with somebody else, this folder is really hard
to find on your computer. Instead of saving it
here, I like to go in and choose Local Drive
and then hit Browse. I like to save Mogartz
in the same place that Aftereffects
saves its presets. That's going to be in
the Adobe folder and then Premiere and then the
current version of Premiere. In this folder, you can
create a subfolder. For motion graphics templates, and then save the Mger in
here and then hit Okay. In premiere, I just
have a simple sequence, and I'm going to go
into graphics templates and find that Mgre
that I just saved. Next to local templates, I'm going to hit the plus
button and then I'm going to find that folder where
I saved my template. Under Adobe Premiere, latest version and then
motion graphic templates. The moger is in here. You'll need to select
the folder here, not the actual Mgert because this is telling
Premier to look in this folder for
any new Mgurtz and automatically import them. Anytime you save a new
Mger in this folder, Premiere will
automatically import it. Then I'm just going
to hit Choose, and then here's my textbox. A nice thing about
Motion Graphics templates in
Premiere is that all of your templates are always accessible in any
premiere project. You only need to tell Premier
to watch folders once, and then you don't need
to import them again, even if you switch to working
on a different project. From here, just drag the
template into your sequence. To customize this textbox, you want to make
sure it's selected and then go into the
Properties panel. Here are all the properties
that we set up in After ffx. You can go in and
make any changes. The animation still works like we set it up
in After effexs. You can also adjust
the timing of this Mgert even though you can't see those
protected regions, you can still drag
this out to make it longer, so it'll animate in, stay on screen for longer, and then animate
out, or you could do the same thing except
for make it shorter.
11. What's Next: Awesome Now that you've built an auto resizing textbox
and saved your future self the tedious task of animating
textboxes manually, you can apply the skills you've learned to other reusable
motion graphics, including title cards
and lower thirds. To learn more about reusable
motion graphic templates, check out my class Reusable
Motion Graphics for video from Adobe After
Effects to premiere. I'd love to see what you're
using your textboxes for. So please post a
class project or tag me at Animation
Explained on Instagram. If you enjoyed this
class, I'd really appreciate if you left a review. To keep learning, check out the other classes
that I'm teaching. And here are some ways
to connect with me to hear when I have a new
class or tutorial for you. Thanks so much for watching. Until next time.
Happy Animating.