12
Feb

Masking in After Effects Ep24/48 [Adobe After Effects for Beginners]


(light music) – Hello and welcome to the 24th video in this beginner’s guide
to Adobe After Effects. In this tutorial, we are going to look at masking in After Effects. Now as you start to use After Effects, more and more there are going to be times where you’ll want to cut something out or only see a certain part of the video to create a certain effect. What we can do in the After Effects is use whet we call masking. In this video, I’ll be
introducing you to masking and showing you how to use it. So in this video, we’ll be
covering the following topics. What masking is, and how
to mask with simple shapes, the pen tool, and with paths
pasted in from Illustrator. After this video, you will
get a better understanding of masking and how it works so you will feel more comfortable
and confident using masks in your projects. So, let’s get into it. So here I am in After Effects
and I have a project open here that I am going to use to
demonstrate how masking works. So what exactly is masking? Well masking is a way to
remove parts of a layer without destruction, keeping
the original source intact. Now, unlike programs like Photoshop, we cannot simply delete parts of a video or image layer away. But what we can do is use masking to hide what we don’t want to see. For those of you that are
experienced with Adobe Photoshop, you may already be familiar with masking, as they are work much
the same in After Effects as they do in Photoshop. However, setting them up and managing them in After Effects is quite different. So let’s take a quick
look at a few examples. Now if you have the project folder, you can open up the document I have here. With the project folder open, click into the S2
Essential Practise folder into folder 24, Masking, and open the Masking After Effects file and you will have the same
document I have open here. This is a document you can
use to quickly experiment with masking in this video. Now if you don’t have the project folder and you want to follow along
with this tutorial using this document I have
prepared especially for you, you can download the project
folder for a small fee, the download link with
instructions is in the description. The download folder comes with
lots of exercise documents we will be using on this course that have been carefully developed to aid your learning experience. The folder also comes
with document resources such as videos, graphics, and images you can use to build your
first video presentation from scratch later on in this course. To get the full learning experience, I recommend you get the project folder. Download link with instructions
is in the description. So with the projects folder open, click into the S2
Essential Practise folder into folder 24 Masking and open the Masking After Effects file and you will have the same
document I have open here. So now I want to draw your attention over to the project panel. Here you can see I have a
folder called Mask Examples and one called Practise. For now, I need you to pay attention to the Mask Examples folder. So double-click on the
first composition here, Mask Video With Simple Shapes, and it will appear in
the composition panel. So I’ll make sure the time
indicator is at the start of the timeline and I’ll press space bar to activate preview. So what we have here is a video I took from London Aquarium. But we can only see certain parts of the video playing
behind this black layer. So right now, it looks like we are looking through some small windows. So I’ll press space
bar to stop the preview and if we look in the timeline panel, we only have three layers. We have a video layer on the top and a black sorted layer beneath. If I toggle the visibility
of the black sorted layer by clicking on the rye icon, we can see the blue solid below. Now, I’ll press V to
activate the selection tool and click on the top video layer and we should see some shape outlines. These are shape masks which
are applied to the video layer. The masks applied to this
video in this instance have been created using shapes
from the shape builder tool. So now, let’s come into the timeline panel and toggle down the
properties of the video layer. Upon click, we will see a new property we have not seen yet on this course. Here we have a masks property. So if we toggle this down, we can see that on this layer we have six
individual masks applied. Now let’s click on Mask
1 and toggle this down. So for each mask we have four properties which can be tweaked. On a mask, we can tweak the feather by dragging this in and out. We can tweak the opacity of the mask and we can tweak the mask
expansion, pretty cool. So if I toggle this up
and toggle down the rest, we can tweak the same
properties if we so choose. Aso this is a video layer that has been masked using shapes created from the shape builder tool. When a mask is applied to a layer, it will always be accessible from the layer settings as just shown. And I’ll demonstrate how
this is done shortly. Now back in the project panel, this time I want you to double-click on the second comp, Mask
A Comp With A Pen Tool. Now we’ll make sure
that the time indicator is at the start of the timeline and I’ll press space
bar to activate preview. What we have here is a
person wearing sunglasses and with what appears to be a
reflection on the sunglasses. This time, instead of using simple shapes to create a mask, I have used the pen tool to create a simple shape to mask through. So I’ll press space
bar to stop the preview and if we look in the timeline panel, we have three layers. First we have a shape layer,
and the visibility of this is currently set off. And if I toggle the
visibility of this back on, we can see it’s the shape
of the sunglass lenses. So I’ll just toggle this off for now. Next we have a composition layer. So in this instance, instead
of making a single video layer, this time we are masking
a composition layer. And under this, we have a single image of a person wearing sunglasses. Now with the selection tool active, if we now click on the video layer, we should see some shape outlines. These are the mask paths which are applied to the video comp layer. Now the masks applied
to the video comp layer in this instance have been
created using the pen tool. So now let’s come into the timeline panel and toggle down the properties
of the video comp layer. So again we can see the masks property. So if we toggle this down, we
can see that on this layer, we have two individual masks applied. Mask 1 for the right lens
and Mask 2 for the left lens. If we click on mask one
and toggle this down, we can see the same properties we saw in the last mask example. So when creating a mask
with the shape drawn with the pen tool, it
carries the same properties that can be tweaked with
the mask drawn with a shape. Now back in the Project panel, this time I want you to double-click on Pasting Paths From Illustrator. I’ll make sure the time indicator is at the start of the timeline and I’ll press Space
bar to activate preview. What we have here is a crown shape with some video of the River Thames and the Tower Bridge Castle inside. So I’ll press Space
bar to stop the preview and if we look in the timeline panel, we have three layers. On top we have a video
layer and beneath this we have a shape layer and a solid layer. The shape layer has a subtle
gradient color applied and if I toggle this off, the
solid layer below is white. Now with the selection tool active, if we now click on the video layer, we should see some shape outlines. So this time we have
something a lot more complex than the shade masks and the
pen tool masks demonstrated in the previous examples. The masks applied to this video layer in this instance is from a path pasted in from Adobe Illustrator. So here I am in Adobe Illustrator and here is a vector crown
that has been prepared earlier. In After Effects, it is possible to paste in a complex path such as
this to create a mask from. So back in After Effects, if I come into the timeline panel and
toggle down the properties of the video layer, again
we can the masks property. So if we toggle this down, we can see that in this instance there
are many individual masks making up the crown shape. If we click on Mask 1
and toggle this down, we can see the same properties we saw in the last mask example. So when pasting in paths from Illustrator, the same properties can
be tweaked on the mask. So those are a few common examples of how one may go about
masking in After Effects. Depending on the complexity of the effect you want to achieve, you may either use the simple shape or you may want to use the pen tool or paste in a path from Illustrator. So let’s see how we can
apply masks to our layers. So back in the project panel, notice under the Mask Examples folder, we have a Practice folder. Well in here you should see
the same comps as above, but without any of the
effects in mask applied. Now I have put these together for you to follow along with me. So let’s begin by clicking
on the first comp, Mask With Shapes. So here in the timeline, we
can see a number of layers. So let’s start by toggling off the visibility of these layers. So from the bottom we
have a blue solid layer. Above this, a black solid layer, and on top of those,
we have a video layer. So for this exercise, we are going to look at how we can mask
using simple shapes made with the shape tool. So if at any point you want
to mask a layer using a shape, we will first need to
have the layer selected in the timeline panel. With the layer selected, we can come up to the shape tool, click and
hold to select the shape, in this instance I’ll
select a circle shape, and now I can simply click
and drag on the video layer. And as we start to drag out,
we are instantly creating a mask on the layer. Upon release, we will now have
a mask applied to the layer. If I want to reposition the mask, I can come down into the layer and toggle down the
properties to reveal the mask. If I click the mask, I
can use the arrow keys on the keyboard to move the shape mask around quite easily. If I want to change the shape of the mask, with it selected, I can
double-click on the path with the selection tool and
we will see the bounding box which I can tweak accordingly. Now, if for whatever reason you
cannot see the bounding box, come up and click on View and make sure Show Layer
Controls is checked. Now, if I want to tweak this mask further, I can some and toggle down Mask 1 and add a feather, alter opacity, and tweak expansion like so. So that’s how easy it is
to apply a shape mask. But what if I want to add more masks? Well this can be done quite simply. Again with the video layer selected, I can come back to the shape tool, click and hold, select the shape, and simply click and drag to
draw out another shape like so. This will apply another mask to the layer. And if we look in the timeline panel, we can see we now have a Mask 2. Now, what if I want to
copy the square mask and duplicate it on the other side? Well if I come down to Masks and select the Mask Tool by pressing
Command + D on Mac or Control + D on PC, this will duplicate the mask. And now we can see a Mask 3. So with Mask 3 selected, simply press the arrow keys on the keyboard to move this out to wherever you want it and I’ll do this while holding Shift to move it in larger increments. So just like that, you
can duplicate a mask on a layer. So I’ll make sure that the time indicator is at the start of the timeline and I’ll press Space
bar to activate preview and that’s how easy it
is to apply simple masks to your layers using shapes. Now remember, before
applying a shape mask, make sure to have the layer selected first in your timeline panel. So that’s one technique of
applying a mask to your layers. Now there may be an instance
where a simple shape won’t do. Perhaps you have a more bespoke area you want to mask out. To mask more complicated
areas, we can use the pen tool. So back in the project panel, this time I want you to
double-click on the second comp, Mask With The Pen Tool. So here in the timeline
we have two layers. Let’s start by toggling off
the visibility of these. So from the bottom, we have an image layer of a person wearing sunglasses
and on top is a video layer. So for this exercise, we
want to place the video inside the lenses of the sunglasses to make it look like it’s a reflection. So this time, we have
a very specific shape on the sunglasses to mask. To do this, we will
first draw out our shapes with the pen tool. So to begin, I will
toggle off the visibility of the video layer and I’ll
make sure I do not have any layer selected in the timeline panel. It’s really important not to have a layer selected at this point. So I’ll press G on the keyboard
to activate the pen tool. Now up near the tools menu,
I’m going to click on Fill. And I’ll set it to None. Then I’ll drag the stroke
out to about five pixels and set the stroke color to a white. I’ll scroll in on my mouse wheel to zoom in a little and
I’ll start to click points around my first sunglass lens like so. Pressing and holding space bar to click and move around my canvas
area to add more points and when I get near to the start, I will click on the first vertex point to complete the shape. So right now, I have this rough shape inside my sunglass lens. Next I’ll come up to the pen tool, click and hold and select
the convert to vertex tool. Now I’m going to come
back and click and drag on each vertex to add curve to my line. I’ll do this carefully
on each vertex point until I have a nice smooth
shape filling my sunglass lens. Notice in the timeline panel, upon drawing my shape with the pen tool, I now have a new shape layer, perfect. Okay, so now we need
to draw the other lens. So this time, I’ll make sure the current shape layer is selected. I’ll press G to make sure
the pen tool is active. Now if for whatever reason
you see the feather icon, simply press G again
until you see the pen icon and again I’ll click to draw points on the next lens like so. And I’ll click around and join at the end. I’ll come up to the pen tool, click and hold and select
the convert to vertex tool and I’ll click back
and drag on each vertex to add curve to my line. Now I’ll do this carefully
on each vertex point until I have a nice smooth
shape filling my sunglass lens. So I’ll click off the layer and I’ll click the magnification popup at the bottom of the composition panel and
I’ll click Fit to zoom out. So down in the properties
for the new shape layer, if we drop down the contents, we can see we have two
shapes on this layer. Shape 1 and 2, which are the two lenses. So now I want to get the
video inside these shapes. Okay, so we are going
to apply some effects to the video later. So before we start to place the video, we will want to pre-compose
the video first. So to begin, I’ll quickly right click on the video layer and select Pre-compose. On this occasion, I will
name the comp Sunglass Video. I’ll make sure to move all
attributes into the new company. I’ll adjust the comp
duration to the time span but click off Open New Comp and click OK. Now the video layer is placed
inside the comp layer, great. So I’ll press S on the
keyboard to activate scale and in the layers properties, I’ll scale the video down like so. Then I’ll press R to activate
the rotation settings and I’ll rotate the video slightly so it’s inline with the sunglasses until I have something
that looks like this. Next I’ll press V to
activate the selection tool and click and drag the video into place so it’s neatly over the lenses. So now I’ll toggle down
the shape layer properties to reveal the contents and the shapes then down into the shape,
we will see a path option. So starting with Shape 2,
I’ll toggle down the path then select the path and press Command + C on Mac or Control + C on PC to copy. For now, I will toggle off the visibility of the shape layer on top. Now if I come to the video layer, I’ll make sure this is selected. With it selected, I’ll press
G to activate the pen tool. With the layer selected,
click once with the pen tool on the video layer and
then hit Command + V on your Mac or Control + V on PC to paste. Upon paste, the paths from the shape layer will be pasted onto the
video and we should see the path highlighted like so. But now we have a problem. The path shape is for some reason smaller than the path we just
copied from the shape layer. Well this is because we
adjusted the size and rotation of the video comp layer. When pasting paths into layers that have been changed, the
paths are not how we want them. So I’ll press Command + Z on Mac or Control + Z on PC to undo that. Now the solution to this problem is to pre-compose the video layer again. So we just change the rotation
and scale of this video. If we now come back to the comp layer, I’ll right click on the video layer and select Pre-compose. On this occasion, we will name
the comp Sunglass Video 2. I’ll be sure to move all
attributes to the new comp. I’ll make sure Adjust to
the Composition is checked, and I’ll click off Open
New Comp and click OK. So now the video comp layer is placed inside another comp layer, so
this time it should work fine. So again, I’ll toggle down
the shape layer properties to reveal the contents of the shapes and then down into the shape,
we will the path option. I’ll toggle down the
path, then select the path and press Command + C on Mac or Control + C on PC to copy. Now, I will come to the video comp layer and make sure this is selected. With it selected, press G
to activate the pen tool if you can see the feather
icon, just press G again until you can see the pen icon. With the layer selected,
click once with the pen tool on the video layer and
then hit Command + V on Mac or Control + V on PC to paste. Now we have the path
exactly how we want it. So now I’ll toggle down
the video comp layer and then down into masks we will see we have one mask applied to the right of this,
we will see a drop down that states none. Now, if we click this and select Add, we have now masked the video into the first sunglass lens, perfect. So back into the shape layer on top, this time select the path of Shape 1. Press Command + C on Mac or Control + C on PC to copy. Click back into the video comp layer, press G to activate the pen tool. And if you see the feather
icon simply press G again until you can see the pen icon. Click once then press Command + V on Mac or Control + V on PC to paste. And the next path will be pasted
onto the video comp layer. Again back in the video comp layer, if we toggle down Masks, we can now see we have a new mask. Where it states None on
the dropdown to the right, click this and select Add. And now the video is
inside the second lens. Perfect. So that’s one simple technique
how we can place video into paths drawn from the pen tool. Okay, so right now this is
not looking too convincing. To alter this, we can add some
simple effects to the video. So if we double-click into the video comp, we will open up a new comp with the video scaled down and rotated. If we double-click on the
video comp inside this layer, we will see the video is normal. So up in the Effects and Controls panel, in the search menu I’m
going to type in black. This will reveal the black
and white effect below. And I’ll drag this onto the video layer. Next, up in the Effects panel, I’ll type in warp. Below in the Distort folder, I’ll drag the warp effect onto the video. Next, over in the effect controls, I’ll click on the Warp
Style and choose Fisheye. Next I’ll click off the
video layer to de-select it. I’ll come up to the shape layer, select a square, then over in the fill, I’ll select linear gradient. I’ll push the stroke down to zero then I’ll drag a little
square on top like so, then I’ll press and hold
Alt + Command on Mac or Alt + Control on PC and press F and that will fit the
shape to the video frame. I’ll click back into the color box and set my colors to my gradient for the left color I’ll select a blue and for the right color
I’ll select a purple. I’ll click OK and then press V to activate the selection tool and this will allow me to
select the gradient points and tweak them like so. And I may have to soom
out a little to do this. So I’ll move them so the
gradient is at an angle. So once I’m happy with my gradient, I’ll come down into the timeline panel and on the layer properties
for my shape layer, I’ll click on the blending
mode and select Screen. If you cannot see your blending mode, make sure you have the
second from left switch set to on in the bottom left
corner of the interface. Okay, so with that effect applied, I can close the tab down and
I’ll see my new video comp with the effect applied. I’ll close this tab
down and we are now back into the main comp with the
video inside the sunglasses. Now to finish off the
effect, I’ll come down into the Timeline panel,
and on the layer properties for my comp layer, I’ll
click on the blending mode and select Multiply and that will blend really nicely with the
sunglass image below. So I’ll make sure the time
indicator is at the start of the Timeline panel
and I’ll press space bar to activate preview and
that is looking pretty neat. So that’s another technique to
apply a mask to your layers. Now there may be an instance where even a path drawn with a pen tool might not do. Perhaps you have a piece of
artwork drawn somewhere else you want to recreate in After Effects. But drawing it with a pen
tool would take a long time. To mask an even more complicated area, we can past in a path
from Adobe Illustrator. So back in the Project panel, this time I want you to
double-click on the third comp, Making With Illustrator Path. So here in the timeline
we have two layers. Let’s start by toggling off
the visibility of these layers. From the bottom we have a shape layer with a dark gradient applied
and on top, a video layer. So for this exercise, we want to paste in a very complicated path
from Adobe Illustrator. So here we are in Illustrator and this is a piece of vector artwork that has been created previously. We are going to paste this
path into After Effects and use it as a mask. Now at this point, it
would help if you already have Illustrator
installed in your computer as we are going to open
this in Illustrator and copy the path. So to do this, we will
first need our video set up in the composition like so. And then we will need to open up the path we want to paste
in Adobe Illustrator. So with the project folder open, click into the Project Assets folder into the Images folder
and into the AI folder into the Masks folder and
open the crown mask document. So to begin, we will need
to select the shape path. So I’ll click the shape
and press Command + C on Mac or Control + C on PC to copy. Back in After Effects,
simply select the video layer and with it selected,
press Command + V on Mac or Control + V to paste,
and just like that, a mask will be created on the video from the paths in Illustrator, easy. And if we come down
into the layer settings, we can see in the mask section, we have lots of individual mask shapes that are making up the
mask which can be tweaked as demonstrated earlier. So that’s how you can apply simple masks to a layer in After Effects. Now in this video, I showed
you some of the basic ways we can mask in After Effects. These examples were quite static and didn’t really move. Now once you have applied
a mask to a layer, it is actually possible to animate it. Here is an example of how can
use masks and animate masks to create a dynamic type animation where type seems to appear
from a particular point. In the next video, we are going to build on top of what we learned in this video and look at how can animate a mask to create a dynamic
animation sequence like this. So see you in the next video. (upbeat music)

Tags: , , , , , , , ,

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *