Join Alan Demafiles for an in-depth discussion in this video Masks, part of After Effects CC 2019 Essential Training: Editors and Post.
- [Instructor] Masks are a tool used to hide or reveal portions of our footage. After Effects has a few ways to create them onto your layer, and here we'll see what the tools offer us and how we can manipulate them. So here's a standard 2D layer, and with my sunset layer selected, I can come up here to my mask creation tools and you'll see I have these different shapes, rectangle, rounded rectangle, polygon, ellipse, and star, and I can also create masks using the pen tool. Now it's important to note that these very same tools will create shape layers if you have nothing selected in your timeline, and that's an important distinction because shape layers are something else entirely, which we'll cover in a later movie, but in order to create masks, it's very important to have first a layer selected.
So with that sunset layer selected, let's come over here and take a look at our rectangle tool. Now as I click and drag inside my composition window, you'll see I can create a square, I can create a rectangle, I can go up here. There's a lot of different ways to do this and manipulate it on the fly as I'm creating it. And with the help of modifier keys, you can actually constrain the proportions by holding down Shift, and this will make it a perfect square as you click and drag. If you hold down Shift and Command together, as you click and drag, the mask will be created from the center of the shape, rather than the top left.
So again, Shift and Command will create it from the center. So I'm going to create this from the center, and I want to maneuver this around and reposition it. So let's switch over to our selection tool. Let's double click, and we can come here, and with our transform bounding box enabled, we can click inside that box, maneuver it. We can rotate it. We can scale it up and down. We can do whatever we like. So let's go ahead and select that layer again. We'll switch over to our rounded rectangle and it's a little like the rectangle tool, except now we have rounded corners.
And we still have the same modifier keys, but we also have two additional functions here. So using the arrow keys on your keyboard, the up and down arrows will alter the overall roundedness of this shape. So by hitting up arrow, we are increasing the roundedness. By hitting the down arrow, we are creating more of a sharper corner. The left arrow will make it completely sharp, whereas the right arrow will make it all the way rounded. So as I drag out here, I can hit the right arrow again and make it completely rounded until we get this pill shape thing.
So let's go ahead and start it for rounded here like this a little bit and we'll increase the roundedness just a tad. Alternately, you can also hold down the space bar before you let go of the mouse button. And what that's going to do is allow you to reposition your mask while you're still creating it inside our composition window. So let's go ahead and get that aligned nice and neat, and there we go. Let's go ahead and switch over to the next tool, which is going to be our ellipse tool. So we can make circles. We can make ellipses with this. This one's pretty straightforward. I'm going to hold down Shift and get that into place.
We'll hold down space bar, and maneuver that kind of in the center. Okay, the next tool we have is the polygon tool, and this one's fun. Let's go ahead and click and drag, and you'll see we have a three-sided triangle, and with those same arrow keys, we can increase the number of sides all the way up until it's rounded like a circle, or somewhere in between. So let's go ahead and keep it at three. And with the left and right arrows, you'll notice that my edges are getting rounded out, or being concave and more convex.
So we have the ability to change up these shapes as we're creating them. So let's leave that at the triangle. We'll keep the space bar and position that there. And last on the list here, we have the star tool. Let's go ahead and click that and we can create a five pointed star. With the up and down arrows, we can increase the points, decrease the points, and as we do, we can left and right arrow to increase the rounding of the star, and now we can get somewhere a more flowery shape, or somewhere back into the sharp edged star shape.
So we're not limited to just those shape primitives. We can certainly come in and, with the pen tool, click and drag to create our own. So I'm just going to start clicking and dragging and create a zig-zag of sorts, and these are all just hard corners here, so we can certainly alter those to be softer by using the Convert Vertex tool. And if I click and drag that, now I have bezier handles, which I can then click and drag and maneuver around, much like in Photoshop or Illustrator. So another functionality about these masks is that you can add and subtract them.
Let's come over here to this second composition, and with my layer selected, I'm going to go ahead and create a straight circle. And from the center, holding down Shift and Command again, I've created one mask. I'm going to duplicate that mask, and you'll notice over here we have Add, Add. And so what this is doing is basically taking everything that's outside of the mask and throwing it away. We're not throwing it away, just temporarily discarding it. You can certainly, this is all non-destructive. You can certainly set this back to none and get back to your original image, but when we mask with Add on.
Let's go ahead and take this first mask and see what that does. Everything inside the circle or inside the mask is kept. If we wanted the inverse, we can certainly hit this Inverted button and it'll do the same thing as if we were to use the subtract function. So add and inverted, essentially gets you the same effect as this subtract. However, you can take more than one mask and use them together in conjunction with each other. So let's go ahead and move to our selection tool, and with our second mask selected, I'm going to double click and scale this down proportionally so that we get somewhere in there.
And that first mask is revealing everything inside, where now the second mask, I want to subtract, and take away everything that's inside of the second mask. So now we've essentially created this doughnut-looking thing. And that's all thanks to the use of two masks and these different modes here. Last thing I want to show you is the Pan Behind tool, and that's this icon over here. It actually serves a dual function. It also serves as the anchor point tool. So if we click on it and select our layer, you'll see that we have the bounding box.
We have our anchor point here in the center, and if we were to take our anchor point, we can certainly move it aside and that's going to now scale from this point instead of the center. But the tool also has another function in that if we were to select our layer and click and drag, notice now, our mask is staying in place, but we're basically moving the footage in the background behind there. So this sunset itself was being obscured. It was cut out here. I'd really like it to be on top so we can see the sunset and see the beach and all that jazz.
So we can do that thanks to the Pan Behind tool and essentially reposition our image, independent of our mask. Here in this movie, we saw how After Effects offers flexible tools to create and manipulate masks to allow us the power to hide or reveal portions of our layers.
- Linking Premiere Pro and After Effects dynamically
- Navigating timeline layers
- Working with keyframes
- Precomping elements
- Animating mask reveals and tracking masks
- Creating elements with shape layers
- Animating shapes and text
- Working with Illustrator files
- Animating a logo
- Creating 3D type extrusions
- Creating a simple camera in Z-space montage
- Keying video with Keylight
- Batch rendering and Dynamic Link rendering