Adjusting the shape of the mask – Working with Masks

The neighboring objects should cast a shadow, but it shouldn’t affect the entire screen. You’ll use the Pen tools to reduce the mask to cover only the lower right section of the screen.

  1. Select the Delete Vertex tool (Delete Vertex tool icon), hidden beneath the Convert Vertex tool in the Tools panel.
  2. Click the upper left vertex to delete it.
  1. Select the Selection tool ( ) in the Tools panel, and then drag the lower left and upper right vertices closer to the lower right corner of the screen, as in the following image.
  1. Select the Add Vertex tool ( ), hidden beneath the Delete Vertex tool in the Tools panel.
  2. Add vertices to the upper path (currently a diagonal line), and then use the Convert Vertex ( ) and Selection tools to position and shape the path into a curve similar to the following images.

Feathering the edges of the shadow
Shadows rarely have sharp edges. You’ll adjust the feather for the mask so that the shadow fades into the rest of the screen.

  1. Go to 3:15.
  2. Select the Mask Feather tool ( ), hidden beneath the Convert Vertex tool ( ) in the Tools panel.
    You used the Mask Feather property to adjust the width of the feather the same amount all the way around the original mask. However, the Mask Feather tool gives you more flexibility, letting you vary the feathering width at points you define on the closed mask.
  3. In the Timeline panel, select the Shadow layer. Then, in the Composition panel, click the lower left vertex to create a feather point.
  4. Click the feather point again, and without releasing the mouse button, drag that feather point outward to increase the feathering margin for the entire mask.

Currently the feather, represented by dashed lines, extends evenly across the mask. You’ll add more feather points for greater flexibility.

  1. Click the vertex on the right side of the sea urchin.

A feathering point is created, and the feather shrinks back to the mask edge on the lower and right sides of the screen, but the feathering remains on the upper side of the mask. The objects that are casting the shadow shouldn’t be shadowed.

  1. Click the dashed line just under the vertex on the left side of the sea urchin, and drag the feathering boundary up to the screen.
  1. (Optional) Adjust the feathering elsewhere by creating a feather point on the boundary and dragging it.
    Now the shadow doesn’t appear on any of the objects.
    The shape of the shadow is good, but it’s obscuring the image. You’ll change the opacity to reduce its effect.
  2. Select the Shadow layer in the Timeline panel, and then change its Opacity value to 20% in the Properties panel.

9. Hide all properties in the Timeline panel, and then press F2 or click an empty area in the Timeline panel to deselect all layers.

Repositioning and resizing the clip – Working with Masks

The sea turtle clip is a little too big for the tablet screen and it’s not quite the right angle. You’ll convert it to a 3D layer, which will give you more control over its shape and size.

  1. Still at 2:07, select the SeaTurtle.mov layer.
  2. With the SeaTurtle.mov layer selected in the Timeline panel, click the 3D switch (3D switch icon) for the layer.

The 3D Transformation Gizmo appears in the Composition panel, and the Properties panel includes the Orientation property and multiple Rotation properties. Most properties in the Properties panel now have three values: From left to right, they represent the x, y, and z axes of the image. The z axis controls the depth of the layer. These axes are represented in the 3D Transformation Gizmo.
Note
You’ll learn more about 3D layers in Lessons 12, “Using 3D Features,” and 13, “Working with the 3D Camera Tracker.”

  1. In the Properties panel, change the Scale to 90%.
  2. Make sure the Selection tool is selected, and then use the 3D Transformation Gizmo in the Composition panel to adjust the position of the video in the screen.
    Drag the red arrow to move the layer horizontally, the green arrow to move it vertically, and the blue arrow to change the depth. Drag the ball along the curved red line to rotate the layer around the x axis; drag the green ball along the curved green line to rotate it around the y axis; and drag the blue ball along the curved blue line to rotate it around the z axis.
  3. Make any additional adjustments, including changes to the Rotation values, so that your composition resembles the following image. Your values may not match ours, depending on how you shifted the SeaTurtle layer earlier.

Tip
To specify whether the 3D Transformation Gizmo affects Rotation or Orientation values, select the Rotation tool in the Tools panel and choose an option from the Set menu. You can also type values directly in the Properties panel instead of dragging in the Composition panel.

  1. Choose File > Save to save your work.

Adjusting the opacity
The video appears abruptly. You’ll smooth its appearance by adjusting the opacity at the beginning.

  1. Make sure you are still at 2:07 in the time ruler and the SeaTurtle.mov layer is selected.
  2. In the Properties panel, change the Opacity to 0%, and then click the stopwatch icon ( ) to create an initial keyframe.
  3. Go to 3:15, and change the Opacity to 100%.
  4. Hide properties for all layers in the Timeline panel, and deselect all layers.
  5. Press the Home key or move the current-time indicator to the beginning of the time ruler, and then press the spacebar to preview your work. Press the spacebar again when you’re done.

Adding a shadow

The masked image looks convincing, but you can make it look even more realistic by adding a shadow to the screen.

  1. Click an empty area in the Timeline panel to deselect all layers, and then choose Layer > New > Solid.
  2. In the Solid Settings dialog box, name the layer Shadow, click the Make Comp Size button, choose a dark gray color (we used R=34, G=34, B=34,), and then click OK.
    Instead of trying to exactly re-create the shape of the TabletVideo.mov layer’s mask, it’s easier to copy it to the Shadow layer and adjust it.
  3. Press the Home key or move the current-time indicator to the beginning of the time ruler.
  4. Select the TabletVideo.mov layer in the Timeline panel, and press the M key to display the Mask Path property for the mask.
  5. Select Mask 1, and then choose Edit > Copy or press Ctrl+C (Windows) or Command+C (macOS).
  6. Select the Shadow layer in the Timeline panel, and then choose Edit > Paste or press Ctrl+V (Windows) or Command+V (macOS).
  7. Hide the properties for the TabletVideo.mov layer.
    This time, you want to keep the area inside the mask opaque and make the area outside the mask transparent.
  8. Select the Shadow layer, and press the F key to reveal the Mask Feather property for the mask.
  1. Change the Mask Feather value to 0 (zero).
  2. Deselect the Inverted option.

The Shadow layer now obscures the SeaTurtle.mov layer.

Creating a Bezier mask – Working with Masks

You used the Convert Vertex tool to change a corner vertex to a smooth point with Bezier handles, but you could have created a Bezier mask in the first place. To do so, click in the Composition panel with the Pen tool where you want to place the first vertex. Then click where you want to place the next vertex, and drag in the direction you want to create a curve. When you are satisfied with the curve, release the mouse button. Continue to add points until you’ve created the shape you want. Close the mask by either clicking on the first vertex or double-clicking the last vertex. Then switch to the Selection tool to refine the mask.

Feathering the edges of a mask

The mask looks good, but the edge of the screen looks a little too sharp and unrealistic. To address this, you’ll feather, or soften, the edges.

  1. Select the TabletVideo.mov layer in the Timeline panel, and press the F key to display the Mask Feather property for the mask.
  2. Increase the Mask Feather amount to 3.0, 3.0 pixels.
  1. Hide the properties for the TabletVideo.mov layer, and then choose File > Save to save your work.

Replacing the content of the mask
You are now ready to replace the background with the video of a sea turtle and blend it with the overall shot.
Tip
In effects that reference layers, you can use masks for greater control over the effect’s influence. You can also use expressions to animate mask points.

  1. In the Project panel, select the SeaTurtle.mov file and drag it to the Timeline panel, placing it below the TabletVideo.mov layer.
  1. Choose Fit Up To 100% from the Magnification Ratio pop-up menu at the bottom of the Composition panel so that you can see the whole composition.
    Note
    If you’re using a Mac with Retina display, you’ll see Fit Up To 200%.
  2. Select the Selection tool ( ), and then drag the SeaTurtle.mov layer in the Composition panel slightly to the left, centering it in the tablet screen.
  3. Go to 2:07. In the Timeline panel, drag the entire SeaTurtle.mov layer to the right so that it begins at 2:07 and ends at the same time as the TabletVideo.mov layer.

Zooming and panning by touch

If you’re using a touch-enabled device, such as a Microsoft Surface, Wacom Cintiq Touch, or multi-touch trackpad, you can use your fingers to zoom and pan. Touch gestures let you zoom and pan in the Composition, Layer, Footage, and Timeline panels.

To zoom: Pinch two fingers closer together to zoom in, or move them further apart to zoom out.

To pan: Move two fingers in unison to pan up, down, left, or right in the panel’s current view.

Inverting the mask – Working with Masks

For this project, you need everything inside the mask to be transparent and everything outside the mask to be opaque. You’ll invert the mask now.

  1. Select the TabletVideo.mov layer in the Timeline panel, and press the M key to see the Mask Path property for the mask.

Tip
Pressing the M key twice in quick succession displays all mask properties for the selected layer.
There are two ways to invert this mask: by choosing Subtract from the Mask Mode pop-up menu, or by selecting the Inverted option.

  1. Select the Inverted option for Mask 1.

The mask inverts.

  1. Press F2 or click an empty area of the Timeline panel to deselect the TabletVideo.mov layer.

Creating curved masks
Curved or freeform masks use Bezier curves to define the shape of the mask. Bezier curves give you the greatest control over a mask’s shape. With them, you can create straight lines with sharp angles, perfectly smooth curves, or a combination of the two.
You’ll use Bezier curves to adjust the mask’s edges around the fabric, red ball, and sea urchin shell that obscure part of the screen.

  1. In the Timeline panel, select Mask 1, the mask for the TabletVideo.mov layer. Selecting Mask 1 makes the mask active and also selects all the vertices.
  2. In the Tools panel, select the Add Vertex tool (Add Vertex tool icon), which is hidden behind the Pen tool.
  3. With the Add Vertex tool, click along the bottom edge of the mask to add a vertex.
  4. Drag the new vertex down to the point where the red ball intersects with the screen.
  5. Add another vertex next to the fabric, and drag it down to the point where the fabric and red ball intersect.
  6. Add vertices at the two points where the sea urchin shell intersects the bottom edge of the screen.
  1. In the Tools panel, select the Convert Vertex tool ( ), which is hidden behind the Add Vertex tool.
  2. In the Composition panel, click the vertex where the fabric and red ball intersect. The Convert Vertex tool changes the corner vertex to smooth points.
  3. Adjust the direction handles until the mask follows the contour of the fabric and the red ball.
  1. Deselect the TabletVideo.mov layer in the Timeline panel to check the edge of your mask. If you need to make adjustments, select Mask 1 in the TabletVideo.mov layer, and use the Convert Vertex tool to fine-tune the shape of the mask.
  2. Choose File > Save to save your work.

Adding Easy Ease – Animating Layers

You’ll soften the shift in time that occurs when the lights blink with Easy Ease.

  1. Click to select the keyframe at 1:00, and then click the Easy Ease icon (Easy Ease icon) at the bottom of the Graph Editor. This slows the shift into reverse so that the lights stay bright just a little longer.
  2. Click to select the keyframe at 3:00, and apply Easy Ease for the same effect.

Notice that there are Bezier handles where you added ease. You can refine the amount of ease on a transition further by dragging the Bezier handle. If you drag the handle further from the keyframe, the transition is softer; if you drag it down or closer to the keyframe, the transition is more pronounced.

  1. Go to the beginning of the time ruler, and preview the entire movie.
  1. Choose File > Save to save the final project.

Congratulations. You’ve completed a complex animation, including shifts in time. You can render and export the time-remap project if you’d like. See Lesson 15, “Rendering and Outputting,” for detailed instructions on rendering and exporting a composition.

Review questions
1 Why would you import a layered Photoshop file as a composition?
2 What is the pick whip, and how do you use it?
3 What is a track matte, and how do you use it?
4 How do you remap time in After Effects?

Review answers

1 When you import a layered Photoshop file into After Effects as a composition, After Effects preserves the layer order, transparency data, and layer styles from the source Photoshop document. It also preserves other features, such as adjustment layers and type.

2 The pick whip creates expressions that link the values of one property or effect to another layer. The pick whip is also a way to create parenting relationships. To use the pick whip, simply drag the pick whip icon from one property to another.

3 When you want one layer to show through a hole in another layer, you can use a track matte. To create a track matte, you need two layers: one to act as a matte, and another to fill the hole in the matte. You can animate either the track matte layer or the fill layer. When you animate the track matte layer, you create a traveling matte.

4 There are several ways to remap time in After Effects. Time remapping lets you dynamically speed up, slow down, stop, or reverse footage. When remapping time, you can use the values in the time-remap graph in the Graph Editor to determine and control which frame of the movie plays at which point in time. When you enable time remapping for a layer, After Effects adds a Time Remap keyframe at the start and end points of the layer. By setting additional Time Remap keyframes, you can create complex motion effects. Every time you add a Time Remap keyframe, you create another point at which you can change the playback speed or direction.

Remapping time – Animating Layers

You’re ready to manipulate the speed and direction of time in your project.

  1. With the Pre-comp 1 layer selected in the Timeline panel, choose Layer > Time > Enable Time Remapping.

After Effects adds two keyframes, at the first and last frames of the layer, visible in the time ruler. A Time Remap property also appears under the layer name in the Timeline panel; this property lets you control which frame is displayed at a given point in time.

  1. With the Pre-comp 1 layer active, choose Layer > Open Layer to open it in the Layer panel.

The Layer panel provides a visual reference of the frames you change when you remap time. It displays two time rulers: The time ruler at the bottom of the panel displays the current time. The Source Time ruler, just above the time ruler, has a remap-time marker that indicates which frame is playing at the current time.

  1. Press the spacebar to preview the layer, and notice that the source-time and current-time markers in the two Layer panel rulers are synchronized. That will change as you remap time.
    Over the first four seconds, the lights come on slowly. You’ll speed that section up so that the lights come on twice as fast.
  2. Go to 2:00, and change the Time Remap value to 4:00.
    This remaps time so that frame 4:00 plays at 2:00. In other words, the clip now plays back at twice the speed for the first two seconds of the composition.
  1. Press the spacebar to preview the animation. The composition now runs at double-speed until 2:00, and at a slower speed thereafter. Press the spacebar again when you have finished previewing the animation.

Viewing time remapping in the Graph Editor
Using the Graph Editor, you can view and manipulate all aspects of effects and animations, including effect property values, keyframes, and interpolation. The Graph Editor displays changes in effects and animations as a two-dimensional graph, with playback time represented horizontally (from left to right). In layer bar mode, in contrast, the time ruler represents only the horizontal time element, without a graphical display of changing values.

  1. Make sure the Time Remap property is selected for the Pre-comp 1 layer in the Timeline panel.
  2. Click the Graph Editor button ( ) to display the Graph Editor.

The Graph Editor displays a time-remap graph that shows a white line connecting the keyframes at 0:00, 2:00, and 10:00. The angle of the line is steep up to 2:00, and then becomes shallower. The steeper the line, the faster the playback time.

Viewing render times for layers – Animating Layers

In a complex project, it can be helpful to know which components are contributing to long render times. For example, you may find it helpful to turn off some layers or specific effects while you work on other aspects of your project.

You can see the overall render time for the current frame at the bottom of the Timeline panel. When you turn on the Composition Profiler, you can see the rendering time of each layer, effect, mask, and layer style in the current frame in the Render Time column.

  1. Click the snail icon (Snail icon) at the bottom of the Timeline panel.

The Render Time column appears in the Timeline panel, displaying the render time for each layer active in the current frame.

  1. Drag the current-time indicator across the time ruler to see how render times differ for each layer on different frames.
  2. Expand the Starburst layer. Notice that the layer styles that were applied in Photoshop increase the render time.
  1. Hide layer properties. Click the snail icon again to turn off the Composition profiler, or leave it on if you want to see how rendering times are affected by changes you make to layers.

Retiming the composition
So far, you have created a straightforward time-lapse simulation. That’s fine, but After Effects offers more ways to play with time using the time-remapping feature. Time remapping lets you dynamically speed up, slow down, stop, or reverse footage.
Tip
You can get even finer control with the Timewarp effect, which you’ll use in Lesson 14, “Advanced Editing Techniques.”
You can also use it to do things like create a freeze-frame result. The Graph Editor and the Layer panel are a big help when remapping time, as you’ll see in the following exercise, when you retime the project so that the time-lapse speed changes over the course of the movie.

Precomposing layers
For this exercise, you’ll duplicate the composition and then precompose the layers, which will be easier to remap than the original.

  1. Select the marquee composition in the Project panel, and choose Edit > Duplicate.
    A marquee 2 composition appears in the Project panel.
  2. Double-click the marquee 2 composition to open it in the Composition and Timeline panels.
  1. In the marquee 2 Timeline panel, select the Starburst layer and then Shift-select the Unlit marquee layer, so that all the layers are selected.
  2. Choose Layer > Pre-compose.
  3. In the Pre-compose dialog box, make sure Move All Attributes Into The New Composition is selected, and then click OK.

After Effects creates a new composition named Pre-comp 1, which replaces the layers you selected in the marquee 2 composition. Now you can remap all of the elements of the project at once.

Adding motion blur – Animating Layers

The text’s movement will look more authentic if it includes motion blur. You’ll add the motion blur and then set the shutter angle and phase, which control the intensity of the blur.

  1. Go to 8:00, so you can see the scrolling text well.
  2. Click Toggle Switches/Modes at the bottom of the Timeline panel.
  3. Click the Motion Blur ( ) switch for the Scroll text layer.
    After Effects enables Motion Blur for the entire composition, and the text layer appears less sharp in the Composition panel.
  4. Choose Composition > Composition Settings.
  5. In the Composition Settings dialog box, click the Advanced tab, and reduce the Shutter Angle to 90 degrees.
    The Shutter Angle setting imitates the effect of adjusting a shutter angle on a real camera, which controls how long the camera aperture is open, gathering light. Larger values create more motion blur.
  6. Change the Shutter Phase to 0 degrees, and then click OK.

Animating using the Corner Pin effect

The marquee is looking pretty good, but the starburst isn’t terribly noticeable. You’ll use the Corner Pin effect to distort it over time and draw attention to it.

Using the Corner Pin effect is similar to animating with the Free Transform tool in Photoshop—the effect distorts an image by repositioning each of its four corners. You can use it to stretch, shrink, skew, or twist an image, or to simulate perspective or movement that pivots from the edge of a layer, such as a door opening.

  1. Go to 4:00.
  2. In the Timeline panel, click the Solo switch (Solo switch icon) for both the Show title and Starburst layers.

Soloing the layers isolates them to speed animating, previewing, and rendering.

  1. Select the Starburst layer in the Timeline panel, and then choose Effect > Distort > Corner Pin. Small circles appear around the corner points of the Starburst layer in the Composition panel.
    Note
    If you don’t see the controls, choose View Options from the Composition panel menu. In the View Options dialog box, select the Handles and Effect Controls options, and then click OK.
    You’ll start by creating initial keyframes at their current locations.
  2. If the Effect Controls panel isn’t already open, choose Window > Effect Controls.
  3. In the Effect Controls panel, click the stopwatch icon ( ) next to each of the pins—Upper Left, Upper Right, Lower Left, and Lower Right—to set initial keyframes.
  1. Go to 6:00, and then drag each of the four corner-pin handles outward. With the Corner Pin tool, you can move each handle a different amount. Notice that the x and y coordinates update in the Effect Controls panel. After Effects adds keyframes.
    Instead of dragging the handles, you can manually enter the values shown in the following figure.
  1. Go to 8:00, and then drag the corner-pin handles so that the text is tilted at an angle. Your corner-pin locations should be similar to those in the figure below. After Effects adds keyframes.
  1. Click the Solo switches ( ) for the Show title and Starburst layers to restore the view of the other layers.
  2. Press the Home key or move the current-time indicator to the beginning of the time ruler. Press the spacebar to preview the entire animation, including the corner-pin effect. When you’re done, press the spacebar again.

10. Choose File > Save to save your project.

Duplicating an animation using the pick whip – Animating Layers

The Starburst layer includes the Bevel And Emboss layer style from Photoshop. You’ll animate the bevel, which makes the starburst appear backlit, so that it lights up as the marquee does.

To do this, you’ll use the pick whip to duplicate the animation you just created. You can use the pick whip to create expressions that link the values of one property or effect to another. In this case, you’ll link the opacity of the Lit marquee layer to the Depth property of the Bevel And Emboss effect in the Starburst layer.

  1. Press the Home key or move the current-time indicator to the beginning of the time ruler.
  2. Expand the Starburst layer, and then expand its Layer Styles > Bevel And Emboss properties.
  1. If necessary, enlarge the Timeline panel so that you can see both the Lit marquee and Starburst properties.
  2. Make sure the Opacity property is still visible for the Lit marquee layer.
  3. Click the pick whip icon ( ) for the Depth property in the Starburst layer, and drag it to the Opacity property name for the Lit marquee layer. When you release the mouse, the pick whip snaps, and the Depth property value is red.
  1. Expand the Depth property for the Starburst layer. An expression in the Starburst layer time ruler now reads “thisComp.layer(“Lit marquee”).transform.opacity.” This means that the Opacity value for the Lit marquee layer replaces the previous Depth value (105%) for the Starburst layer.
  1. Drag the current-time indicator from 0:00 to 4:00. Notice that the Opacity value for the Lit marquee layer and the Depth property for the Starburst layer increase simultaneously. The area around the starburst and the marquee light bulbs brighten in sync.
  1. Hide the properties for all layers to keep the Timeline panel tidy. If you enlarged the Timeline panel, return it to its original size.
  2. Choose File > Save to save your project.

About Photoshop layer styles

Adobe Photoshop provides a variety of layer styles—such as shadows, glows, and bevels—that change the appearance of a layer. After Effects can preserve these layer styles when you import Photoshop layers. You can also apply layer styles in After Effects.

Though layer styles are referred to as effects in Photoshop, they behave more like blending modes in After Effects. Layer styles follow transformations in the standard render order, whereas effects precede transformations. Another difference is that each layer style blends directly with the underlying layers in the composition, whereas an effect is rendered on the layer to which it’s applied, the result of which then interacts with the underlying layers as a whole.

The layer style properties are available for the layer in the Timeline panel.

To learn more about working with layer styles in After Effects, see After Effects Help.

Creating the composition – Animating Layers

For this lesson, you’ll use the imported Photoshop file as the basis of the composition.

  1. Double-click the marquee composition in the Project panel to open it in the Composition panel and in the Timeline panel.

Note
If you don’t see the full image, choose Fit from the Magnification Ratio pop-up menu in the Composition window.

  1. Choose Composition > Composition Settings.
  2. In the Composition Settings dialog box, change the Duration to 10:00 to make the composition 10 seconds long if it isn’t already, and then click OK.

Simulating lighting changes

The first part of the animation involves lighting the marquee. You’ll use Opacity keyframes to animate the light.

  1. Go to 4:00.

Currently, the lit background is on top of the regular (unlit) background, obscuring it so the initial frame of the animation is bright. However, you want the marquee to appear dark and then lighten. To accomplish this, you will make the Lit marquee layer initially transparent, and then animate its opacity so that the lights appear to turn on over time.

  1. Select the Lit marquee layer in the Timeline panel, and click the stopwatch icon ( ) next to the Opacity value in the Properties panel to create a keyframe. Note that the Opacity value is 100%.
  1. Press the Home key or drag the current-time indicator to 0:00. Then change the Opacity to 0%. After Effects adds a keyframe.

Now, when the animation begins, the Lit marquee layer is transparent, which allows the Unlit marquee layer to show through.

  1. Click the Play/Pause button ( ) in the Preview panel, or press the spacebar, to preview the animation.

The bulbs around the marquee transition until they are brightly lit.

  1. Press the spacebar to stop playback at any time after 4:00.
  2. Choose File > Save.