After Effects Size Expressions: Dynamic Text, Scaling, Images and Debugging | Edaqa Mortoray | Skillshare

Playback Speed


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

After Effects Size Expressions: Dynamic Text, Scaling, Images and Debugging

teacher avatar Edaqa Mortoray, Programmer, Chef, Writer

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

14 Lessons (52m)
    • 1. Introduction

      0:53
    • 2. A Sizeable Start

      6:54
    • 3. Class Activity

      1:11
    • 4. Adding the Height

      4:23
    • 5. Stroke Size vs Scale

      1:56
    • 6. Changing Scale

      5:29
    • 7. 100% - What?

      5:43
    • 8. ⤖ Text Debug

      4:15
    • 9. ⤖ But what is 50% ?

      3:59
    • 10. ⤖ 100% Again

      3:20
    • 11. Text Size

      4:29
    • 12. Image Scale

      5:11
    • 13. ⤖ Debug Source Size

      2:06
    • 14. Conclusion

      1:41
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

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.

73

Students

--

Projects

About This Class

Templates need lots of size expressions, let's figure them out.

Working with sizes in expressions can be a bit of a challenge. In this class I'll unravel some of the confusing bits about sizing and scaling content. You'll learn how to dynamically size elements, a key aspect to building responsive templates.

Together we'll work through a variety of size concepts:

  • Your friend sourceRectAtTime
  • The difference between Size and Scale
  • Converting between percentage and ratios
  • Working with Text and Images

With this knowledge you'll be able to dynamically link the sizes of items, based on content size, text size, and any scaling.

Have you ever been wondering why we divide and multiple by 100 so often in expressions? I'll explain that do, in the 100% chapters. You'll even learn some techniques to debugging expressions.

----

If you're new to expressions, you may also find my introduction to expressions class helpful.

Also, if you're like me, you're getting a bit lost with all those assets, clips, and folders, check out my friend Sonja's class on being efficient in After Effects.

Meet Your Teacher

Teacher Profile Image

Edaqa Mortoray

Programmer, Chef, Writer

Teacher

Hi, I'm Edaqa, a programmer, writer and chef.

For over 20 years, I've been following a diverse and exciting career path. My journey traces through several countries, filled with great people and culture. I've dedicated my time to numerous startups, and an abundance of side projects.

There's so much I'd like to share with all with you -- from programming to cooking, to the unusual creative endeavours.

I want my classes to give you the confidence you need to succeed, and the curiosity required to make the most of life.

Join me in my continuing adventures.

Recently I wrote a book "What is Programming", a dive into the fascinating profession.

I've also taken up the mantle of food stylist, as I started Edaqa's Kitchen last year. Perhaps soon ... See full profile

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: Hi. I'm a lot more fried today. I want to tell you a little bit of all sizes and after effects. It could be a little bit of confusing topic, especially when dealing with expressions. What are the sizes and where do they come from? I want to run through a variety of things with the old size today. What we have are the sizes of boxes, the difference between size in scale, how to calculate the size, how to constrain the size and figure out the size of text constraining image to a box and some other variety of things, including what's up with the percentage of after effects. So let's work through a whole bunch of examples and see where we can go with this. 2. A Sizeable Start: I can go ahead and start a new project here and start something completely new. Was experiment will do a new composition, and the composition was Take the default to have here 1920 by 10 80 typical size. I do four classes as well. Okay, here, get and zoom in a little bit. But maybe not sleeping like that happens based here. So when we deal with size is the first thing we have is let's just create a rectangle. Let's work with the rectangle size clicked rectangle to just make a rectangle. So I have a rectangle and Scott no filler stroke. So let's give it a fill, something that's easy to see. That not too horrible. And I take off the stroke because that affects the sizing slightly. So we have this rectangle and we can move it around. Now the business cool sizing for making responsive templates. You wanna have one thing that's relative to the size off another thing, So let's go ahead and create another rectangle, and I'm gonna do this in a different shape layer, first of all, so that we can deal with scaling instead. So I didn't do a new shape layer because if you don't do new shape, layer in the credit you shape, it's just gonna create the same shape layer. So that's great. Another one. It doesn't matter what size it is and will change the color of its. We know this is a different one. So now we have two shapes on the screen. Know what we'd like to do in responsive templates? That look this one should have the same size has. That's what and when you're dealing with shape size, a little bit tricky, constant because the shape layer has a size as the components and size of it. The first thing we want to do is one state. Let's let's forget about the stuff inside of it. Let's not resize this rectangle. Let's just scale it. He knows he Actually, this is a good point here. When I click on the shape layer here, you notice it's a but bigger than the actual shape I created. I'm not entirely sure why Aftereffects does this. It just it just does sometimes to create the other shape layer. You know, it's size is closer to the actual thing, and I'm not always clear. Why does this but it's helpful to understand that the shapes inside are not always the same as the shape layer. So what we wanted to want to say this size here, I'll just roughly light it up. That's good enough. I want to make it the same size. Is that one? At least in the wit, first of all. And we can do this with an expression. And when you do this with an expression on scale, the first thing we do is scale, and we're gonna create. Okay, so, scale, If you had a manual, you say, Well, I want to make it big enough. And that points out one thing First, let's change the anchor point of this. We hit. Why put it over to the left here, Roughly. So now when I changed the scale of this, it goes that way. We want it roughly that size. But we don't want to manually calculate this because the size of the other 1 may change. So we want to do is put in expression on scale. So I'm gonna all in click on scale, and that creates an expression, so I'm going to a pick whip to this other layer because somehow it relates to slayer. We get this layer here, and we want to know what size this is. So I'm just gonna let this be the other layer. First of all, this will be the target layer semi quality ends. Okay, Now we want to get the scale of this one. How do we get it to the size of that one? We know layers have wits and stuff, but that's not quite what we want. We want to know the width of this one. Make this bigger. All right. So I can work with the singer's, could return the current value of the ends that otherwise they won't give us airs. I click around trying to make this bigger. So it's firstly we want to do is you want to say, Oh, what's the size of the other one? Okay, so the size the other one is And we want this source right? Because again, when we clicked on this, you know, it's the size of this rectangle is bigger. I only want the size of that thing inside. How big is that? So we can get the size of that by seeing target layer Source wrecked at time, and it needs a Times zero because these things can change. We want to say What size willing, What time? So 1st 1 we're going to hear what Size zero. But we want to relate to this site because we have to know how big we are if we want to scale to ourselves. So we also want our size. So first of all, let's recall this target size, and then we'll say our sites and this will be this layer that source wrecked at time. So this layer refers to our current layer, which is shape layer two, and then we have shape layer one. We re named these as well, so shape layer one. We may want to say rename target shape, so it's clear that renames it in the expression as well. Shape layer to doesn't matter too much, but let's call it resize mint press enter to rename it resized at a big letters. That's okay, so now we have our size, so we're don't worry only about the width, and we know the relationship of the with Turner's hasn't are size. These things are actually rectangles, so size is probably not the right name. So let's call it Target wrecked in our wrecked and the relation of the size. And so the ratio is we will say, Well, how big is that one compared to us? Target rectal with divided by our rectal with Now this is a ratio, their size to our sizes, how much we'd have to scale by to get that ratio. And so what we could do first of all ways and say, well, logically would say ratio. And I'm gonna put two values and ratio here because scale requires two values an X and A Y scale. And let's see what happens first. With that, it's tiny. Now, the reason why it's tiny is because in aftereffects, scale has to be expressed as a percentage. So we're gonna say times 100 times 100. Now, this is a little bit confusing as to why you might do this. And I'm gonna come back to this to explain the percentage is a little bit here. Once we get through this, I will explain expansions because gonna come back on scale as well. So it would explain that was scale also perfect. This is what we want is the basic demonstration of using an expression to make the size of one layer equal to the size of another layer. And if we go into this other layer, we have a rectangle in here. I don't know why we have two rectangles. Let's get ready, everyone. We have a rectangle and it has a path. This path will change the size of it now. So if we change the size of it, you notice that the size the other one changes. And because the anchor points screwed up on this one, it's not gonna be the same size. That's fine, but we could see them both change size, and you may want this effects. 3. Class Activity: in this class and use more of sort of a lecture style. I don't have a really good project that pulls us all together, yet it's kind of a background sort of information thing. But what you can do the project is work through these things with me actually work through each step. Make a practical example that can show what you've learned, make use of it. Each of the techniques I use use them in a project and then show me what you've done. Show me how you calculate the size and fit it in somewhere and how it's helped you. This is all about expression. I am here to teach aftereffects expressions, not the rest of the system. And it wants you to get understanding expressions, how they work, the syntax behind them, the math behind them. In this class, I want to focus on sizes in particular size in expressions, how you deal with size of objects. We're not going to cover everything, and I'll doom or of these classes. So if you have questions, please write them down and please send into me and I'll cover those questions again, even if it requires making another sizes class. That's fine. Some of these concepts may be a bit confusing at first. No parole home aftereffects. It also confused him. So that's OK. All right, so let's get started with sizes. 4. Adding the Height: if we change the height of the thing the way these are linked. So let's unlinked the size and it changed the height. Besides, the other one does not change because we tied it strictly to the width of it. Who wanted height? We could do a height the same way. So let's go do that as well. Let's change the height as well. So we have this ratio of the target with. So it's called us with ratio with and let's do one called ratio heights Target wreck dot heights divided by our wrecked height. This is how big the other one is compared to. Our layer is the ratio between those sizes and the ratio directly relates to scale. So ratio with times 100 then ratio height, times 100 and now we do the exact same size. So we go back to this other shape now and get if we change the width that changes the with . And if we change the heights, it changes the Hyatt. So these two layers have the same size now because we're scaling one to the other now scales one of the ways to do it. You could actually modify the position and size of the rectangle here as well. And that's another option. So let's do another rectangle which positions the size of this one. So you create another shape layer and a re name. This one change size, and I'll rename the other one change scale. We understand the different treatment change scale. Okay, we need to create a rectangle. Here is Well, let's put this one above. I should put it below again as well. A smaller size. We see that scaling. Let's make us something weird like this. It will change the color again. Something else, okay? And I'll change the anchor points to be over to the right. So in size is about the same way, roughly lining up there. Okay. And it changes size differently. This one. So the previous one, we change the scale and we change the scale. It doesn't actually change us as the object inside. Bear with me for a second. Let's do the size first and then get back to why you might want to change the size as opposed to this scale. There's many reasons, but there's some obvious ones, too. So now we have this rectangle we wanted to be the same size as the other one. So it has a rectangle path in the size and you can also change the size with an expression . And so we're gonna do the exact same thing. We're gonna go over target shape and see there, and we want to say target rigs. Source wrecked at a time. No one there. Now, we don't need a ratio now, because we're not gonna skill that we're gonna directly center sides of this thing is we can actually directly say what we want. Target wrecked up with and target wreck daughter height. Okay, Now two things happen here we are the right size now, but you know, it's removed. So now we have to change the anchor points. And when you animate these things and you move, these things actually had to change. Um, OK, I make a new class dedicated to positioning and anchor points and how you move these things around. I don't like how some of its handled, but you're definitely gonna have to deal with this stuff. And knowing how to do this size is very important, because you're also gonna have to change the anchor point based the size of you Do it this way. If you notice we change the scale, you didn't have to deal with it. That's one advantage using scale. You don't really have to change the anchor point. We could change the actual size of the objects. You have to deal with the anchor point. So now we have these two objects. This one's actually resized the size of the actual rectangle changes, and the other one here is actually scaled. So if we go to our target shape now or a target shape, we change the size it again. Both of them will change size gay and same with the width. Now the different anchor points in the top or the middle one. That's okay. So we have these things. They both change size accordingly. 5. Stroke Size vs Scale: So I already mentioned one of the problems of changing that actual size. The shape who's dealing with anchor points and one of the values a scale is You don't have to deal with that. But why might you also want to change the size? So let's put a stroke on these A set so anywhere. This one here and I just had a stroke on this shape. I'm even quite bright to see it. They can make it red, so it's very obvious, and it make it quite wide, quite wide. Let's make it clear. 40 42nd. Make them both the same size And we did the same on this one here would take the contents here. We're gonna put a stroke on this as well. Read. You could make the size of 40 right, so you can immediately see the difference in these strokes. This hasn't even stroke size the same side around all the shape. This is quite often what we want. We want to have a consistent stroke. Where is this one? The stroke has been deformed, and this is because we're scaling it. So let's take a look at that again. If we go back to that transform of this one. The change in scale one. And we take off the scale from home. We just turn off the expression you can click on this little equals. Turn it off and I'm gonna move it up slightly so you could see it. This is the correct stroke here. When it's not scaled, it has the 40 pixels stroke. When we do scale it, it stretches the wall thing because it shrunk vertically. The stroke vertically is now smaller. And because we stretched horizontally, this horizontal stroke is now larger. Whether you want this or not depends on your animation. Big differences between using scale and actually changing the size of the contents inside of the thing. 6. Changing Scale: now it promising to get back to percentage thing. But one more thing. First, what happens if somebody comes along and changes the scale of this one here? When take this closes old off, going to the transform and say, Well, there's 100%. What if I make this bigger? Well, interesting. The skill, besides the other ones, doesn't change. Doesn't change it all. But that doesn't seem right. First off, let's move the anchor point. That's why I put it in the middle of the things that change on us. Yep, so now we scale against stays there. We want the other ones to change size based on the scale as well. Possibly. So. How do we do that? There are some other ways of doing this, I assure you the most straightforward, because it's really helpful in a lot of templates to just directly read the scale off this object. Let's change scale of it first, so let's just reduce the scale of it. So we have something to work with. Swing no, for expressions working. Then we go off to the change scale. One in here we say what we have this target layer and this target layer also has a scale with it and serve in read target Scale equals target layered on transform dot scale. Then we have the target rectal puts in spacing here. It's good to have spaces differentiated. So now somehow we have to incorporate this scale into our code. Now what I'm first gonna do is I end you scale percent. And this is where you get into a layer wire. Do this because what I really want is I want to say target scale target scales euro divided by 100 targets feel one divided by 100. So first off, the scale has two components the X in the wine. That's why broken into cu two components here and I'm gonna divide them both by 100 divided into components were using his square brackets. And this is a way of breaking things up to the square brackets. I haven't X comma at their value. If I want to look at the target scale, I also use of square brackets still get something inside of it. So it zero here is Euro is the first component, which is the X and one is the second component, which is the wine if you're wondering y zero unwanted. Not wanted to consider these offsets as opposed to indexes, so it's like offset like along the time line. If you want to write a start, it's an offset of zero. The same thing applies here. It's an offset zero from the start of his value. And that's where the X is and we divide by 100 because scale in a adobe aftereffects is given to us in the same way we see any y as a percentage, it has the percentage Judit Now percentage literally means divided by 100 and I will get back to us. Explain this a bit clear but for now, what we want is we want that in the same thing is the ratio. So our ratios air not expressed 100 there in a ratio of like one to want to be 100%. And so we need to convert this to target scales now in the same unit as these ratios. And this is why also. Then we convert back 200 ganna get more That the key thing here Now we have this target scale. We know how big the target object is. in scale. We have a source wreck and its scale, and we can apply this to a ratio. So times target scale zero the ratio width. Now we consider the scaling off X off that targets and for the ratio heights, we need the Y scale target scale one which is the y scale and click out of here. Oh, I haven't Here. I made a small air targets scale percent interrogate scale percent. So now when I click out of here now, what's the status? We've considered the scale as well. So I go back down here and I changed the scale of source objects will scale it accordingly . So that's how we did it. We have that scale. And so I got a copy this little bit here, and we're gonna do the same thing, changing the size. We could put it the scale here. But I want the size cause I want to keep the stroke to be the right size. So now we have that target Rex, make us a little bit bigger, and we have to adjust by the scale. And so this case, I'm not multiplying back by 100 this will get back to again. So we have the ratio. We say target scale. This is the ratio of the scale. The other one has teargas scale One. Now we're the same size and you notice that our stroke remains the constant whipped again, the advantage of mental, of changing our size as opposed to our scale. And so both of these allow us to change the scale that way. So now when we adjust the scale, they all adjusted scale. Additionally, when we go into the contents here, we can also adjust the size and that will also change the size of it. And they all change accordingly so we could modify the sky or size and the sizes are all relative to each other. 7. 100% - What?: So that's the first part thing. So I want to create a new composition and I want to go back. The idea of what's with this 100%? One. Is this quite a new composition? And let's deal with this 100%. Things will create text text over here. What's with this 100% issue? Okay, I still up there, So? So we're talking about scale. We're talking about percent something for percent. Something's not. We had to divide by 100 in that other code. We look at the change size again. We had to defy the scale by 100 the multiplied by 100 out to get this scale. Now, let's do a more basic case about that and try to explain a little bit more about why we have to do this. So I'm gonna create another objects here, and I will get rid of the stroke on this one. So we have this one. This is a big object, and we want to create another object where we have the scale of it. So all this going, I duplicate this shape layer control the There we go. If you appreciate player, let's move this one down right there. And now I want to change the anchor point of this one to be left here. Here you go. We're not gonna change a scale that will make that relative to this one. And we go down to transform its scale. Disconnect him. We just work with the X axis season. We see the scale, we could change the scale of it, and 50% had 50% where half the size of the one above its half. Now, this is a good starting point. Half the size. Well, what is half? Half A 0.5. And so this is the ratio of the size. You know, In the last one, we dealt with ratios and there's also percentages. Now, half is the ratio that applies to percentage. Also 1 to 2 or to the one, depending a look. These are all very similar values. And so first off, let's take this one and move this one up again. Came with a straight up. But now here we go. Okay. And duplicated again. Let's say I want this 50%. But how else can I express this? 50%. So we go down to scale here and I can't remember. Why can't separate dimension separate dimensions of the great here? I don't know how so and all clicking you modify the scale and we could take both values. Put this down now, he said the ratio It was 1/2 where the value is what we want half the size. So we have this ratio And how do you transform a ratio to scale? So you say, Well, we know the ratios times 100. This chamber is a ratio to a percentage, so we have 1/2 times 100 becomes 50%. This is just basic math. There's no trickery here involved. I don't want to modify why, So I can take the existing value and say why of it? And that's the existing value of why. So I don't touch that. It remains 100. Now. You notice we have the same size because of that scale, and I will remove the expression for a second and reset this. So this is a size it would be if I enable the expression it goes toe half because we're using the ratio. Is your 0.5 now you might be saying, Well, that's not quite the ratio I'm used to you. So you say. Well, I can express the ratio Another way. This size is 1 to 2. I want one size for every two of the large one. This is also the ratio converted 200. And this is also 1/2. These things are the same thing. Just one compact and once not. But you'll recognize this form that division form coming from the other example where we did the division of the large one divided by the small one. And that was the inverse of the ratio to say, How do we get it to be that other size? So if you look back at Camp One, this is right here are ratio our target with divided by our with how big is the other one compared to us. And in this one here we reversed it. We just say we're 1/2 the size. We want anyone half a size compared to the other one. This is the ratio and we have to get back to 100% because adobe stores of scales in percentages again, I find this very unfortunate. I think it should store them in the ratio. It's fine to display the you wise that percentage, but working in the programming side, the ratio form without the percentage is more useful. Okay, so now we have this. We can go from the ratio to the percentage so this works of racial can have either value. If he wanted to be 1/3 the size you type 1/3. Now it's 1/3 this ice, and 1/3 is sometimes easier because 1/3 is quite easier than typing. While my percentage would be 33.33333 There's no way to represent its value correctly, so we do 1/3. Technically, it's truncating the SIA as well, where truncation means it will only go so many threes before it just stops. You want 1/3? That's a way to get exactly 1/3 you want. Seventh, if you want, is exactly the seventh the size these Air two options. We can figure this out and similar. If you wanna know how big this one is compared to this one, you could divide the sizes and figure out what ratio is 8. ⤖ Text Debug: So let's take a look at that. Let's put a text layer on top of this that says, what is the size of this thing? Okay. And you can modify text layers. Well, you can modify the source text. You can also click on and put expression as well. And you just say hello. Tested. First of all, it says hello over there. I'll just leave it over there for now. We're actually moving back to this side, all right. Every guilt and you can create strings of us as well. So if you had, say, a ratio here reissue equals 0.5. You could say hello plus ratio. See what comes out of this Hello, 0.5. This is a way to debug values and after effects as well. You just debug the value and you can print it out in a string. You remove the strings later, just click the eyeball, get rid of him. But for debugging, you can leave it here. So what I want to see as I want to say, Well, what is the ratio of the size of this layer to the other one, and we're gonna use this scale of that as well. Let's first consider the scale justice scale. So what is the ratio? Let's get our layer first. So I pick clip to this layer here. This is our earlier. Our layer equals this layer and we just a target layer I used to pick up again. Here we go. Take the Pickwick down to shape layer one. And we have that layers. Well, target layer. Now, they both have her scale, our scale Because our layered a transformed at scale Durga scale equals target layer. Doc. Transform scales were taking the scale from both those layers. So this is the hour layer scale. This the target layer scale, and we only concerned with the x axis. So let's do that right here. The X axis is right here. All right, So what's the ratio you can actually say? Well, target scale. Now, if you want to see what the ratio is Oops. Made a mistake. Um, I don't know why I type transfer. This is transformed certain of that transform. And so now you see, this is the ratio of the sizes of this one to the other one, and you'll find out this is actually the value of one divided by seven. If I go down here, make a nicer value like one divided by two like half scale, you'll see the ratio of 0.5 now, and this is the variations of size and you know it's That correlates to a percentage of 50% racial percentage. These air how they're related and we can also type that in here is well, we could also say percent action. And we say, Well, we're going to say scale and adding with strings kind of converted to a string. So in your ratio times 100% and say plus percent to show it as a percentage, 2% 50%. So scales that So now you understand that the ratio converts a skill that way. So now if you wanted to read somebody scale and figure out what was its ratio, you have to divide by ah 100. This is where we're saying the ratio is 50% and we're calculating it based on our size here . But what if we read the ratio instead? So this one are actually taking our scale in reading it and we're saying, Well, what ratio is this divided by this. And this is the percentage off that this is where you have two things, that they give up scale. I want to show a bit more about percentage. So this is the This is the basic aspect of percentage between the ratio and scale of 100% difference. And the key thing Notice that adobe stores the scale as a percent and in expressions, General, you want the ratio is the ratio was what you have to do to multiply things because you multiplied by the scale, you multiply by 100 too much. 9. ⤖ But what is 50% ?: So if we take the value of 50% what does this actually mean? It means the half, which saw 50% half of something, was half of the way is 0.5 is. We had a scale here of 0 to 150 is right in the middle and 0.5 is half of that. And you know it's in programming. Lot were preparing values, and this comes. Infections will use double equals because this says we're comparing them as opposed to signing them. And this is also the same as one divided by two. And you may be used to seeing this expression as well. One calling to and this is the same as division. There's multiple symbols for this, and these are all the exact same value. Now. This is something that's important to wrap your head around four after effects because it converts. We're gonna have to convert a lot between these things in expressions. So let's do this thing again. Let's give another idea of how this works. I could create another text layer to call this 10% and you over here that didn't go over here and create another text layer and call this 1 100% a little bit bigger movies once again. So we have 0 100% along here and we have values going cross. We know 50% is in the middle. Then we're gonna stick another object inside of there so we can actually see this actually duplicate that one. It's first of all, set the anchor point to be right in the middle, an anchor point, and I'm going to duplicate this one, and it can change the feel of it to be different. Colors will see it on top, and I'll change the height of this year's. So what I have now is I have this one here and we want example of the case of 150%. So we have this ship layer here, and we're going to call this the rename this to be That's this called progress part because that'll make sense of some kind and this will be the full size. So if you looked at 50% we take the transform and we're disconnect these again and just say the 50% that goes rights. Okay, let's go back. Let's change the anchor point again. So now when I change 50% it goes exactly the middle there. If I'd say 50 it's in the middle, and this is how you can think. Of what percentage is that? Zero is here in 100 years. If you broke this into 100 little steps, how far along is a 50 But you all also no. This is the half value. It's halfway through its one divided by two, because for the size of one here, this one is now twice is wide. So this is how the ratio works. 2 to 1. Or wonder, too, if you look at a way to one size one. And always remember, Adobe stores this scale as a percentage you have to convert back and forth. And that's exactly what we did in our labor up here, the ratio layer. If we looked at the way we did scale there, we took the ratio of 1/2 and said, Times 100 because we know the ratio is your a 1000.5 when you have to multiply by 100 to get to that value. And so if you set these up and encourage you to set up such a thing at play. With these ratios, you understand industry ratio and percentages and how you get to those ratios. And so in the text layer, we showed how you can take to values and divide them to get the ratio off them, whether these air the scales or whether they're the size. And in the other composition. We took the size of it and we said we took the wit divided by their with tarred with fourth , and this gave us the ratio. And we also have the target scale ratio. And to get back to scale, we multiply by 100. 10. ⤖ 100% Again: part of this has to do with why this is because of what percentage actually means, and it can be helpful to think of what that means as well. So let's go back to this line here and think of what does 100% actually mean and what does the percentage meat. So if you think about presented itself, percentage literally means like some value divided by 100 it literally means per cent per 100. And that's why it is. So if you see some of you writing, 75% is what they've actually written is 75 divided by, ah 100 and you'll start seeing these air where these scales come from here up top. So let's convert this back to 50% and see what I mean. So 50% literally means 50 divided by 100. And if I reduce these fractions, this can actually be well. This is the same as 5 to 10 which is the same as 1/2. That's what percentage actually means. So now if you want to go the other way, you want to say, well, how to convert 1/2 to a percentage. You have to get it to a value divided by 100. So if you multiply both sides, we first go to say, Well, it's five tense if you want organ, just say says is 50 over 100 1/2 of the same is 50 over 100. The moment you see the over 100 part, you could say, Ah, this is 50%. Just take this 50 part and say this is percent and this is 50% And this is how these relationships work. And I'm just showing this again and again because sometimes with the math that could be confusing as to why that is, but literally percentage means over 150% is literally 50 over 100 which combines that reduces to 1 to 1/2. You convert to 50 over 100 which then becomes a percentage. So any time you see that value, you know it's a percentage so 75 over 100 is the same as 75%. And so any time you have a ratio, the ratio of things that are basically the fractional form, you can multiply by ah 100 to get it to the percentage form, and I think I'll leave that point for now, but I'll keep pointing that out. And not just this class and class is about these relationships between these things as to understand what they are. So if you have more questions about this, just please ask. But I suggest doing a form like there's doing this thing and start playing with Depended Jin's understand why this is and to get back the composition here. When we did this composition to scales on changing the scale, we needed to know the actual ratio off the target scale. A target scale percentage in the code part is pretty much useless. So the moment you get the scale, like such converting out of the hundreds, we divide by 100 and his converts to the ratio form. And then we have a terrible scale and only one you have to give back to aftereffects converted back to the percentage and you convert back. There isn't it is simply by multiplying the scale by 100 and we saw that in the demo layer of how you could see the racial percentage 100 no matter which 12 years. When we modify the value of that, you just convert to get the other value 11. Text Size: All right. So let's show an example working with the text size, create a new text here. You can create a background item first that we want just to be the text size and put it here now, very importantly, gonna move its anchor points to the middle, not of the shape of the shape itself to get out of here, select this. And now I want to move this anchor point to the middle of the shape so we know where it's based on. I said the anchor point to the middle cause this complexity was size that I think I get to another video. I just want to do with size now in not positioning now going to create some textiles well created text layer and make it really big toe to the point. I make sure it's center here, and then you type something the text that we want. Then you get out of here. I'm gonna move the anchor point again to this injury, and I'm also gonna move the text to be centered in the in the block we want doing all this centering right now helps us to avoid the alignment issue. And I'm gonna do another class Justin alignment issue, but it's actually quite complicated. So what? We want to look at how we get the size of this text. Remember, this whole text layer has this whole shape, and that's not of any value to us. We want to know the size of the text itself. So let's go to the contents. Here are shape layer. We want justice size, not the actual scale we wanted. Just decides when all click here and create expression that the key thing we want is one pick with to this play over here when you call this text layer and then we want to do the text rectangle, which is a rectangle of this text direct source wrecked at time. Again, the source records the size of the text, not the size. The layer size the Texas in it, and that's what we want. And for our size, we just want to use that size, direction, text rectal with common text, correct heights, and that'll make us the exact same size as that text layer. So that gives the size. Now we have the same issue with scaling if you want. What if somebody comes along and says, Look, I want the scale of this thing to be bigger and its scale, the text, you know, it's we haven't changed with it because the actual source wrecked has not changed. This source wreck is the size that unskilled. So we want to account for the scales. Well, we're gonna get this scale of that. You have text scale, and we read it any percentage first, this is what Adobe gives us will say text layer, transform the scale, and we'll transfer this to a normal one text scale or ratio, which is more useful to us. That scale percentage divided by 100 0 divided by 100 text scale percentage one divided by 100. And now we have the ratio, not the percentage again. Remember, look at the second look at the quick chapter on percentage. If you're a bit unsure, we need the ratio because we're dealing with the actual size here and known a percentage. So here we take the witness a text scale zero. We'll just the x component hives, text scale one, which is the y component of it and now will be the same size or somebody scales the text will have the see text size. And if somebody the key thing about this, if you want actually change the text are backing thing will change with it. Whatever's eyes or whatever text he wants, the size will change yet how you can get something of the same size of Texas. This doesn't address the positioning very much in positioning. Where, who a text. I should do a whole class just on that to get its lined up correctly because there are a lot of little tricky bits of it. I just want to focus on the size now, and this is a source wrecked at time. We take the scale divide by 100 to get back into its to scale up that way now into another one. Just you understand the scaling thing. Let's do one that actually does with scale to see how we do that. And I didn't grab an image instead cause an image We can't change the size off, so I'll show you how to size and image to another layer instead 12. Image Scale: do new composition, image scaled and anyone one of my favorite websites picks, obey and find something interesting where I want for image that we want to scale. Let's just grab something from the front page here and let's say, Let's take this This item here from an early art it's nice. Background image will use this one in her example. Let's just down the J pig. I just down a smaller one because we don't need something that big load. Save that file. It's now an import here and import file. Okay, so we go back to image scale and say, Welcome to drug this one into there. So I have this image now. Now we want to do the same thing. How do we make this the size of the other one? How do we change the scale of this? Just move this up here. So it's centered. We put center in the page somehow. No. Okay, roughly centered. And now I want to put in that box and we just draw some random box again. So how do we make the image the same size as much The same is seeing a box. But you could only modify the scale of damage because the image itself, if you look around it, doesn't have contents to it. But it does have a source wreck still, with source records, the actual size, that image as it's imported. So we want to modify the scale. We can all click on it, and we want to modify the scale. But we have to know what our sizes first. So you see, our wrecked was this layer, that source wreck that sign and now we want to do. We need to find out the target of the other one, and I havent scale this Celeste to that once you let's do a pic whip over to that layer. And so we have to know how to scale ourselves according to that layer, and this was the same thing. Is the ratio again? What is the ratio of it? And I'll do the ratio with We want to get to the Turner. What's we're going to say? That's the size. What target ripped with divided by our Rex dealt with? What is the ratio of them to us, is how much bigger we wanted yet and ratio heights. Tell your rectum heights invited by our erect. Quite so. These are the ratios and ratios again and expressed The fractional value scale house or what we're modifying is a percentage. So we have to multiply by, ah 100 to convert from the ratio to the scale of the and that makes us the same size as the other one. This is how you could change the size. If you want to fit in the box, you can. But what if you said, well, I only want to fit the width of it? I wanted to be the same with, but I wanna have the correct aspect ratio for the height. That's very easy. You can use the same value for both of them. So if you want a one consistent scale, you say, Well, I'm only gonna do ratio with will make both values ratio with and now we'll scale the size of the wit but keep our aspect ratio because both scales have the same size. As long as both scale percentages here have the same value, you have the aspect ratio maintain. You could also say I want to be the same height of it, and this now makes it the same height so would fit in that box if you wanted to. But it keeps the aspect ratio, and this is the option you have if you make them both the same values at the user ratio with and high to have a completely stretching size that was the first option not completely stretches that to the exact same size. Or you have the same values for width on both or height on both, depending on which way you want to clamp it into that shape there. And so let's actually align these correctly. Let's put this one up. We'll put this one in the middle somewhere and would align this one up here, too. Let's lock it to the middle there and we gonna move this one above that shape layer so it fits their. So now we have those two there, and if we go into this shape layer here and we modify the size, you know, society that one state is constrained with it because of the expression saying, Look, we wanna have the same size 13. ⤖ Debug Source Size: and one of them point the images is that they have this source value, the source wrecked and you may want to inspect What? What is inside of this thing? So let's look at another one. There's you understand what that is. Let's put a text layer here and this text layer We're gonna put some text in its and we need to an expression for this. So click on the source text. You could do an expression for this under waggles black, first of all, But when Take this over here that layer and this is the image layer. And we wanna have this This the rectangle audits of image layer ducts source wrecked at a time. And what we want turn is this wreck thing actually has four values and it as ah, width and height. Those who want it also has a position which we don't matter for this item. So let's return to you. What is the width wrecked up with plus hides? And I typed it wrong. Director Heights. So 6 40 by 6 40 that was the size of the original image. It was square. We look back at picks, obey. You see the download that is the 6 46 point. That's what we download. It's the actual size of the image. Another trick you can do here. So you want. You have multiple lines, you could do something called back slash and and this is a line feed. And that'll put the things that, too. It's just another debugging technique. If you want to split up multiple lines like that in an expression. So this size here, this is the actual source records returns. That was original size image that will never change as we change the size of this thing. That source wrecked thing will never change because this image has a fixed size and it will not change and for texts the size of the text. 14. Conclusion: I think that covers it. So what you should be doing for this class is try to work through these examples, try to have something. This where you have the image that constrains and size of boxes is something that you do constraining image inside of box. You should also have example will make the box the same size of the text. Don't worry about alignment right now. I'll do another class alignment. Just get this size to be the same. So somebody types text, the size changes back. So as we change the text changes here and for the image we have that as we change the scale as we change the size of the box and just the size of the box now, right, I'm not changing the scale of it cause scale. You have to account for the other way and also go to the composition here, figure out how you get one that changes the scale of the size and understand the difference that changing the size you get to retain like a stroke with there are some other advantages of it. And changing the scale is actually easier for alignments. But you have to deal with the fact that Storr, Shin of Borders or other objects so definitely proud Alice as your assignment, go through and recreate each of these examples I have off the boxes sizing and just make sure you understand always things I don't have a full project to take away with. You just have to work through it and come up with something interesting. When we have some constraint things maybe make a template where you can constrain the shapes. And so it is. We have questions post them. If you do something interesting, just post a result as well. Let's see what you have with that.