Overview
Syllabus
Music : [intro music]
Jake Bartlett : Hey, this is Jake Bartlett for school of motion. And I am going to be teaching you how to make a tapered stroke rig in after effects using expressions. Now, expressions are a very intimidating topic. Let's face it. Code is just not a language that most motion designers speak, but if you can understand some very basic principles of how to use expressions as a problem-solving tool, the possibilities that they open up are pretty incredible. You can create entire setups inside of after effects that allow you to do things that natively after effects can't even do. They're an extremely powerful tool to have in your toolbox. And hopefully after this lesson, you will have a very good grasp on how to use them to your advantage. So let me start with my big fat disclaimer up front. We are going to be writing a lot of code in this lesson, and it's going to get pretty geeky, but it's not going to get too complex.
Jake Bartlett : Really. We're going to be more clever with our expressions, so you should have no problem following along. I'll go step-by-step. And at the end, we'll have a tapered stroke rig that you can reuse over and over in any project. All right, let's get straight to it. I'm going to make a new composition and frame rate. Doesn't really matter. Resolution I'll do 1920 by 10 80, and I'll set the background color to white, just so it's easy to see, and I'm going to start by drawing a line. Now, natively shape layers. Do not allow you to taper a stroke in after effects. It's a single width all the way along your line. There's no control for that. The only real solution that I know of that exists is trap codes, 3d stroke. And the reason I don't really want to use that is because one it's not free.
Jake Bartlett : And two, it works with mask paths. So I don't have all of the controls and special operators that shape layers allow me to have. So when I approached this problem, originally, my goal was to have a line behave exactly the same way that I'm used to on a shape layer that I could control with trim pads and use all kinds of operators on exactly the way that I was used to with the additional control of being able to control the width of the line from one end to the other. So let me show you what my original concept for that. Even being a possibility was I will go into my contents and add a trim paths on the shape group. I don't need that fill and I'll make my stroke round caps and round joins. Then I'll take my trim paths and set the end value to 10.
Jake Bartlett : And I'm going to make a bunch of duplicates of this group. So let's say 10, and then I will bring up all of the start and end values. And I want to offset each one of these by 10%. So they have 10 different segments. So I'm just going to do that really quick, not a very fun process to have to do this. All right, there we go. So we've got 10 segments all offset, um, by 10% on the trim paths, then I will open up the stroke width and offset each one of these by 10 pixels. So 100 than 90, all the way down the line.
Jake Bartlett : All right, there we go. So if you take a look at this line, it's totally crude, but you can kind of see the concept of working. Basically if you segment this line and offset the trim pass of each one of them, as well as the stroke with you kind of get a taper. Now, obviously you would need a lot more segments to make this not noticeable and doing it by hand is pretty much out of the question that takes way too much time. And I have all these duplicate groups that each have a copy of the same path. So if I were to go in and try and modify this path, that's only controlling this segment. Then I've got another path, another path, really, I would want one path to control all of the segments. So I wanted to figure out a way to get expressions, to do all this complicated work for me.
Taught by
School of Motion