You animate mask paths and shape paths in much the same way that you animate other properties: set keyframes for the Mask Path or Path property, set paths at each keyframe, and After Effects will interpolate between these specified values.
Rotoscoping (commonly known as roto) is the drawing or painting on frames of a movie, using visual elements in the movie as a reference. A common kind of rotoscoping is tracing a path around an object in a movie and using that path as a mask to separate the object from its background. This allows you to work with the object and the background separately, so you can do things like apply different effects to the object than to its background or replace the background.
After Effects includes the Roto Brush and Refine Edge tools, which can be used to accomplish many of the same tasks as conventional rotoscoping, but in far less time. For information about using the Roto Brush tool, see Roto Brush, Refine Edge, and Refine Matte.
If a background or foreground object is a consistent, distinct color, you can use color keying instead of rotoscoping to remove the background or object. If the footage was shot with color keying in mind, color keying is much easier than rotoscoping. (See Keying introduction and workflow.)
Rotoscoping in After Effects is mostly a matter of drawing masks, animating the mask path, and then using these masks to define a matte. Many additional tasks and techniques make this job easier, such as using motion tracking on the object before you begin drawing masks, and then using the motion tracking data to make a mask or matte automatically follow the object.
You can select shape layers and their components at any of four levels of selection, referred to as selection modes:
Layer selection mode
The entire shape layer is selected. Transformations apply to the transform properties for the layer, in the Transform property group that is at the same level as the Contents property group.
Group selection mode
An entire shape group is selected. Transformations apply to the transform properties for the group, in the Transform property group within the shape group in the Timeline panel.
Free-transform mode
Multiple vertices on one or more Bezier paths are selected. A free-transform bounding box is shown around the vertices in the Composition panel. By operating on this box, you can move multiple vertices with a single transformation. Transformations apply to the vertices themselves, which are contained within the Path property in the Timeline panel.
Path-editing mode
Only vertices are selected. In this mode, you can perform path-editing operations, such as adding vertices to a path and moving individual vertices.
When a pen tool is active, path-editing mode is active. To remain in path-editing mode, select the Pen tool; press V or Ctrl (Windows) or Command (Mac OS) to temporarily activate the Selection tool as needed.
A. Layer selection B. Group selection C. Free-transform D. Path editing
For information on selecting masks, see Select masks, segments, and vertices.
Press Ctrl+A (Windows) or Command+A (Mac OS) with a shape vertex selected to select all vertices on that path. Press again to select all shapes. Press again to select all layers.
To specify the size of Bezier direction handles and vertices for masks and shapes, choose Edit > Preferences > General (Windows) or After Effects > Preferences > General (Mac OS), and edit the Path Point Size value.
Unlike layers, masks can have more than one level of selection. You can select a mask as a whole path, which is appropriate when you want to move or resize a mask. However, if you want to change the path of a mask, select one or more points on it. Selected points appear solid, and unselected points appear hollow.
To specify the size of Bezier direction handles and vertices for masks and shapes, choose Edit > Preferences > General (Windows) or After Effects > Preferences > General (Mac OS), and edit the Path Point Size value.
To use the Selection tool when the Pen tool is selected, hold down Ctrl (Windows) or Command (Mac OS).
You can select only whole masks in the Timeline panel. To select individual vertices on a mask, use the Composition or Layer panel.
Locking a mask prevents you from selecting it in the Timeline, Composition, and Layer panels or setting it as a target in the Layer panel. Use this feature to avoid unwanted changes to the mask.
To unlock multiple masks at one time, select one or more layers and choose Layer > Mask > Unlock All Masks.
To isolate selected masks and hide others, choose Layer > Mask > Lock Other Masks, and then choose Layer > Mask Hide Locked Masks.
You can scale and rotate an entire mask or shape path (or selected vertices in one or more paths) using the Free Transform Points command. When you use this command, a free-transform bounding box surrounds the selected vertices, and an anchor point appears in the center of the bounding box to mark the anchor point for the current transformation. You can scale and rotate the selected vertices by dragging the bounding box or its handles. You can also change the reference point from which the vertices are rotated or scaled by moving the bounding box anchor point. The free-transform bounding box handles and anchor point exist independently of the handles and anchor point for the layer.
When you animate rotation using Free Transform Points, the vertices of the mask are interpolated in a straight line from keyframe to keyframe. For this reason, the results may be different from what you expect.
You can convert any manual Bezier mask path or manual Bezier shape path to a RotoBezier path. If the manual Bezier path has direction handles that have been adjusted, this conversion changes the shape of the path, because After Effects calculates the curvature of RotoBezier segments automatically.
The conversion of a RotoBezier path to a manual Bezier path does not change the shape of the path.
You can change a Bezier mask path using the Selection tool and pen tools in the Layer or Composition panel. You can change a Bezier shape path using the Selection tool and pen tools in the Composition panel.
The pen tools—Add Vertex, Delete Vertex, and Convert Vertex tools—are grouped with the Pen tool in the Tools panel. To reveal these tools in the Tools panel, click and hold the Pen tool in the Tools panel.
In most cases, the appropriate pen tool becomes active when you place the Pen tool pointer in a particular context. For example, the Delete Vertex tool becomes active when you place the Pen tool pointer over an existing vertex, and the Add Vertex tool becomes active when you place the Pen tool pointer over a path segment. To manually activate and cycle through these tools, press G.
When modifying a path, make sure that you click only existing vertices or segments; otherwise, you may create a new path instead.
To temporarily switch from the Pen tool to the Selection tool, press V or Ctrl (Windows) or Command (Mac OS).
Dragging a curved segment on a RotoBezier mask also moves the vertices.
To activate the Convert Vertex tool when the Pen tool is selected, hold down Alt (Windows) or Option (Mac OS).
To activate the Convert Vertex tool when the Pen tool is selected, hold down Alt (Windows) or Option (Mac OS).
The Adjust Tension pointer appears
as you drag a vertex of the RotoBezier mask.
Clicking a vertex instead of dragging sets the vertex to a corner point (100% tension); clicking again sets the vertex to a smooth point (33% tension). Dragging up or to the right decreases the tension of the selection, increasing the curve of adjacent path segments; dragging down or to the left increases the tension of the selection, decreasing the curve of adjacent path segments.
To view the tension value of a vertex, look in the Info panel as you adjust the tension.
To animate a path, After Effects designates the topmost vertex at the initial keyframe as the first vertex and numbers each successive vertex in ascending order from the first vertex. After Effects then assigns the same numbers to the corresponding vertices at all successive keyframes. After Effects interpolates the movement of each vertex from its initial position at one keyframe to the position of the correspondingly numbered vertex at the next keyframe. At any time during an animation, you can designate another vertex as the first vertex; this causes After Effects to renumber the vertices of the path. Renumbering vertices causes path animation to change, because After Effects then maps the new vertex numbers to the corresponding old vertex numbers still saved at successive keyframes.
When copying a closed path into a motion path, the vertex designated as the first vertex of the closed path is used as the beginning of the motion path. All motion paths are open paths.
Some shape path operations, such as Trim Paths, also use the first vertex as input to determine how to modify the path.
By default, when you add a vertex to a path, the new vertex appears on the path throughout the duration of the path but reshapes the path only at the time at which it was added. When you delete a vertex from a path at a specific point in time, the vertex is deleted from the path throughout the duration of the path. Prevent After Effects from adding and deleting vertices throughout the duration of the path by choosing Edit > Preferences > General (Windows) or After Effects > Preferences > General (Mac OS), and deselecting Preserve Constant Vertex Count When Editing Masks.
Note: Preserve Constant Vertex Count When Editing Masks is called "Preserve Constant Vertex and Feather Count when Editing Masks", in After Effects CC and CS6.
The vertex designated as the first vertex appears slightly larger than the other vertices in the Composition panel.
Smart Mask Interpolation provides a high level of control for creating mask path keyframes and smooth, realistic animation. After you select the mask path keyframes to interpolate, Smart Mask Interpolation creates intermediate keyframes based on settings you provide. The Info panel displays the progress of the interpolation and the number of keyframes created.
To interrupt the interpolation process, press Esc. The Info panel indicates that the process has been interrupted and reports the number of keyframes created.
Keyframe Rate
Specifies the number of keyframes that Smart Mask Interpolation creates per second between the selected keyframes. For example, a value of 10 creates a new keyframe every 1/10 of a second. Choose Auto to set the keyframe rate equal to the composition frame rate, which appears in parentheses. Create more keyframes for smoother animation; create fewer keyframes to reduce render time.
Regardless of the keyframe rate you choose, Smart Mask Interpolation always adds keyframes at the frame just after the first mask path keyframe and at the frame just before the second mask path keyframe. For example, if you interpolate between keyframes at 0 seconds and 1 second in a 30-fps composition with a keyframe rate of 10 keyframes per second, mask path keyframes are added at frame numbers 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, and 29.
Keyframe Fields
Doubles the keyframe rate. When this option is selected, and Keyframe Rate is set to the composition frame rate, a keyframe is added at each video field. Select this option for animated masking for interlaced video. If this option is not selected, the mask may slip off the object that you are attempting to key out. For more information about fields in interlaced video, see Interlaced video and separating fields.
Use Linear Vertex Paths
Specifies that vertices in the first keyframe move along a straight path to their corresponding vertices in the second keyframe. Leave this option unselected if you want some vertices to interpolate along curved paths; for example, when the desired interpolation involves rotating parts. If this option is not selected, Smart Mask Interpolation creates a natural path for the mask.
Bending Resistance
Specifies how susceptible the interpolated mask path is to bending instead of stretching. A value of 0 specifies that, as the mask path animates, it bends more than it stretches; a value of 100 specifies that the mask path stretches more than it bends.
Quality
Specifies how strictly Smart Mask Interpolation matches vertices from one keyframe to another. A value of 0 specifies that a particular vertex in the first keyframe matches only the same-numbered vertex in the second keyframe. For example, the tenth vertex in the first keyframe must match the tenth vertex in the second keyframe. A value of 100 means that a vertex in the first keyframe can potentially match any vertex in the second keyframe. Higher values usually yield better interpolations; however, the higher the value, the longer the processing time.
Add Mask Path Vertices
Specifies that Smart Mask Interpolation adds vertices to facilitate quality interpolations. In general, Smart Mask Interpolation works best when the mask paths have dense sets of vertices. Also, a vertex on the first mask path cannot match the middle of a curve or straight-line segment on the second mask path, so sometimes you must add vertices before matching to produce the desired result. Smart Mask Interpolation does not modify the original keyframes. Only the new mask path keyframes computed by Smart Mask Interpolation have additional vertices.
The value you set specifies how finely the input mask paths are subdivided. Pixels Between Vertices specifies the distance, in pixels, between vertices on the larger perimeter mask path after subdivision. Total Vertices specifies the number of vertices on the interpolated mask paths. Percentage Of Outline specifies that a vertex is added at each indicated percent of the mask path outline length. For example, a value of 5 means that a vertex is added at each successive segment of the outline that represents 5% of the total perimeter. To use only the vertices that were on the path at the first frame, do not select this option.
Smart Mask Interpolation may add vertices at existing vertex locations even if Add Mask Path Vertices is not selected. If two vertices on one mask path match a single vertex on the other, the single vertex is duplicated at the same location so that the segment between the two vertices shrinks to that location.
Matching Method
Specifies the algorithm that Smart Mask Interpolation uses to match vertices on one mask path to vertices on the other. Auto applies the matching algorithm for curves if either of the two selected keyframes has a curved segment; otherwise, it applies the polylines algorithm. Curve applies the algorithm for mask paths that have curved segments. Polyline applies the algorithm for mask paths that have only straight segments.
The mask path keyframes added by Smart Mask Interpolation are polylines when Polyline Matching Method is selected, regardless of whether the input mask paths contained curved segments.
Use 1:1 Vertex Matches
Specifies that Smart Mask Interpolation creates a vertex on one mask path that matches the same-numbered vertex on the other mask path. On each of the input mask paths, Smart Mask Interpolation matches the first vertices, the second vertices, the third vertices, and so forth. If the two paths have unequal numbers of vertices, this action may produce undesirable results.
First Vertices Match
Specifies that Smart Mask Interpolation matches the first vertices in the two mask path keyframes. If not selected, Smart Mask Interpolation searches for the best first-vertex match between the two input mask paths.
To ensure good results, make sure that the first vertices of the input mask paths match, and then select First Vertices Match.
You can adjust the area that is visible through a mask by either moving the mask in the Layer or Composition panel or panning (moving) the layer behind the mask in the Composition panel. When you move a mask, the Position values of the masked layer remain constant, and the mask moves in relation to other objects in the Composition panel.
When you use the Pan Behind (Anchor Point) tool to pan a layer behind a mask, the position of the mask remains constant in the Composition panel but changes in the Layer panel. The Position values of the masked layer change in relation to the composition. As you pan past the edges of the layer frame, the Mask Path values on the layer also change. Using the Pan Behind (Anchor Point) tool saves steps; without it, you would have to change the Position and Mask Path properties of the masked layer manually. You can animate a layer panning behind another layer by setting keyframes for the Position and Mask Path properties of the masked layer.
Select the Pan Behind (Anchor Point) tool in the Tools panel.
You can use the mask tracker to transform a mask so that it follows the motion of an object (or objects) in a movie. For more information, see Mask Tracking.
You can also use the mask tracker to accurately detect and track human faces. For more information, see Face Tracking.
You can use expressions to read and write the x and y coordinates of path points, or vertices for:
The expression methods are similar to accessing path vertices via scripting. The expression method is named points() instead of vertices() for familiarity.
You can access the expression methods using the following steps:
To create a solid layer, select Layer > Solid.
Once you create a solid, create a mask. Click Shape tool, for example, a polygon, and create a mask over the solid layer.
In the Timeline panel, twirl open the Mask properties and alt-click Mask Path.
The expression field is displayed. In the Timeline panel, click the Expression language menu and choose Path Property.
Select an expression method from the list of path point expression methods.
To learn more about the expression methods, see Expression access to paths points on shapes, masks, and brush strokes (expression reference).
Listed below are example expression methods of the following path objects:
Tips to work with these expression methods:
Create Nulls From Paths scriptUI panel allows you to create intuitive animations driven by expressions, without manually writing expressions. You can directly link different paths to shapes, shapes to solids, etc. The Create Nulls From Paths panel uses expression access to path points to automatically link the nulls, so that you don't have to write the expression yourself.
The panel creates nulls for each path point on a mask path or Bezier shape path. You can use the following buttons in the panel to direct how the nulls perform:
To open the panel, select Windows > Create Nulls From Paths.jsx.
To add a shape mask, select Layer > New > Shape Layer. Add a shape mask to the layer.
The panel works with Bezier shapes, so all the parametric shapes such as rectangle, ellipse, and star, must be converted to a Bezier shape. To convert a parametric shape to Bezier shape, twirl open the shape layer and right-click the shape path for example, Rectangle 1, and select Convert To Bezier Path.
Repeat step 2 to add more shapes.
Every Bezier shape and mask has a path. In the Timeline panel, twirl open the layers to view the paths. If you want nulls to follow path points, select a path in the Timeline panel, and click Nulls Follow Points in the Create Nulls from Paths panel.
The script generates a null for every point on the path. You can delete any nulls you don't need.
When you convert a parametric shape to a Bezier shape, After Effects adjusts the Position property of the shape. This causes an offset when the position of the nulls is calculated. To avoid the issue, set the value of the Transform property of a shape such as Transform: Ellipse 1 to zero before creating nulls.
If you want the path points to follow nulls, select a path in the Timeline panel. And click Points Follow Nulls in the Create Nulls From Paths panel.
Once you create nulls for all path points, you can attach them with each other to create animations. Nulls created with Points Follow Nulls button and nulls created with Nulls Follow Points have different colors. To attach nulls, select a null and hold down Shift as you use the pickwhip to select a parent layer and have the null's coordinates to jump to the parent layer.
After you attach all the nulls together, preview your animation to see how it works.
Sign in to your account