Motion path animation is a technique in which you attach an object to a NURBS curve so that it follows a path,
much like a train following its tracks.
This technique allows objects to smoothly traverse your scene, without you having to laboriously micromanage a ton of keyframes.
In this lesson, we’ll use motion paths to animate a high speed police chase through the city.
Let’s start by quickly looking at the different types of curves you can draw in Maya.
The CV curve tool allows you to draw a curve by plotting its control vertices. This is okay,
but as you can see, if we don’t plot the vertices closely enough, the curve ends up looking jagged.
Also, it’s a bit hard to predict exactly where the curve will appear in relation to the CVs.
The EP curve tool on the other hand allows you to draw curves by plotting actual points on the curve.
This is a bit better since we can draw our path more accurately.
Like the EP curve, the Bezier curve tool also allows us to draw curves by plotting actual points, but it will also allow us to
adjust the tangency at each point, somewhat like an enhanced EP curve.
Finally, there’s the Pencil curve tool, which allows you to draw points by holding the mouse button and dragging it out.
Although this method is the closest to the way you’d traditionally draw on paper, it’s much too jittery for us to use here.
After looking at all our options, let’s use the Bezier curve tool to draw our path.
First, switch to the top view. This will help us ensure we draw the curve flat on the ground and avoid unwanted bobbing
of our cars.
Now start by clicking on top of the getaway car. Maya plots the first point of the curve underneath it.
Now plot the second point at the corner of the first turn. However, instead of just clicking, click and drag the mouse.
Notice that Maya draws a pair of handles attached to the point. These are called tangents, and as you drag them you can see that
the tangents control the arc of the curve around that point.
These tangents help smooth out the curve while also giving you more granular control of the overall curvature.
Now finish drawing out the rest of the points just like the first corner. In addition to the other corners, let’s plot a few
extra points and tangents in the middle of some of the straight-aways to make our getaway driver
look a little more panicked and erratic.
Okay, now that our path is drawn out, we need to attach our getaway car to it.
First select the getaway car and shift+select the path. Then select the Attach to Motion Path option.
We’ll stretch the animation out over the entire timeline. Also, we need to set the Front axis option to Z,
since our car was built along the Z-axis.
That’s not bad, but it’s a little plain. Let’s add a bit of a swerve so that the getaway car drifts around the corners.
You can access the motion path animation attributes by selecting the getaway car and navigating to the motionPath tab of the
Attribute Editor.
As a car drifts around a corner, it’s back slides out in a wide angle. To animate this we’ll be using the Up Twist attribute.
Move the time slider until just before the getaway car reaches the intersection. Now let’s set a key on this attribute.
Now scrub forward slightly until the car is in the middle of the intersection. This is where we want the drift effect,
so let’s set the Up Twist value to about -70 and set another key.
Now as the car heads back into the straightaway, key the value back to 0.
There, now if we scrub through this section of the timeline, we can see the car drifts nicely around the corner.
Let’s adjust the Bezier curve a bit so the drift is a little more pronounced. Hold the right-mouse-button over the curve and
select the Control Vertex option.
Now on the point at the corner, use the Move Tool to adjust the tangent like so. You can see that as you move the tangent,
the curvature at the intersection changes.
Now we have a much more realistic trajectory for the drift.
The last thing that we want to do here is adjust the timing a little bit. When a car drifts, it’s temporarily slowed down and
has to accelerate back out of the drift.
To do this, we’ll be keying the motion path’s U Value, which corresponds to the percentage of the path the car has traversed
at a point in time.
Scrub the timeline to a point just after the car’s reached the apex of its drift. Key the U Value here.
Now scrub to a point a few frames after the car has straightened itself out again. We want to push the car back a little
bit so that it takes longer to come out of the drift. To do this, we’ll dial back the percentage of the curve it’s travelled
to about 17% or 0.17.
Now if we play back the scene the car has to accelerate back up to full speed once it comes out of the drift.
Now you can add drifts to the other corners the same way
You should also notice that the car isn’t attached correctly to the path on frame 1 of the animation.
We can use the U-Value to fix this as well, by keying it to 0.01.
To finish off the scene, just select the Bezier curve and duplicate it with a slight offset to make a path for the police car.
You can stretch its first Control Vertex down to the police car, and move around some of the other vertices and adjust
their tangents so that the pursuer doesn’t follow the exact same path as the getaway car it’s chasing.
You’ll also have to pull the last point back a bit, so the police car doesn’t catch up to the getaway car by the end.
And there you have it, a rousing police chase, done with very few keyframes.