|AE 5.5: Masks, Transfer Modes, Track Mattes, Time Remapping|
Senior Promotion Producer, KCRG-TV, Cedar Rapids, Iowa, USA
©2002 Dave LaRonde and Creativecow.net. All rights reserved.
Dave LaRonde shares his experiences with upgrading from AE 3.1 to AE 5.5, and the production bundle no less. What would he do first? He gave himself an assignment: A fictional client arrives with a starfield and two animations, both movies of a planet and a moon rotating on their axes. My task: the moon must revolve around the planet, and it must look CONVINCING, as if it were a time lapse from the Hubble Space Telescope. Armed only with the manual, he demonstrates both the old and the new: Masks, Transfer Modes, Track Mattes, Time Remapping for a little bit of fun, and as it turns out
|Download Movie||Project file: sit (includes footage)||Project file: zip (includes footage)|
I was comfy with AE 3.1. I knew its workings fairly well, although I never had occasion to use such exotica as Motion Tracking. I was still on my 3.1 learning curve when I received AE 4, then 4.1 and I wondered if I would ever completely get my head around After Effects. I still don't get the Offset or Arithmetic Filters, and don't understand the need for Smear. But when After Effects upgraded to version 5.0, I wanted it. Never mind that I was still (and still am) learning AE 4.1.
Well, now I have AE 5.5 Production Bundle, no less. Who could ask for more? I know some help learning it, but that was not to be. I had nothing more than the manual for my learning tool, and it's like being an AE rookie again. The manual is a marvelous reference, but have you ever tried to grasp a subtle concept from its pages? Good luck!
In order to start learning a mission not unlike climbing Mt. Everest, in my mind I gave myself an assignment. A fictional client arrives with a starfield and two animations, both movies of a planet and a moon rotating on their axes. My task: the moon must revolve around the planet, and it must look CONVINCING, as if it were a time lapse from the Hubble Space Telescope.
My first step: make an inventory of the things that would make it look real.
Let's go back to that Top Camera view of the task at hand. This time, let's say that circles represent our real 3D planet and moon, while AEs 2D planet and moon take the form of their customary lines:
There's more: based on our diagram, both our 2D planet and moon would need shadows on their right sides, or limbs. Those shadows would follow a spherical contour which our 2-D movies don't even have. Lighting them in AEs 3D world won't even get close.
The conclusion is this: AEs 3D is great, and I have seen how it can be used to stunning effect. However, it cannot mimic real 3D in all instances, and this is one of those instances. In this case, depth makes a big difference. AEs lights and shadows simply will not suffice, because your eyes and your brain would smell a rat.
What to do? We will adopt the traditional strategy of clever AE practitioners the world over
The starfield background is fine, but look at the planet and moon. Not only do they look suspiciously like Jupiter and the Earth, they're on a black background no alpha channel. They also lack visual character they're not very convincing spheres, are they? Fixing them will be our first job. So let's grab that footage and get going! Download it from the green bar at the beginning of this article, if you haven't already. It's a lot of fun to build this project from scratch. But if you just want to watch, the project file is there too.
Create a new project, putting the Project Settings at 30 Frames Per Second, Drop Frame. Now import our three elements. Drag the planet and moon movies to the Composition Icon at the bottom of the Project Window. Poof! A window appears: New Composition From Selection. We'll select Multiple Compositions and click OK. Bam! Two new comps appear for each of our movies.
When we examine the composition settings, we see that the comps take on the size, duration and frame rate of our source footage. That's pretty darn cool. We'll name them Planet Comp and Moon Comp.
As our project progresses, we'll be glad that our movies are in separate comps.
Now drag the Starfield onto the Composition Icon. Again, it creates a comp with the same dimensions as the source footage. Since it's a still, with no frame rate or duration, AE gets that information from the last movie footage items used, our planet and moon. Again, very cool. We will give this comp a new name: Orbit. In this comp, the moon will orbit the planet and that's about all. Our shadows will be created in the Planet and Moon comps.
So let's add the Planet and Moon comps to the Orbit comp. A couple of mouse clicks reveals two pieces of information. First, our heavenly bodies are precisely the same size isn't that handy? Second, our heavenly bodies are indeed on black backgrounds. They need to be circles rather than squares, so we'll create a circular mask for just one of them.
Here's an easy way to do it: Call up the Tools Palette, and using the modifier key (Option Mac, Alt Win) click on the Rectangle/Oval Mask tool until it shows the Oval mask. Double click on the Oval mask, and it makes an oval mask with its edges on the edge of the layer; since we have a 320x320 square, this oval just happens to be a circle. Cool! It might be a bit big, so double click on the circle mask. This calls up the Free Transform Points box. Hold down the shift key while you move the corner to scale the mask uniformly, then click on the mask itself to move it to the center. When the mask is right, we will then copy that circle mask and paste it onto the other layer.
We now have all the comps we will need to pull this off. Start making these heavenly bodies a little more heavenly, beginning with the Planet comp.
Open up the Planet comp and create a new solid that is twice as big as the comp, or 640x640, labeling it as Shadow. Make this solid a medium gray. Now make a circular mask as we did above. Double click on the mask, then use the Free Transform Points box to scale it down until it's a bit larger than the Planet.mov layer, and center it on the layer. Change the mask mode to Subtract so it punches a circular hole in your big, square layer. Give it about an 80 pixel horizontal and vertical feather. Turn on the Multiply Transfer Mode and start moving this layer horizontally to the left.
Look at that! It makes a shadow on the right limb of the planet that doesn't go completely black, as it would if you used a black solid and no Transfer Mode. Why is this good? It gives you a shadow, but it gives the illusion of a little ambient light, which is a nice thing. To adjust the intensity of the shadow, modify the layers horizontal position and level of gray (darker gray makes a darker shadow) until you like it, and check it in the Orbit comp you'll see it against the starfield background, and that helps. Admire your handiwork for a moment. It ought to look something like this:
Happy with it? Good! Now copy this shadow layer and paste it into the Moon Comp 1. Boom done! Your moon now has a nice shadow on its right limb, too. It's important to get this shadow layer the way you want it, and then copy and paste it to the other comp. Why? These heavenly bodies are supposed to be the same distance and at the same angle to the light from their sun, so their shadows would be the same. The easiest way to do that is to cut and paste.
Now that these heavenly bodies actually look like spheres, it's time to set up our moons orbit around the planet.
Open the Orbit comp. This orbit is about as basic a 3D move as you can get, friends. To begin with, put the moon layer on top if it isn't there already, and let's scale it to 20% -- a fifth the size of the planet. That ought to make a convincing moon, don't you think? Now turn off the visibility of the moon layer. Activate the Cube Icon in the Planet layer; it's now 3D. We won't do much to it we're just going to move it back on its Z-axis. Let's make the Z-value 120. A quick check of the Top Camera reveals its position in Z-Space looks good. Now make your moon visible again.
Before we animate the moons orbit, let's look at this comp. It's 10 seconds long; our motion path will have five keyframes at 0, 2.5, 5, 7.5 and 10 seconds. The last keyframe will be identical to the first. Just so we're singing off the same page in the hymnal, we'll begin our animation BEHIND the planet but we'll start with the SECOND keyframe. If you look from the Top Camera, this planet will orbit clockwise. Finally, the center point of this comp is 320, 240, 0. Everybody understand? Good.
Move the Current Time Indicator to 2:15 to make the second keyframe. Remember we're making that one first. Activate the 3D cube for the moon layer, and set the Z-Value for 120, the same as the planet. Now move the layer to the right until it looks good. Just eyeball it. For me, that's a position of 600, 240, 120. Set a position keyframe. Now go to 7:15 and we'll set the fourth keyframe; we'll change the x value by the same amount as we did at 2:15, only in the opposite direction. That makes its position 40, 240, 120. We've established an offset of 280 pixels for our orbit, so at the midpoint at 5:00 the values will be 320, 240, -160. At each end at :00 and 10:00 the position value will then be 230, 240, 400. When you set the keyframe at 10:00, the comp window will be blank. You will be at the extreme end of the comp, beyond the Work Area. By setting the keyframe there, it will allow our animation to loop seamlessly.
We almost have the orbit done. Switch to the Top Camera, highlight all the Position keyframes, then control-click (right click in Windows) on any keyframe to reveal the context-sensitive menu, and highlight Keyframe Interpolation. We'll change Spatial Interpolation to Bezier. Gosh, look at all those handles! Tweak em until your motion path is a circle; when you've got it, you're done.
Open Moon Comp 1. There's a big chunk of land clearly visible at 9:07 in the moon movie. The movie starts at 0:00 and ends at 9:29. We have all the information we need to fix this.
There are a couple of ways to do this, and we'll take the road less traveled: time remapping. Everybody I know thinks time remapping is sooooo tough, but it's really pretty easy. Once you get used to it, you'll want to use it a lot because it's so handy. Here we go:
Highlight the Moon movie layer, and select Layer>Enable Time Remapping; hit the u key to reveal the Time Remapping keyframes. Go to 5:00 in the comp this is where we want to see the footage at 9:07. So we make a keyframe, and give it a value of 9:07. The keyframe at the beginning of the layer still reads 0:00, so we'll change it but to what? Easy. Because we set a 9:07 keyframe at 5:00 into the comp, we need to subtract 5 seconds, which is 4:07. Change the value of the beginning keyframe to 4:07. Three more keyframes to go
We need to tell Time Remapping when the movie ends and when it begins again. We know that at 5:00 in the comp, we set a 9:07 keyframe, and we know that the movie ends at 9:29... a difference of 22 frames. So go to 5:22 in the comp (5:00 + 22 = 5:22), set a keyframe and give it a value of 9:29 (9:07 + 22 = 9:29). Time Remapping now knows where the movie ends. Go one frame to 5:23 and set a Time Remapping value of 0:00. Time Remapping now knows where the movie begins again.
Now comes the tricky part. When you go to the last Time Remapping keyframe, you see that it is past the end of the footage; the Comp window is blank. AE does this to allow looping. So we simply copy the beginning keyframes value into this final keyframe. If you preview this comp, it will never get to this last keyframe because it is one frame beyond the end of the comp. Thus, the footage plays to 4:06 in the movie then loops seamlessly to 4:07, at the first frame of the comp.
Now let's preview the Orbit comp again. That's better, we see some land now. But it still lacks something, and that something is more shadows! Remember? We said the moon should pass into the planets shadow, and it should also cast its own shadow on the planet. So let's get busy.
How do we mimic the moon passing through the planets shadow? Well, we DONT do it in the Orbit comp. Instead, we use the Moon comp. We pass a solid in front of the moon movie, coordinating its passage with the moons orbit in the Orbit comp. We have already used solids and transfer modes to mimic shadows and we'll do it again. The new twist is that this shadow will be animated with an expression.
First, let's think about that planets shadow: it will be lots bigger than the moon, and it's going to be fuzzy on the edges, right? So we will make a big solid in our Moon comp, and give it a circular mask with a feather.
How big a solid? Oh, let's not skimp say, 960x960, and name it Planet Shadow. We'll use the same Circle Mask trick again: select the oval mask tool, double-click on it to make a circle mask, then double-click on the mask itself, scale it down and reposition it in the center of the solid. I gave my planet shadow a 200 pixel feather to begin with.
This shadow needs to pass across the moon. If we're going to use an expression to animate this shadow, it would be prudent to note the beginning and ending position points of this passage. Move the shadow to the right, off the moon, and write down the x-y coordinates. Move the shadow similarly to the left and write down the x-y coordinates. Don't worry if it's not precise we easily can fix it later.
Now let's move back to the Orbit comp, and look at the moons movement. When do you think the moon ought to start passing into the planets shadow? Write that time down! When do you think the moon will have completely emerged from the planets shadow? Write that time down!
If you ever deal with time in an expression, know this: an expression does not understand frames per second. It only knows how to tell time in seconds and decimal fractions of seconds. Thus, :03:06 (PAL) is 3.25 seconds, :03:06 (NTSC) is 3.2 seconds and 00:02:28:00 is 148 seconds. Simple, huh?
Have you ever known that you could accomplish a certain effect in AE, but you didn't know how? Hands, please? Wow! Everyone except those three wise guys in the corner who write code for a living. Working in AE with the manual in your lap is a lot more common than you think, and this tutorial is for you folks.
Here's a simple definition of an expression: a statement that generates a value for a given parameter. As I kept (and still keep) reading about expressions, that's some understatement! If you saw the movie, Animal House, you may recall the motto on the statue of Eberhard Faber, the colleges founder: Knowledge Is Good. Theres another understatement.
Thus began the most painful part of my odyssey. I didn't have a clue how to use expressions. I simply pored over the manual until I had a undeveloped notion of how an expression worked. I estimate I read the chapter on expressions at least a dozen times before it began to sink in, then I collected what I knew. It was only then that the beauty of expressions started to reveal itself.
Let's review what I knew about how I wanted to animate this shadow:
Click on the triangle button next to the highlighted word position. This brings up a menu of handy expression stuff, called the Language Elements Menu. Navigate to Interpolation, and click on the phrase, linear(t, t_min, t_max, val1, val2).
Before we plug in all that specified stuff, move your cursor around this rudimentary expression until you see a double-headed arrow. This little gizmo will adjust the size of the Expression Field. Pull it down and make the window bigger. The Expression Field works just like a text editor. In it, you can replace text, cut, copy and paste text
you know the drill.
You now have a dark spot in the middle of your planet. Open the Orbit comp, move in the timeline to where you think the moon would cast a shadow, and compare your shadow to what you think the real thing should be. Adjust as necessary. To adjust the darkness of the shadow, adjust the gray level of the solid. Satisfied? Great! We can continue.
We'll make a circle mask, but we can't double-click on the Oval Mask icon because the layer isn't square if we do, we'll get an oval. We'll make it the regular way by constraining the Oval Mask to a circle with the Shift key. Make it about as big as the planet, give it about a 80-pixel feather, and position it in the center of the layer.
Switch from the Layer Window to the Comp Window. You can now check the size of your mask and the amount of feather. If the feathered mask just barely hides the planet, fine. If it's too big or too small, remember: this is AE 5.5: you can double click on the layer mask right in the comp window, then scale and reposition as necessary. Satisfied? Good.
Reposition the mask not the layer to the LEFT. This will give you a lot of layer on the right to block things. Now reposition the layer (not the mask) a bit to the RIGHT, so that it reveals a small portion of the right side the planet; we may have to tweak that position later. Move down one layer to the Moon Shadow layer, and click the Switches/Modes legend at the bottom so the little Shy Guy icons disappear. You've revealed the Modes Panel.
Want to see something cool? Go to the TOP of the panel and Control-click on it (right click in Windows), revealing a new window. Navigate to Panels>Switches and click. Poof! Now both the switches AND the Modes panels are open. Very neat, and new in AE 5.
Whoa! That track matte solid we made just disappeared! Well, not really. The transparency information we created in the track matte layer by making a mask is now being used to block the layer below it and ONLY the layer below it. And because that mask is feathered, the blocking is a gradual thing. That's right: we're using transparency to block pictures. It can work the other way around, too opaque portions of a track matte can block things, too, but you won't see them, either. Confused? Just work with it you'll get it.
To simulate the moons passage across the planet from our observers point of view, we need to make our shadow short and squat. I'm going to start with 25% horizontal scale and leave the vertical scale alone. Write down your scales. Now, position your shadow off to the left until it clears the planet. Write down the position.
We're going to animate both the scale and the position using expressions, basically the same expression for each. But instead of Linear interpolation, we're going to Ease Out of the starting position. That way, our animation will start out slowly and pick up speed as it goes along.
We'll start with position, the first property we encounter. Option-Click (Alt-Click in Windows) on the Position stopwatch. Click on the triangle, Navigate to Interpolation, and choose the bottommost expression, ease_out(t, t_min, t_max, val1, val2. Look familiar? It should, its virtually the same thing as the Linear expression we used earlier. Again, we'll use the double-headed arrow to make the Expression Field larger, and we'll assign some values to our variables. What about those time variables? Look at your orbit comp, and guess at when that shadow ought to hit. Here's the whole thing as I initially put it in:
Important Keyboard Shortcut: To reveal all the properties containing expressions in any layer, hit ee. That's the e key twice in quick succession. You can also use the u key if you wish, but you will also reveal any keyframed properties, too.
I found myself tweaking pretty much everything: gray scales on shadows, the position of the moon shadow track matte, the expression variables, you name it. But the thing was, it was really easy to do
thanks to expressions. Believe me, I didn't ever think I'd say THAT!
If you found this page from a direct link, please visit our forums or read other articles at CreativeCOW.net