(exciting music) - Hello and welcome to the 17th video in this beginner's guide
to Adobe After Effects. In this tutorial, I'm going to demonstrate how you can animate along
a path in After Effects. Now, in the previous episode, we undertook a simple animation exercise where we moved a circle
shape from left to right across a straight path. Shortly after that, we
learned how to create the paths using the Pen Tool. Now, in After Effects, we can
use paths to animate things like images and shaped across. In this video, I'll be showing you how to animate along a path. So in this video, we'll be
covering the following topics. Animating along a path. Animating on a path from a shape. And animating on paths
from Adobe Illustrator. After this video, you
should be able to animate easily along a custom
path in After Effects. So let's get into it. So here I am in After Effects and I have a project open here demonstrating some animations we are going to create in this tutorial. Now, you may recognize these paths, as we created them earlier in a tutorial where we learned how to use the Pen Tool. Now we know how to create customer paths, we can now learn how
to animate along them. So let's take a look at what we'll be creating in this tutorial. So first, we're going to
look at how we can animate along a curved path using the Pen Tool. Then, we are going to look at animating along an oval path using
the Shape Builder Tool. And then we are going to look at animating along a path brought in
from Adobe Illustrator. So we will be covering a few path types here in this tutorial. These are some very
common types of animation you will need to do in After Effects. So right now, it's good to cover them. So let's get started
with the first animation, animating along a curved path. But first, let's take a closer look at what we'll be creating. So with the project folder open, click into the S2
Essential Practise folder into folder 17, Animating Along a Path, and open the Animate Along
a Path After Effects file. And you'll have the same
document I have opened here. 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 this project
folder for a small fee. The download link with instructions is in the description. The download folder comes with
a lot 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. The download link with instructions is in the description. So with the project folder open, click into the S2
Essential Practise folder, into folder 17, Animating Along a Path, and open the Animate Along
a Path After Effects file. And you will have the same
document I have opened here. So first, I want to draw your attention over to the Project panel. In here, there are two folders. One called Preview and
one called Worksheets. To start, I want you to double
click on the second comp in the Preview folder,
Curved Path Example, and you should see this
underwater scene here. 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 here we can see, the fish is animating along a nice curved path, avoiding all the dangerous
obstacles in the way. Also notice that as the
fish moves across the path, the fish points in the right direction, dives as it goes down,
and looks up as it rises. Now shortly, I'll be showing
you how to do this as well. Now if we look in the Timeline panel, we can see that this
composition is 10 seconds long. You're currently in preview mode. Also, in the Timeline panel,
we can see the keyframes that are applied to the fish PNG layer. These keyframes are determining
the animation sequence we can see in the visual
composition above. Now, if we look closely, we can see there are some keyframes for position we have not covered yet. These are called rove keyframes. And we will see shortly how these work. So I'll toggle the visibility
of the path guide layer off. So we can see the
animation without the path. And that is looking pretty cool. So let's have a go at
animating this little fish through the underwater scene. To make this easy for you, I have set up the worksheet
for you to have a go yourself. So now, I want to draw your attention to the first comp in the Worksheet folder, Curved Path Worksheet. So simply double click on this, and it will open in a new tab. And you should see the
underwater scene here ready for you to animate. So here, we have the same composition we just saw, but without the animation. So in my Timeline panel,
I can see that I have the fish illustration as a separate layer. And I want to animate the fish
through this underwater scene avoiding all the obstacles. To do this, we will need to create a path, and then animate the fish across it. But before that, there is
something really important we have to pay close attention to. If we zoom in on the fish here, we can see the anchor point for this layer is currently dead center
of the fish layer. Now, this is something we normally want. But on this occasion,
we don't want this here. We are about to animate
the fish across the path, and we want the fish to
rotate along the path and dive down and rise up. When we animate a layer across a path, it's this anchor point
that moves across the path. Think of it like a roller coaster. This anchor point is
the wheels on the path. So it's this anchor point
that leads the layer. If this does not make much
sense to you right now, don't worry, you will
see shortly what I mean. So right now, if we animate
this fish across a path, it's going to connect the path by this middle anchor point bit. What we want is the fish to travel along the path led by the head. So before you animate
any layer across a path, keep in mind where this
anchor point is on the layer. So in this instance, I'm going to come up to the main menu and click
on the Anchor Point Tool. Then, click on the anchor point and just drag it over to the head of the fish instead of the belly. So with the anchor point on the fish, they are correctly placed, let's zoom out and create a path for
our fish to move along. So this can be done quite easily in After Effects using a path. For this worksheet, I have also provided a nice path guide for you to use. And we can toggle this on and off by hitting the visibility button on the layer in the Timeline panel. So first, I'll click on the fish and just click on the visibility icon to toggle the visibility off for now. And click off the layer to
make sure it's deselected. So as we learned in the previous episode, to draw a path, we will use the Pen Tool. So first, we will come
up to the Pen Tool menu, select the Pen Tool, now
before I start to draw my path, I'm going to come up to the
Fill and Stroke settings on the top of the interface. First, I'll click on Fill
and set this to none. Then, I'll click on the Stroke Color, I'll set this to a white color, and I'll set the Stroke to five pixels. With that set, I'll come and start to click along my path guide like so. Here, I'm going to use my
click and curve technique. So I'll click on the points to first place down my vertex points. Once I've put down my main vertex points, I'll come back to the Pen Tool, click and hold on the Pen Tool, and select the Convert Vertex Tool. Now, I'll come to each
point and click and drag right while holding Shift like so to add curve to my line
at a precise angle. And I'll do this at each point. Now don't worry if it's not exactly like the guide right now. Once I've added the curve to each point, I'll press V to activate
the Selection Tool, and now I can click on each point and drag on each handle to pull out and fine tune the curves like so. After a few tweaks, the curve should now match the guide below. So that's the path created
and that's the first step. Now, we want to animate the fish along it. So now come down into the path layer in the Timeline panel and
toggle down the properties. Toggle down Contents,
then toggle down Shape 1. Now we need to pay close
attention to Path 1. Toggle this down and
click on the Path like so. Now make sure you have both the Path 1 and Path selected. Now simply press Command + C on Mac or Control + C on PC to copy, I'll toggle back up the stroke layer and select the fish layer. So I'll click the visibility
icon to bring the fish back, and I'll press P on the keyboard and this will bring up the
position property on the layer. Now carefully click on
the position property so it's highlighted, and I'll make sure the time indicator is at
the start of the timeline, and now I'm going to
press Command + V on Mac or Control + V on PC to paste. Upon pasting, you will
now see the path appear, and the fish will be
positioned at the start. Also notice that on the layer, we now have some keyframes for position. Now as we move the timeline indicator across these keyframes, we will now see the fish animate along. Excellent. Now, if we look closely at the animation, we can see that as the fish
animates along the path, it's the anchor points of the layer that travels along the path. Because we move the anchor point earlier to be at the head instead of the body, the fish now appears
to move along the path led by the head rather than the body. This is going to give us a
better looking animation. So this is all happening
pretty fast right now. I want the animation to span
the length of my comp here. Now a quick tip here for you, with all the keyframes currently selected, if I press and hold Alt on the keyboard, we can click the last keyframe
and drag it out like so. This will alter the time of
the entire animation sequence. So I'll drag my last keyframe across to the end of the comp and release. Now I'll make sure the time indicator is at the start of the timeline, and I'll press Space
Bar to activate preview. And now my animation sequence is spanning the length of the comp. Perfect. So at this point, I can
come into the Timeline panel and toggle the visibility of the path I created earlier off. And I'll also toggle off the path guide. And that's looking pretty good. So to animate the fish
along a curved path, we first created the path
which set the values, then we carefully copy
the values of the path and pasted the values into the position settings of this fish layer. This then apply the curve
paths to the position settings, enabling the fish to
move across it over time. So I'll press Space Bar
to stop the preview, and if we look down in the Timeline panel, we can see some keyframes here we have not discussed yet on this course. So now let's look at these three keyframes in between this animated sequence. So here you can see that
these are circle keyframes. So what are these? Well these are called rove keyframes, and these are added automatically when we apply the path. When we pasted the curved path value into the positioning settings, it transcribed them into keyframes. Since the path was a curved path, it has added these rove keyframes which creates a continuous smooth motion, very much like easing. So let's watch the animation again. 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 right now the fish
is moving along the path at a consistent speed. But it seems to start
and end quite abruptly. So what I can do here is
add some easing at the start and the end to smooth this out. So I'll press Space Bar
to stop the preview. Now before this, I need to make sure I don't have any keyframes selected. Right now, they are all blue from earlier, so I'll just quickly
click off them to deselect and they will appear white. So I'll come to the first keyframe, right click, scroll down
to Keyframe Assistant, then scroll right and
select Easy Ease Out. Now notice, this will shift
some of the rove keyframes across a bit, but don't worry
about that too much right now. Next, I'll come to the last keyframe, right click, scroll down
to Keyframe Assistant, and this time select Easy Ease In. And notice the rove keyframes will shift back to the middle again. 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 now we can see there is a
nice ease into the sequence, and a nice ease to the
end of the sequence. So right now, the fish
is moving along the path with lots of smoothness. But what I want next is
the fish to look down as it dives and look up
again as it comes up. So this can be done easily by adding rotation keyframes. So let's look at how we can do that. So I'll press Space
Bar to stop the preview and I'll drive my time
indicator back to the start. And for this, I'm going to toggle back the visibility of the guide layer, as this is going to help a little. Okay, so with the fish layer selected, I'm going to press R to show the rotation property for the layer. So first I will add a rotation keyframe by clicking on the stopwatch. With my first rotation keyframe in place, I'll press U on the keyboard. This will now show me what keyframes are applied to this layer. And now I can see keyframes
for both position and rotation. Now I need to see this as I'm
going to use it as a guide. So next, I'll scrub the time indicator along the timeline, holding
Shift until my time indicator snaps to the first rove keyframe. Then, I'll come over and add
another rotation keyframe by clicking the diamond shape on the far left of the Timeline panel. Again, I'll scrub the time indicator along the timeline while holding Shift until my time indicator snaps
to the next rove keyframe. Then, I'll come over and add
another rotation keyframe by clicking the diamond shape on the far left of the Timeline panel. Again, I'll scrub the time
indicator along the timeline, holding Shift, until my time indicator snaps to the next rove keyframe. I'll come over and add
another rotation keyframe by clicking the diamond shape on the far left of the Timeline panel. And lastly, I'll scrub the time indicator along the timeline again
while holding Shift, until my time indicator
snaps to the last keyframe. Then I'll come over and add
another rotation keyframe by clicking the diamond shape on the far left of the Timeline panel. So now we have rotation
keyframes for each main point. Now as we move each keyframe for rotation, this is exactly the
rotation we want the fish to be at at this point in time. But what we need to do now is rotate the fish in
between these keyframes so the fish dives and rises correctly. So let's start at the beginning. So I'll make sure the time indicator is at the start of the timeline, and I'll start to scrub
at my time indicator across the timeline to about here, just between the first and
second keyframe for rotation. On the path here, we can see it's just on the initial
curve of the path. At this point, we want the
fish to be looking down. So now I'll come into
the rotation property and click and drag on the rotation value so the fish is facing downwards. And I'll use the guide in the background to make sure it's aligned correctly. Now notice, as soon as we
alter the rotation value, we have a new keyframe applied. Perfect. So next, I'll scrub
further along the timeline until I get to about here. Just as the path starts to curve again. Now at this point, we still want the fish to be facing downwards. So again, I'll come over
into the rotation property and click and drag on the rotation value, so the fish is facing down. As soon as we alter the rotation value, we have another new keyframe. So I'll make sure the time indicator is at the start of the timeline, and I'll scrub through
to take a look at that. Now, the fish is starting
to rotate too soon. To fix this, I can simply drag the first keyframe out
a little to delay this. And that's looking a little better. And the fish is diving nicely. So scrubbing the time indicator onwards, and I'll stop to about here, just as the path starts to curve up again, again I'll come over into
the rotation property and click and drag the rotation value up. So this time the fish is facing upwards. And as soon as we alter
the rotation value, we have another new keyframe. So I'll continue to scrub
the time indicator onwards and I'll stop about here, just where the path starts to curve again. I'll come over into the rotation property, and click and drag on rotation value. And as soon as we alter the rotation value so the fish is facing up, we now have a new keyframe. So I'll make sure the time indicator is at the start of the timeline, and I'll scrub through
to take a look at that and the fish is diving
nicely and rising nicely. So at this point, if I need to, I can place the time indicator at any of the rotation keyframes and tweak the rotation values. So moving on, I'll scrub along a little, rotate the fish down,
scrub along a little more, rotate the fish downwards again, scrub along under the curve a little more, rotate the fish up, scrub
along a little more, and lastly rotate the fish upwards. 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 now we can see the fish is diving down and rising up as we want it. What we have done here is
add two rotation keyframes between each main point to add
the rotation effect we want. But now, we have this strange
rotation effect at the end, like we had at the start originally. So what I'll do here is just drag the last rotation keyframe in a little, so the fish rotates more
smoothly at the end like so. So I'll press Space Bar
to stop the preview. Now, what I can do here is click and drag over the first three rotation keyframes to select them, right click, scroll down to Keyframe Assistant, and then come across and add Easy Ease. Then, I'll skip the next frame, select the next two
keyframes, right click, scroll down to Keyframe Assistant, then come across and add Easy Ease. I'll skip the next frame,
select the next two keyframes, right click, scroll down
to Keyframe Assistant, then come across and add Easy Ease. I'll skip the next frame,
select the last three keyframes, right click, scroll down
to Keyframe Assistant, then come across and add Easy Ease. And here, we have added
a bit more smoothness to those rotation keyframes. So I'll make sure the time indicator is at the start of the timeline. Now I don't need the path guide anymore so I'll toggle off the
visibility of this layer, and I'll press Space
Bar to activate preview. And there is our fish
animating along a curved path, diving and rising nicely. So that's how to animate
along a path in After Effects. So the next exercise
is slightly different. This time, we are going to
look at how we can animate along a path created with a shape. So now, I want to draw your attention back to the third comp
in the Preview folder. So now double click on Round Path Example. And you should see this space scene here. 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 satellite revolving around the Earth. And if we look closely,
the satellite gets bigger around the front and
smaller around the back. And we may also notice it
changes opacity a little. So this time, we have a little
perspective on the animation. Now unlike the previous example where we had a clear start and end point, here we have what appears
to be an infinite animation. Now, it would be possible to draw this path using the Pen Tool. But getting the precise
curve may be awkward. So an easier approach would
be to use the Shape Tool. So let's how see how this can be achieved. So to make this easy for you, I have set up a worksheet for
you to have a go yourself. So if you come into the Worksheets folder and double click on the second comp, Round Path, you should
see the space scene here ready for you to animate. So here, we have the same composition as we just saw, but without
the animation applied. So in the Timeline panel,
I can see that I have this satellite layer as a separate layer, and I want to animate the satellite around the Earth on an angle. To do this, we will need to create a path, and then animate the satellite across it. So let's create a path for
the satellite to move along. And this can be done quite easily in After Effects using the Shape Tool. So for this worksheet,
I have also provided a nice path guide for you to use around the Earth here. And we can toggle this on and off by hitting the visibility button on the layer in the Timeline panel. Okay, so let's create the path. Now instead of using the Pen Tool like in the previous example, this time, we are going
to use the Shape Tool. So I'll come up to the Tools menu and click and hold on the Shape Tool, then come down and
select the Ellipse Tool. Now before I start to draw my path, I'm going to come over to the Fill and Stroke setting on the top here. First, I'll click on Fill
and set this to none. Then I'll click on the Stroke Color, I'll set this to a white color, and I'll set the Stroke to five pixels. With that set, I'll come
into the Composition panel and I will click and draw
out my ellipse like so. Now don't worry too much if the ellipse is not exactly like the one I
have in the background here. This is just for a quick reference. So once my ellipse is drawn, I will just move it in place with the arrow keys until I'm happy. Now at this point, it's really important to mention that you have to be happy with this path before we set it as the path for the animation. Do not change the scale
or anything at this point, or it won't work properly. Okay, so that's the path created. Now we want to animate
the satellite along it. Now, with shapes, if we want to access the path information like we did earlier, we first need to convert the shape path into a Bezier path. And to do this is easy. First, come into the shape layer and toggle down the properties. Toggle down Contents, then
toggle down Ellipse 1. And now we have to pay close attention to the Ellipse Path 1. Now I'm going to select
the Ellipse Path 1, then right click and select
Convert To Bezier Path. This will now release
the path information. Next, I'll toggle this down
and click on the Path like so. Now make sure you have both the Path 1 and Path section selected. And I simply press Command + C on Mac or Control + C for PC to copy. Upon copying, I'll toggle
back up the shape layer. And then I'll come and
select the satellite layer. I'll press P on the keyboard, and this will bring up the
position property for the layer, and I'll carefully click
on the position property so it's highlighted, and I'll make sure the time indicator is at
the start of the timeline, and I'll press Command + V on Mac or Control + V on PC to paste. Upon pasting, you will
now see the path appear and the satellite will be
positioned at the start. Also notice that now the layer will have some keyframes applied for positioning. Now as I move the indicator
across the keyframes, we will notice the
satellite animates along. Okay, so this is all happening
pretty fast right now. I want the animation to span
the length of my comp here. Remember the quick tip from earlier? So with all the keyframes selected, if press and hold Alt on the keyboard, we can click the last keyframe
and drag it out like so. This will alter the time of
the entire animated sequence. So with them currently selected, I'll drag my last keyframe
across to the end of the comp. So I'll make sure the time indicator is at the start of the timeline and I'll press Space
Bar to activate preview. And now, my animation sequence is spanning the length of the comp. So at this point, I can
come into the Timeline panel and toggle the visibility of the shape I created earlier off. And I'll also toggle off the path guide. And that's looking pretty good. So I'll press Space Bar
to stop the preview, and if we look down in the Timeline panel, we can see some familiar keyframes. Again, we have some
rove keyframes applied. Since these keyframes are on
a curved part of the path, it has added these rove keyframes, which creates a continuous smooth motion, very much like easing. So let's watch the animation again. 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 right now, the satellite is moving around the Earth the way I want it. Now because we stretch
the animation sequence right to the end of the comp, when the satellite gets to
the end of the shape path, which is the starting point, when that animation loops, it looks like an infinite animation. Which in this instance is pretty cool. However, right now it
looks a little plain. What I want to do next is
set the orbit to an angle. But now we have a
problem we need to solve. So the path applied to the
satellite is horizontal, but I need to rotate it. Now once the path is applied
to a layer like this, you cannot rotate the path. So how are we going to rotate it? Well this can be done quite simply. What we are going to do here is simply pre-compose the layer. So I'll press Space
Bar to stop the preview and I'll toggle back the visibility of the shape layer we created earlier. I'll select the top layer,
press and hold Shift and select the next layer. With them both selected, I'll right click on one of the layers, I'll come
down and click Pre-compose. Upon click, the pre-compose
menu box will open. So first, I'll name the
composition to Satellite Orbit, then I'll make sure that I check the box for move all attributes
into new composition, and adjust composition duration to the time span of the selected layers. In this instance, I leave the open new composition box checked and press OK. Upon click, we will now
open a new composition with just those two layers. And the composition is the same length. Also, if we look in the Project panel, we will see our new comp is present. So for now, I can close this composition and come back to the Round Path Worksheet on the next tab next
to it on the timeline. So now we can see that we
have this composition layer, which we can now rotate. So I press R with the layer selected, and this will show the
rotation property on the layer. Here, I'm simply going to
come and rotate the comp like so to about minus 20 degrees. Now, if it doesn't look right
in regards to the Earth, I can use the arrow keys to just move the orbit to where I see fit. 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 now my satellite is orbiting around the Earth how I want it. Perfect. So now, I want to add some subtle animation effects to make it more dynamic. Next, I want to make the satellite smaller as it goes around the back of the Earth. So I'll press Space
Bar to stop the preview and double click onto
the satellite orbit comp to open it back up. So back in the pre-comp, we can see that the rotation is back to the original. So now I'm going to add some
scale effects to the satellite. So I'll drag my time
indicator back to the start and toggle off the shape layer. So with the layer selected, I'm going to press S to show the scale property for the layer. And first, I will add a scale keyframe by clicking on the stopwatch. With my first scale keyframe in place, I'll press U on the keyboard. This will now show me what keyframes are applied to the layer, and now I can see the keyframes
for both position and scale. Now I need to see this as I'm
going to use it as a guide. So next, I'll scrub the time
indicator along the timeline, holding Shift until my time indicator snaps to the second rove keyframe. This is the point in which I want the satellite to be its largest. So I'll come over and add
another scale keyframe by clicking the diamond shape on the far left of the Timeline panel. Then, I'll scrub the time indicator along the timeline, holding Shift, until my time indicator snaps
to the last rove keyframe. Then, I'll come over and
add another scale keyframe by clicking the diamond shape on the far left of the Timeline panel. Next, I'll scrub the time indicator to the end of the comp,
and then I'll come over and add another scale keyframe by clicking the diamond shape on the far left of the Timeline panel. So now we have four
scale keyframes applied. So I'll make sure the time indicator is at the start of the timeline over the first scale keyframe. Now I come into the scale
property and scale down to 20%. Next, I'll simply double click on the last scale keyframe. Upon click, a scale
option menu will appear. This time, instead of setting the scale at the Timeline panel,
I'll just type it in here. I'll type in 20 to match the
first keyframe and press OK. So with the keyframe indicator
at the start of the timeline, I press Space Bar to activate preview. Now, as the satellite animates around, it changes scale going from small to large and back again in an infinite loop. Excellent. And I'll press Space
Bar to stop the preview. So now I want to apply one last effect. As the satellite gets smaller, I want the opacity to change, making the satellite seem further away. Now, I'm going to add an
opacity effect to the satellite. So I'll drag my time
indicator back to the start, and with the layer selected, I'm going to press T to show the opacity property for the layer. So first, I will add an opacity keyframe by clicking on the stopwatch. With the first opacity keyframe in place, I will press U on the keyboard. This will now show me what keyframes are applied to this layer, and now I can see the keyframes for position, scale, and opacity. Now I need to see this as I'm
going to use these as a guide. So I'll scrub the time indicator along the timeline while holding Shift until the time indicator snaps to the second position keyframe. This is the point in which I want the satellite to be its clearest. Next, I'll come over and
add another opacity keyframe by clicking the diamond shape on the far left of the Timeline panel. Then, I'll scrub the time indicator along the timeline while holding Shift to snap to the fourth position keyframe. Then, I'll come over
and add another keyframe by clicking on the diamond shape. Next, I'll scrub the time indicator to the end of the comp. Then I'll come over and add
another opacity keyframe by clicking the diamond shape. So like scale, we now have
full opacity keyframe supplied. So I'll make sure the time indicator is at the start of the timeline over the first opacity keyframe. Now I'll come into the opacity properties and pull down to 30%. Next, I'll simply double click
on the last opacity keyframe. Upon click, an opacity
options menu will appear. This time, instead of setting the opacity in the Timeline panel,
I'll just type it in here. So I'll type in 30 to match my
first keyframe and press OK. So with the time indicator
at the start of the timeline, I press Space Bar to activate preview. And now, as the satellite animates around, it changes scale and
opacity in an infinite loop. Perfect. So I'll press Space
Bar to stop the preview and I'll click back
into the worksheet comp, and with the time indicator
at the start of the timeline, I'll press Space Bar to activate preview. And the animation is
looking just how we want it, but this time at an
angle around the Earth. Easy. So that's how to animate along a path from a shape in After Effects. Now what if we want to
create a more complex path? A path that may be too difficult
to compose in After Effects but easier to create in another program? So the next exercise is
slightly different again. This time, we are going to look at how we can animate along a path brought in by Adobe Illustrator. So next, I want to draw your attention back to the fourth comp
in the Preview folder. So come and double click on Spiral Path. And you should see this field scene here. 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 butterfly animation swooping down onto a daisy on what appears to be a spiral path. As the butterfly descends onto the flower, the butterfly gets smaller. Also, as the butterfly
moves along the path, it also turns correctly as it should. So looking down in the Timeline panel, we can see the keyframe supplied here are slightly different to
what we saw previously. Now you may also notice that the butterfly is flapping its wings every so often. Now unlike the previous two animations that animated a still image and a vector image along a path, this time, we are moving an
animated clip along a path. In After Effects, you can also
move animations along a path. Now notice that this butterfly layer in the layers panel is
actually a comp layer. So if double click on this comp layer, we will open it up and see
that this is a simple animation of a butterfly flapping its wings. So I'll make sure the time indicator is at the start of the timeline, and I'll press Space
Bar to activate preview. Here, we have a left and a
right wing changing scale to give the illusion like
the wings are flapping. Okay, so I'll close this
to go back to our example. So looking at the path here, we can see that it's a spiral. Now it would be possible to draw this path using the Pen Tool, but getting the precise
curves may be awkward. So an easier approach
would be to use a program like Adobe Illustrator that has really cool tools to
draw paths much easier. Now, it's quite common for designers to create their initial
paths in Illustrator and then bring them into After Effects. Now, if we look at the layers panel, we can see here that we already have a layer with an Illustrator
icon next to it. The spiral path used in this animation was first created in Illustrator. So I'll come down into the Timeline panel, select the spiral layer, and put my mouse cursor over, and right click and select Reveal. I'll scroll across and
select Reveal in Finder. For PC, I believe this is
Reveal in the Explorer. Upon click, we will see a folder appear, showing which file the artwork is from and where it is located on the computer. Here, we can also see the
other Illustrator files. But for now, let's look
at the spiral file. So I'll open the spiral
file in Illustrator. Now, it would help if you already have Illustrator installed
in your computer. I'll be jumping into Illustrator during the course of this
video to explain a few things. Though if you don't have
Illustrator installed, don't worry too much, you can
still follow along and watch. So here we are in Illustrator, and this is the spiral
path I prepared earlier. This path was created using
the Spiral Tool in Illustrator, where you can easily drag out a spiral and add as many or as
few spiral as you like. So a pretty simple document. So to create the spiral
path in After Effects, I imported in from Illustrator. So let's see how this could be achieved. So to make this easy for you, I have set up a worksheet for
you to have a go yourself. So now, I want to draw your attention to the third comp in
the Worksheets folder. So double click on Spiral Path, and you should see the flower scene ready for you to animate. So here we have the same
composition we just saw but without the animation. In the Timeline panel,
I can see that I have this butterfly comp as a separate layer. Now if I drag the time indicator to the start of the timeline and press Space Bar to activate preview, we can see the butterfly
flapping its wings. And I'll press Space
Bar to stop the preview. Now, we want to animate the butterfly swooping around and
then land on the flower. To do this, we will need to create a path and then animate the butterfly across it. So let's create a path for
the butterfly to move along. But before that, let's
remember to look carefully at the anchor point applied to the layer. So if we zoom in here
on the butterfly layer, with it selected, we
can see the anchor point is placed right in the center. Just like we did earlier with the fish, we are going to want this butterfly to travel across the path leading with the head and not the belly. So before we apply the path, we need to correctly
place this anchor point. So I'll come up to the Tools menu, click on the Anchor Point Tool and click and drag the anchor point on the butterfly layer just
behind the head like so. With the anchor point
correctly positioned, we can now apply the path. So here, I'm going to use a vector path I created in Illustrator. So for this worksheet,
I have also provided a nice path guide for us
to use as a reference. And we can toggle this on and off by hitting the visibility button on the layer in the Timeline panel. Easy. Okay, so let's create the path. Now instead of using the Pen Tool or the Shape Tool like
in the previous examples, this time we are going to
use an Illustrator file. So I'll come into the Project panel and double click into the
gray area below the folders. Upon click, a browser window will open. So with the Project folder open, come into the Project Assets folder, into the Images folder,
into the AI folder, into the Objects folder, select the spiral image and click open. Upon click, the spiral Illustrator file will be present in the Project panel. So now, I'm simply going
to drag the file down into the Timeline panel and
place it on top like so. Upon release, we will now
see the spiral path stroke, which is very similar to our guide. Now once the path is in After Effects, you can move it around and place it wherever you like, like so. Now it's important to state at this point that you have to be happy with the path before we set it as the animation. Do not change the scale or anything at this point or it will not work. Okay, so that's the path created. Now, we want to animate
the butterfly along it. So with imported Illustrator files, if we want to access the path information, we first need to convert it to a shape. To do this, it's easy. First, make sure the
Illustrator layer is selected, then right click, scroll to create, then across, and click on
Create Shapes From Vector Layer. This will now release the path data. Upon click, a new layer will be made and the visibility of
the Illustrator layer will be toggled off below. So now, I'll get the new path information. So I'll toggle down the new
layer to reveal Contents. I'll toggle this down to reveal Group 1, then I'll toggle this to
reveal the path and stroke. And I'll toggle down Path 1 and click on the path so it's highlighted. Now make sure you have both the Path 1 and the Path section selected, and I'll press Command + C on Mac or Control + C on PC to copy. With that copied, I'll
toggle up the shape layer, and now select the butterfly layer. I'll press P on the keyboard and this will bring up the
position property on the layer. Now carefully click on the position property so it's highlighted, and I'll make sure the time indicator is towards the start of the timeline, and I'll press Command + V on Mac or Control + V on PC to paste. Upon pasting, you will
now see the path appear. But in this instance, it's slightly off screen, a bit strange. Also notice that on the layer we now have some keyframes for position. So with the keyframes selected and my time indicator
on the first keyframe, I'm going to press and hold Shift, and use the arrow keys to move the line up and into place, like so. Once it's in place, I can
see that the butterfly is now at the start of the line. Perfect. Now as I move the time
indicator across the keyframes, we will notice the
butterfly animates along. Okay, so this is all happening
pretty fast right now. I want the animation to span
the length of my comp here. Now remember the tip from earlier? With all the keyframes selected, if we press and hold Alt on the keyboard, we can click the last keyframe
and drag it out like so. This will alter the time of
the entire animated sequence. So with all the keyframes selected, I'll drag my last keyframe
across the end of the comp to around 11 seconds, I'll make sure the time indicator is at the start of the timeline, and I'll press Space
Bar to activate preview. And now, my animation sequence
is spanning 11 seconds. So at this point, I can
come into the Timeline panel and toggle the visibility of the shape I created earlier off. And I'll also toggle off the path guide. And that is looking pretty good. So I'll press Space Bar
to stop the preview, and now if we look down
at the Timeline panel, we can see some familiar keyframes. Again, we have some
rove keyframes applied. Since these keyframes are on
a curved part of the path, it has added these rove keyframes which creates a continuous smooth motion. Very much like easing. Okay, so let's watch the animation again. 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 right now, the butterfly is moving around the path the way I want it. What I want to do next
is align the butterfly so it turns along the path. This can be done easily by
adding rotation keyframes. So let's look how we can do this. So I'll press Space
Bar to stop the preview and I'll drag my time
indicator back to the start. And for this, I'm going to toggle back the visibility of the guide layer as this is going to help me a little. So with the butterfly clip layer selected, I'm going to press R to show the rotation property for the layer. So first, I will add a rotation keyframe by clicking on the stopwatch. With my first rotation keyframe in place, I'll press U on the keyboard, and this will now show me what keyframes are applied to this layer. And now I can see the keyframes for both position and rotation. Now I need to see this as I'm going to use the position keyframes as a guide. So first, I'll come to
the rotation properties and tweak the first keyframe. And I'll drag to rotate my butterfly so it's pointing in the right direction. Next, I'll scrub the time indicator along the timeline while holding Shift until my time indicator snaps
to the first rove keyframe. Then, I'll come over to
the rotation property and carefully rotate the butterfly so it's pointing in the right direction. Upon rotation, a new rotation keyframe will appear on my layer. So again, I'll scrub the time
indicator along the timeline, holding Shift until the time indicator snaps to the next rove keyframe. I'll come over to the rotation property and carefully rotate the butterfly so it's pointing in the right direction. Upon the edit, a new rotation keyframe will be added on the layer. Again, I'll scrub the time
indicator along the timeline, holding Shift until the time indicator snaps to the next rove keyframe. Then, I come over to the rotation property and carefully rotate the butterfly so it's pointing in the right direction. Upon edit, a new rotation
keyframe will appear on my layer. Again, I'll scrub the time indicator along the timeline while holding Shift until my time indicator snaps
to the next rove keyframe. Then I'll come over to
the rotation property and carefully rotate the butterflies so it's pointing in the right direction. Upon edit, a new rotation keyframe will appear on the layer. So this is what I will do
for each rove keyframe. I'll make sure there
is a rotation keyframe and that each one and the butterfly is pointing in the
right direction at each. So now we have rotation
keyframes for each point. So if I scrub my timeline indicator across the sequence, we can now see the butterfly is traveling along the path and points in the right direction. Great. Now the last thing I want to do is make the butterfly get smaller as it descends and lands on the flower. To do this, I'm going to add a scale effect to the butterfly. So I'll drag the time
indicator back to the start and toggle off the layer guide as I don't need this any longer. So with the layer selected, I'm going to press S to show the scale property for the layer. And I'll add a scale keyframe by clicking on the stopwatch. With my first scale keyframe in place, I will press U on the keyboard. This will now show me what keyframes are applied to this layer, and now I can see the keyframes for position, rotation, and scale. Now I need to see this as I'm going to use these keyframes as a guide. So next, I'll scrub the time indicator along the timeline while holding Shift until my time indicator
snaps to the last keyframe. This is the point in which I want the butterfly to be smaller. So I'll come over to the scale property and click and drag down to around 25%. Taking this action will place a new scale keyframe at the end like so. So with the time indicator at the start of the timeline, I'll press Space Bar to activate preview, and just how I wanted, the butterfly points
in the right direction and descends nicely down onto the flower. Excellent. (exciting music) So that's how to animate along three different types of path in After Effects. Now over the past few episodes, we have been looking at how to animate manually from scratch. Now After Effects comes pre-installed with a whole range of effects and presets you can use to add a
variety of dynamic effects to your sequences at a click of a button. In the next episode,
I'll be introducing you to one of the most useful
panels in After Effects, the Effects and Presets panel where I will be showcasing a number of simple and
easy effects and presets you can use on your video sequences. So see you in the next video. (exciting music)