Can you use expressions to control the movement a camera in Adobe After Effects? Author Nick Harauz takes look at how you can use expression controls to drive automatic oscillation of a camera that we control through a slider. You’ll also look at ways to easily control camera movement between layers and depth of field by using built in menu controls.
- In this movie, we're going to take a look at how we can use expression controls to drive osculation of a camera that we can control through a slider. We're also going to look at different ways to easily control camera movement between layers and depth of field by using built in menu controls. I'm here in my chapter three, four composition and I'm just moving my playhead throughout it. What we want to do is control the movement from this first piece of text to this second piece of text, so we want to rotate the camera.
We also want to be able to frame this larger object that is closer in Z space as well as rotate it. Then, we also want to control the depth of field, so that we'll have a little bit of blur in between these two layers. Let's see how we could set this up inside of After Effects using some built in menu controls as well as a null object. The first thing we're going to start with is rotating the camera. In an earlier movie, we selected a camera, and gone to the layer menu and chosen to go to camera, create orbit null. This is going to link the camera to a null object, making it easier for us to rotate the camera around the point of interest, which happens to be this text layer.
Let's set this up to rotate from here to that next piece of text. This is the first part of our animation. I'm going to start this at two seconds and 15 frames, and what we need to keep frame is the Z rotation. So I'm going to click the stopwatch to add a keyframe at that place in time. I'm actually going to just jump three frames later by pressing command right arrow three times. I'm going to enter degree value of 10, and them I'm going to press shift command right arrow to jump 10 frames forward, followed by another two with my command right arrow, pressing it twice.
I'll enter now a degree value of -90, and let's take the first and last keyframes. I'm clicking and then shift clicking the last keyframe and pressing F9 to easy ease them. And then I'll take the middle keyframe and actually command click it to make it an Auto Bezier keyframe. Here we have a nice little animation of a rotation that sort of just starts off and then eventually rotates off to the side. So now, it's all about framing that second piece of text. One way to set this up, I'm going to just keep my null Z rotation controls showing, and actually press the J key a couple of times to move back to my first keyframe.
Just a great way of moving in between keyframes inside of After Effects. I'm going to reveal on the camera. I'm going to press P for position, and shift A for point of interest. At this point in time, at two seconds and 15 frames, I want to add a keyframe for point of interest, as well as position. Now, we want the position of this layer to be revealed slightly after the Z rotation value, 'cause there isn't animation taking place on the presets and controller texts that lasts a few seconds longer. I'm going to move to the four second mark.
This is where I want the presets and controllers to be fully in frame. An easy way to do this, I'm going to, with that camera selected, also select the text2. That's the presets and controllers text. With both of these selected, I'm going to press C to select my unified camera tool that you see here, and then with that selected I'm going to press F, and that's going to frame the presets and controllers layer. Here was an easy way to frame a layer that had a different position Z space, or just had a different position value, as well as rotation.
Of course, you can tweak this animation as you see fit, but let me just do a simple fix here of these position keyframes. I'm going to select them and then press F9 to easy ease them. Let's actually go to our text1 layer. I'll press T for opacity because we want it to fade out before we reach the presets and controllers text. I'll move back to two seconds and 15 frames. I'm actually shift clicking my playhead to just snap to those keyframes. At this time, I'm going to click to add a keyframe to the opacity of my text, one layer, and I'll press shift command right arrow to have it fade out by zero percent.
Last but not least, we can talk about controlling the depth of field of our camera. This is also something that's build into menu controls. Just to show this, I'll have my camera selected, and let's change the depth of field here on this initial C and H text over time. One way to set this up, first of all, or enable depth of field, is to double click your camera and then click this enable depth of field. We're in the camera settings dialogue box.
Once we do, we can press AA on our camera layer and we can start to play with the focus distance of the text. As I start to play with the focus distance, you can see there that my C and H presents text is now blurry. Just to demonstrate some useful controls inside of After Effects, it could be difficult to control focus distance aperture if you're not used to it. I essentially want this to be blurry until it lands here in space. What I want to do is actually add a keyframe to the focus distance at the five frame mark, just to lock this blurry value, and then I want to just basically say, please now make these two text layers in focus when the C and H lands.
I'm going to select the camera, and I'm going to select my text1. From the layer menu, I'm going to go back down to this camera controls section. This is where we added the orbit null earlier. I'm going to choose to set focus distance to layer, and right away what you can see is now your text isn't focused. What it's done is, if I reveal under the camera, I press U to reveal the keyframes, is it's actually changed the focus distance of that camera. You can see here that it again starts off a little bit blurry in it's landing place, and eventually gets in focus before that second piece of text is revealed.
You'll also notice that under the layer menu, if you go back to the camera, there is also a link focus distance to layer, which will make sure on ensure whatever layer you have selected with the camera or made in focus throughout your animation. So, it'll add a useful expression in order for you to do that. These are some useful camera controls. Not necessarily controlled by controllers like a null object, like the rotation of our camera, but built into the unified camera tool, as well as under the layer menu. Hopefully this will help you navigating your 3D space inside of After Effects.
- Creating text animation presets
- Creating custom vignette and fractal noise presets
- Creating a custom texture library
- Using a null object to control layered graphics
- Using the interpolation expression to link values
- Setting up a Universal Color Control
- Using prebuild expressions to drive camera animation and depth of field
- Creating a control layer to delay layer animation
- Saving your control layers and expressions