How to create simple motion tracking in After Effects [video tutorial]

Share on facebook
Share on google
Share on twitter
Share on linkedin

Today’s post is the first one in a series of blog posts about tracking motion in After Effects. In our future blog posts,  we’ll also talk about :

So let’s start and see how you can create simple motion tracking in After Effects.

Note: Remember to watch the video tutorial, so that you could practice in real time what Jeff is teaching you.

If you go to the little video file over here, open this up. You see this will be called motion tracker and that looks like a separate effect but it’s actually a separate effect group. They’re called motion trackers.

This is tracker 1. This is track point. Then all these various things

  • confidence
  • attach point
  • attach point offset.

We’re about to create a whole pile of keyframes here automatically that’ll show up here in the confidence, attach point, and the attach point offset here.

open motion tracker

Okay, to do that you need to place the track point over the thing that I want to track.
And usually, it’s best for you to have the correct time indicator at the beginning of the comp.

And I want to zoom in on the soft space here to get a better ability to place my track point.

So to zoom in I press:

the “period” key in my regular keypad

and that zooms it a bit.

And now I want to go to see his face:

  • so I hold on the space part
  • I switch on the hand tool temporarily
  • and I’m pulling down the entire panel.

After Effects Academy Member Extra

Access your ‘Tracking Motion in After Effecs ’ Course in the After Effects Academy.

Jeff Sengstack will show you how to create tracking motion in After Effects

Click here to access this Tracking Motion in After Effects Course now

Not an AE Academy member? Click here to learn more about the After Effects Academy

Notice ⬇

I’m not pulling down the layer, just the panel.

Now if I hover over this thing you see that it turns into a four-pointed thing there, a little black four-pointed thing. Or a white one if I hover over a corner like that.

You should know that

The little cross is called the attach point.

But what I want to do is to position this whole box over the area that I want to search.
I want After Effects to look inside only this area when it’s looking for the thing that it wants to follow.

See how I’m doing that

If I go to the edge I can pick a corner and actually change the size of the box.  I don’t want to do that.

So I grab the whole box and move it—notice how it magnifies now—and I go to his ear.

attach point

What you should know when tracking motion in After Effects:


When you’re going to track something you want to get something that has a different color or a different contrast to make it easier for After Effects to follow it.

In this case, the skin tone will be a different color than the background and should be fairly easy to follow because there’s an edge to his ear so it’ll be obviously different from the background.


There’ll be, however, a little problem:

When he turns his head a little bit in the profile it becomes harder to track.

After Effects is not looking for an ear.

It’s looking for something that looks different than the surrounding color  or contrast.

When he turns his head it will be skin tone against skin tone so it won’t work that well.

 

Here’s the video tutorial. You should watch if you want to save some time and match what Jeff says with his demos.

 

Let’s continue with our attach point ⬇

You have two little boxes here.

attach pointI can grab a corner of the box and move it around like this.

And I’m saying, this thing inside the box is the thing that I want you to follow.

So I can move it to the right, it will be like that.

And this little crosshatch in the middle there is the attach point. It’s the thing to which we’re going to attach the text.

Usually, you leave it in the center. And some people have you follow one thing and have the track point go elsewhere because you want to attach something away from the thing you’re following.

But it’s really easy to move it off the attach point if you want to do that just by changing the anchor point later. So it’s no big deal. You can leave it right there in the center.

This thing in the outside is the area in which you want After Effects to look for this thing inside that box. So you’re basically telling it

Only look here. Don’t bother yourself with looking outside of here.

lineAnd when I know the motion’s going to go left-right, or right to left, I can click this whole thing by going to one of the lines here.

Not to the corner but the line.

I can move the box like that to anticipate the motion, to help After Effects know that we’re going to be looking at the left side of the screen.

So we’ve got this all set-up now. It’s not like rocket science here. It’s just some little things you can do to try to improve the possibilities of getting a good motion tracker.

I’m going to zoom out a bit so you can see it better by pressing…

the “Comma” key

Then, I take my hand tool slightly to the right.

So, what’s next?

We’re going to watch After Effects track this motion.

And the way to do that is you go to the bottom and that little triangle there is the “Analyze Forward” button. So it’s going to analyze as you go forward through the video.

Here’s the little triangle I am talking about:

analyze forward

Little parenthesis:

[I could analyze backward if I wanted to.

That will go backward in the video.]

So I click on that and let’s watch how it does it.

You should notice something really important ⬇

The attach point is staying attached.

So I’m going to stop this going off screen. I take my hand tool by pressing the “Space bar,” pull it down so I can see it better like that.

attach point staying attached

And it’s doing really well. You can see it’s still over here.

But what happens if we forward more? Let’s see!

At a certain moment, it loses it.

It actually did a really good job in profile there so that is a little bit of a surprise.

But it may be because the contrast of the dark area inside his ear ended up working pretty well for a track point.

Have you noticed the keyframes? ⬇

At this point, you want to get rid of the keyframes.
From that point forward you won’t need these keyframes because they’re wrong.
So just marquee select these keyframes.

And in fact, the only key frame we’re really interested here is the attach point key frame.

But I’m going to delete all of them; marquee selecting them, pressing “Delete.”

key frames

Right now what I’m going to do is I’m going forward in time and I’m going to
take my attach point and drag it up to where his ear is off-screen.

I don’t need to worry about these boxes, just the attach point. So I drag it up.

Guess what?

That will add a key frame to the attach point down here, and that new time.

So I go further forward just to kind of keep the motion going. It’s not that critical but it may sort of help us as we attach something to it and fade it off-screen. And now, we have done it.

Result?

That’s a real good motion track there. I’m really happy with that—got kind of lucky.

 

Here comes the second part.

Now I need to attach something to the track point, to the attach point.

To do that, I need to go back to the comp panel. So I go back to the comp panel.

I’m going to add some text.
So I’m going to go to the beginning here where I know the text is going to appear so I can sort of adjust its general position here.
I go get my type tool by clicking away from this layer.

If it’s not selected, you click on the type tool. I’m going to type in something like

My Feet

And I’m going to give it a key frame because I want to have this change the text has been moved forward here. So I’m going to open this up and give it—excuse me, open this up, open the text.

source text

Click on the source text there in little ways. So hold the key frame for that long.
And right about there I want to change the text.
So I just double-click on the text here to get it active

Are killing me.

And that gives:

My feet are killing me.

And that will add a new key frame there. Right now, it’s off-screen. But that’s ok.

It will be nice to make it a little bit more visible so

I’m going to add a layer style.

I’m going to add a drop shadow. So to add a layer style:
– just right-click on the layer
– go to layer styles
– add a drop shadow
And by default, it adds a drop shadow.

It just makes it stand out a little bit better there.

And now it becomes more interesting…

I want to add a line that goes from the text down to his face.
And one way to add a line is

to add a rectangle

So I’m going to click away here so that the text doesn’t select it anymore because I use a shape tool.
When it selected it, it actually creates a mask. Don’t want to do that. Click away to deselect that.

Click on the shape tool. And I’m going to make a rectangle.
So when I click on the shape tool, and I don’t have a layer select, that means that the shape tool colors pop-up here.

shape tool colors

Click on “Fill,” I want it to be white, which it is because I did this before.
And I want to have a little stroke on it so I click on “Stroke”.
It says two pixels so it’s already got a stroke.
And I see that it’s black which is fine, that’s what I want. You can have it whatever you want.

I’m going to make a little rectangle.

You know what?

I’ve never explained how to work with shapes before, and shapes are whole-different story when you’re working with shapes in After Effects.
But what’s kind of strange or at first disconcerting with shapes is that when you add a shape the layer that you’re putting the shape in has its own set of transform properties like rotation, and anchor point, and scale, things like that.
And then the shape itself has its own set of transform properties.
So you can have multiple shapes in the same layer and each shape has its own set of transform properties.
And then the entire layer has a set of transform properties.
So if you have five shapes and rotate the layer then all the shapes rotate around like that.
Or you can rotate individual shapes within a layer which can throw you off a bit.

But for the purposes that we’re going to do here, I want the anchor point for the layer to be down at the bottom of the shape.
So it’s a little tricky to do that.
But it’s not critical but it makes it easier to maneuver a little bit.

Let’s see how you can change the color of the swatch…

So the anchor point you could really see inside that police officer’s uniform there, I’m going to change the color of the swatch here for the shape by clicking on this little swatch down here.

color of the swatch

I’ll make a different color like orange, let’s say. Now I can see it better up there.

I’m going to zoom in a bit because I want to put it right here at the bottom of this rectangle. So I’m going to zoom in by pressing

the “Period” key a couple of times

And now I get to pan behind tool and drag that to that point there.
The pan behind tool is the letter “Y” or click on the pan behind tool like that.

Now I drag it—I can approximate it to that point there but holding on the “Control,” or the “Command” key, it’ll snap to that point right there.

Ok, so now when I rotate it I press, “R” for rotation here.

Remember the after effects shortcuts for changing layer properties?

It’ll rotate around that point which makes it much easier to deal with.

Right, I’m going to zoom right out of the screen here, “Shift + /.”
I want to position this guy here off that word, “My” there so maybe you zoom in a bit, “Period” key.

Get the selection tool. Drag it over to one side like that. Position it over that.
Rotate it a bit, pressing “R.” Pressing “R,” try that again. Rotating it a bit like so.
Press “V” to get the selection tool again and go about it like that.

It seems to be a bit large so I’m going to go to scale. Go here, press, “S” for scale. Break the link.
And go and scale the Y value. Maybe the X value a bit too because it’s kind of thick, like that.
Go back to—move it in just a little bit like that.
And put it behind the text. I put the text on top by dragging “My feet” above that shape—so now it’s behind it like that, ok.

And I want to make this process complete because what we’re going to do is

we’re going to attach the whole combination of these two things to the attach point.

When you attach something to the attach point, which sounds redundant, but when you attach one layer to the attach point, you’re essentially attaching that layer’s anchor point to the attach point.

my feet rectangular

And right now the text anchor point, by default is in the lower left-hand corner of the text.
I want it down here at the end of this little knob there.
Because that will make it easier to make this thing connect.

See how I’m doing that:

  • So I’m going to make sure the text layer’s active.
  • Get my pan behind tool here.
  • I’m just going to drag it down there at the general area there, just right about there. The snap tool will work in this particular case or will work right there. And now we’re set.

So if I want to say go to my feet and press “S” for scale or rotation, it’ll rotate from that point.
All right, now notice how it broke away from that little line there when I moved it?

I want to connect these two guys to be like one unit.
And you can connect things as one unit using what’s called

a pre-comp

which is something I’ve not really explained very much. But another way to do that is something called using the parent tool, the parent feature.

And have the parent feature open here right now just because I worked on it recently.

But if you don’t see parent here, you just right-click anywhere in this little bar up there.
And it says, “Columns,” and you can click on the parent with the check box, parent like that and the parent will show up there.

parent feature

And I watch parent, the shape to the text as opposed to the text to the shape.
If I parent the text to the shape, the text will probably skew because the shape is the skewed.
I’ll just test that. I’ll take the parent’s pick whip. This looks like a rope, like a lariat.
If I just drag that down to the shape, I’m going to guess it’s going to get twisted.

Let’s see…

You see it got twisted like that because it’s taking on the characteristics of the shape. I don’t want to do that. “Control” or “Command + Z,” you can do that.

So instead I’m going to connect the shape layer to the text by dragging lariat to that like that.

connect text layer

And I’ve connected it so that these guys are one unit, so that if I move “feet,” let’s say, I’ll go to position for feet, my text, I move it, they’ll move together as one unit—which is what we want to do here.

So now we’re ready.

And all I want to do is take the attach point from the motion tracker and just copy and paste these keyframes to “My Feet,” pretty straight forward.
So go down here, press “U” for all the keyframes, there are all the keyframes. If I click on the word “Attach point,” or the words, “Attach point,” that selects all of those keyframes.

press u for all key frames

Press “Control,” and “Command + Z” to copy them.

Now all these keyframes are copied.
If I take my current indicator to the beginning, I want to make sure that I’m at the beginning so that when I put the keyframes it’ll appear there also. They’ll also line up like that.

click on positionClick on “Position” here just to make that active.
So we know we’re pasting something to.
Do “Control” or “Command + V” and it pastes all these keyframes in position.

So now the anchor points here is taking on the anchor point’s key frame but the position is based on the location anchor point.

So now the position of this combination, of these two layers together will then match the position of the attach point.

Have anything to add to this blog post? Please feel free to drop us a few lines and share it.

Remus Hosu

Remus Hosu

Leave a reply

Scroll to Top

By continuing to use this website, you consent to the use of cookies in accordance with our Cookie Policy.