Vacation Stripes: Working with Masks from Illustrator

Free After Effects Tutorial

Dive deep into the intricate process of using Adobe Illustrator to create masks in After Effects, animate photo stripes sequentially, and gain fine-tuned control over your video's visible and hidden parts in this comprehensive tutorial.

This exercise is excerpted from past After Effects training materials and is compatible with After Effects updates through 2020. To learn current skills in After Effects, check out our After Effects classes and video editing classes in NYC and live online.

Topics Covered in This After Effects Tutorial:

Using Illustrator to Create Masks for After Effects, Repositioning & Resizing Masks, Animating Photo Stripes to Arrive Sequentially

Exercise Preview

preview vacation ai masks

Exercise Overview

Masks in After Effects can block out part of a layer, giving you fine-tuned control over which parts of a video are visible, and which are hidden. Masks are vector shapes, so the vector graphics powerhouse Adobe Illustrator is often the best place to draw them. In this exercise, we will import and reposition masks drawn in Illustrator so they divide a single black and white freeze frame image into five stripes we’ll animate separately.

After Effects Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

Previewing What You’ll Make in This Exercise

  1. You should still have yourname-Island Vacation.aep open in After Effects. If you closed it, re-open it now by going to File > Open Project then Class Files > After Effects Level 2 Class > Vacation Stripes. We recommend you finish the previous exercise (1B) before starting this one. If you haven’t finished it, do the following sidebar.

    If You Did Not Do the Previous Exercise (1B)

    1. If a project is open in After Effects, go to File > Save, then File > Close Project.
    2. Go to File > Open Project and navigate to Class Files > After Effects Level 2 Class > Vacation Stripes > Finished AE Projects.
    3. Double–click on Island Vacation-Ready for AI Masks.aep.
    4. Do a File > Save As > Save As. Name the file yourname-Island Vacation.aep and save it back into the Vacation Stripes folder.
  2. On the Desktop, navigate to Class Files > After Effects Level 2 Class > Vacation Stripes > Finished Clips and double–click Vacation-Stripes-AI-Masks.mov.

  3. Play the video and notice the following (you may need to slide the playhead slowly):

    • Once viewers have gotten the chance to read the title text we animated in the previous exercise, five slices of a black and white photo slide in from the bottom of the frame, covering over the title card.
    • Each slice animates separately, slowing down as it nears the top of the video.
    • Right after the last slice (the leftmost one) gets into position, the black and white freeze frame transitions into the first vacation clip, a color video of the same motorboat in the ocean.
  4. Replay the video as many times as you need—we’ll be reproducing it in this exercise. Keep it open so you can refer back to it as needed.

Setting up the Black & White Freeze Frame

  1. Switch to After Effects, where yourname-Island Vacation.aep is open.

  2. In the Timeline, make sure you are in the Vacation-MAIN tab. If you aren’t, look at the top left of the Timeline. If you see the Vacation-MAIN tab, click on its name to go into this comp. If you don’t see this tab, go to the Project panel on the top left and double–click on the Vacation-MAIN comp to open it in a new Timeline tab.

    vacation tab

  3. The black and white freeze frame you just saw in the video is a still image of the moving motorboat clip’s first frame. Go to the Project panel on the top left and use the arrows right arrow menu to expand into the Assets > Stills folder if it isn’t already.

  4. Drag motorboat-BW.jpg from the Stills to the Timeline, dropping it below the audio layer and above the [01-title-PC] pre-comp layer.

  5. We want to keep track of where each layer starts, so let’s make sure our In column is showing. Go to the right-hand side of the Timeline. If you don’t see the In column to the left of the colored layer bars:

    • Toward the left of the Timeline, CTRL–click (Mac) or Right–click (Windows) on the Layer Name or Source Name column.
    • Go to the Columns menu and check on In.
  6. In the [motorboat-BW.jpg] layer, go to the In column and click on the value.

  7. In the Layer In Time dialog that pops up, type 225 and click OK. We want the motorboat photo “slices” to arrive on the musical phrase immediately after this.

  8. Press the I key to move to the layer’s in point at 2;25.

  9. In the Timeline, click on the colored square to the left of [motorboat-BW.jpg]’s layer number and from the Label Color menu that appears, choose Yellow.

    Notice the selection handles in the Composition panel and the layer bar color in the Timeline change to Yellow. This will make it easier to see as we animate.

Using Illustrator to Create Masks in After Effects

We use vector shapes to mask in After Effects. We drew the masks in Adobe Illustrator because it’s specially designed for drawing vector graphics. After Effects works well in tandem with other Adobe products, so let’s copy the masks from Illustrator, then paste and arrange them in After Effects.

  1. Keep After Effects open and switch to the Desktop.

  2. Navigate into After Effects Level 2 Class > Vacation Stripes > Assets > Vectors and double–click motorboat-masks.ai to open it in Adobe Illustrator.

  3. Once the file opens in Illustrator, look in the docked panels at the right of the screen. Make sure you are in the Layers panel. If you aren’t, click on the tab name or go to Window > Layers.

    Notice that this file has one layer with several <Path> sublayers and an <Image> sublayer below them all. It’s locked lock column because it’s only here for your reference.

  4. Next to the topmost <Path>, click on the circle on the right to select and show the path outline. When it’s selected, it will have a blue square next to it as shown below:

    illustrator select path for reference mask

    Notice that this path (a group of points that make up a shape) is masking the exact dimensions of the artboard. When we paste the paths into After Effects, we’ll use this path as a “reference mask” to align our other masks to the comp’s edges.

  5. When copying and pasting between Adobe applications, we use the Clipboard, so we need to make sure the Clipboard preferences are set correctly. Go to Illustrator CC (Mac) or Edit (Windows) > Preferences > File Handling & Clipboard.

  6. In the Clipboard section at the bottom next to On Quit:

    • Check on AICB (no transparency support) if it isn’t already.
    • Make sure Preserve Paths is selected.

    Click OK.

  7. Go to Select > All, or press Cmd–A (Mac) or CTRL–A (Windows).

  8. Go to Edit > Copy, or press Cmd–C (Mac) or CTRL–C (Windows).

  9. Without quitting out of Illustrator, return to After Effects.

  10. With the [motorboat-BW.jpg] layer still selected, go to Edit > Paste.

  11. If you can’t see the mask outlines, go to the bottom of the Composition panel and click the Toggle Mask and Shape Path Visibility button toggle path visibility icon so it becomes blue.

  12. Press the M key to see the paths from Illustrator have been added as Masks 1–6.

  13. If you zoom in using the period (.) key and temporarily disable Toggle Mask and Shape Path Visibility toggle path visibility icon (so it becomes gray), you’ll see a few black and white vertical stripes. The masks are currently blocking out all but these areas of the [motorboat-BW.jpg] layer, showing almost all of the layer below it (the title card).

  14. To get the masks to show the JPG layer, we need to change the mask mode. With all the masks still selected, go into the menu to the right of any of the masks and change Difference to Add, as shown below:

    change motorboat mask mode

    NOTE: Both masking modes add the masks together, but the Add mode shows the layer that has the mask, and Difference adds masks unless they overlap, in which case, the lower mask is subtracted from the ones above it. For more on mask modes and to see a helpful illustration, go to Adobe’s help article at tinyurl.com/ae-mask-modes

  15. Now we need to align our masks. Unfortunately, the Align panel only works for layers. We need to see the mask outlines so we can position by eye. If you haven’t already, go back to the bottom of the Composition panel and make sure the Toggle Mask and Shape Path Visibility button toggle path visibility icon is blue.

  16. In the Composition panel, use the Arrow keys to align the “reference mask” to the edges of the comp’s frame. Feel free to zoom in (using the period (.) key) or out (using the comma (, ) key) if needed. When done, your masks should look as shown:

    motorboat align masks

  17. Click into any empty area of the Timeline to deselect everything, or go to Edit Menu > Deselect All.

  18. Now that our inside masks are in the correct place, we no longer need the “reference mask”. In the [motorboat-BW.jpg] layer, select Mask 6 and press the Delete key.

    To get the animation we want, we want each mask to be on a different layer. Let’s make five boat layers and then delete the excess masks.

  19. If we rename the layer to end with the number 1, After Effects will automatically name the duplicates starting with number 2. Select the [motorboat-BW.jpg] layer and press Return (Mac) or Enter (Windows) to start renaming.

  20. Type boat1 and press Return (Mac) or Enter (Windows) to commit the name.

  21. Go to Edit > Duplicate or use the shortcut Cmd–D (Mac) or CTRL–D (Windows).

    Notice you get a boat2 layer. Neat!

  22. Do an Edit > Duplicate (or use the shortcut) three more times until you have five boat layers ending with boat5.

  23. We want each layer to only have one mask on it. Each boat# layer should have the same Mask # associated with it. Select the boat1 layer. If the masks aren’t still showing, press the M key.

  24. To delete everything except Mask 1:

    • Click on Mask 2 and Shift–click on Mask 5.
    • Press the Delete key on your keyboard.
  25. Select the boat2 layer and press M to see its masks.

  26. To delete everything except Mask 2 (which also corresponds with its layer name):

    • Click on Mask 1 and Shift–click on Mask 5.
    • Hold Command (Mac) or Control (Windows) and click on Mask 2 to remove it from the selection.
    • Press the Delete key on your keyboard.
  27. Continue to delete all the masks on each layer except for the one associated with it. (For instance, boat3 should only have Mask 3, etc.)

    Remember that to make things easier, you can Shift–click to select all the masks, then Cmd–click (Mac) or CTRL–click (Windows) on the mask you want to keep. Then delete everything still selected.

Resizing Masks

If we look at the mask outlines in the Composition panel, it looks like there’s a bit of a gap between the rightmost mask and the mask to its left. Let’s fix that.

  1. In the Timeline, select the boat5 layer if it isn’t already.

  2. Click on the word Mask 5 to show the mask outline in the Composition panel.

  3. In the Tools panel at the top, make sure the Selection tool selection tool is highlighted.

  4. Double–click on any one of the rectangle’s corners so the mask outline turns gray and squares for resizing appear. This will allow us to transform the mask.

  5. Hover over the left edge resize square until you see resize handles resize bar. Click and drag towards the left a couple of pixels so that it overlaps with the mask beside it.

    TIP: To check your work, feel free to zoom in to at least 400% using the period (.) key and temporarily switch off Toggle Mask and Shape Path Visibility toggle path visibility icon. Turn it back on when done.

  6. Go to the bottom left of the Composition panel and from the Magnification ratio popup menu with a zoom percentage, choose Fit.

Animating the Five Stripes to Arrive Sequentially

We’ll animate each of the image stripes to come on-screen with slightly different timing. The boat is the focal point of the image, so let’s make its mask (Mask 4) arrive first.

  1. In the Timeline, select the boat4 layer and press the P key.

    The Mask Path Property

    Each mask has a Mask Path property that can be animated. It’s useful to animate it whenever you want a mask to expand, contract, or do some other movement. So why are we animating the layer’s Position property instead?

    We’re doing so because we are assembling the image from slices made using masks. We are physically moving the masked artwork. If we were animating the masks, the artwork would remain static and the mask shape would reveal the artwork slice by slice, like rows of wallpaper being rolled on (versus panels of artwork sliding on).

    In addition, layers have an anchor point anchor point in sidebar from which positions are calculated, allowing you to enter exact coordinates if you want. Masks, however, do not. To move a mask, you would need to position by eye.

    When keyframing the Mask Path property, you’re telling After Effects what you want the mask’s shape to look like at a given point in time. Because there’s no coordinates for that, there are no dimensions that you can separate. So you cannot use the Value Graph to customize a Mask Path ease! That’s why when we animate this property in a later exercise, we won’t use the Graph Editor.

  2. While we’ll be using the Keyframe Velocity dialog to speed up our workflow, let’s make sure we can also check our work in the Value Graph. CTRL–click (Mac) or Right–click (Windows) on the word Position and select Separate Dimensions.

  3. Click in an empty area of the Timeline to deselect both the separated properties.

  4. Move the playhead to 3;25, when we want this layer to fully cover up the title card.

  5. Next to Y Position (which should currently be 373), click the stopwatch stopwatch to add a keyframe.

  6. We want each slide animation to last for 1 second, so press the I key to go back to the layer’s in point at 2;25.

  7. Change Y Position to 1129, placing the stripe fully off-screen at the bottom.

  8. On the right-hand side of the Timeline, select both keyframes by drawing a selection box selection box around keyframes around them.

  9. Go to Animation > Keyframe Assistant > Easy Ease or use the shortcut F9.

  10. Click in an empty area of the Timeline to deselect the two keyframes.

  11. CTRL–click (Mac) or Right–click (Windows) on the first keyframe keyframe start easy ease and choose Keyframe Velocity.

  12. Under Outgoing Velocity, change the Influence to 20% and click OK.

  13. CTRL–click (Mac) or Right–click (Windows) on the second keyframe keyframe end easy ease and choose Keyframe Velocity.

  14. Under Incoming Velocity, change the Influence to 90% and click OK.

    NOTE: Because our first keyframe has a small amount of influence on the animation, the stripe will have a tiny slowdown at the beginning of the sequence. The second keyframe slows it down much more radically, so the sequence will start pretty fast, then slow to a crawl as the stripe gets closer to the top of the comp frame. To see what the curve looks like in the Value Graph, at the top of the Timeline you can click the Graph Editor icon graph editor icon, and then the Fit all graphs to view icon fit graph to view icon at the bottom of the Graph Editor.

  15. Because the Position property has coordinates associated with it, we can copy these keyframes to the other boat layers (which isn’t the case with the Mask Path property). After Effects will even separate the dimensions for us automatically! Under boat4, click on the word Y Position to select both the keyframes.

  16. Do an Edit > Copy or press Cmd–C (Mac) or CTRL–C (Windows).

  17. Move the playhead to 2;27.

  18. Select boat5 and paste the keyframes by going to Edit > Paste or pressing Cmd–V (Mac) or CTRL–V (Windows).

  19. Press U to view the keyframes.

  20. To finish up our animation sequence, go to the timecodes indicated and paste the keyframes onto the following layers. Be sure to press U after pasting, to check your keyframe placement.

    2;28: boat3
    3;00: boat2
    3;02: boat1
  21. Hit Spacebar to play back and see our completed sequence. Nice!

Transitioning to the Color Motorboat Clip

  1. The next thing we need to do is shorten the freeze frame layers and titlecard so they won’t be visible when the clip of the motorboat in the ocean shows up. In the Timeline, click on the boat5 layer and Shift–click on 01-title-PC.

  2. To figure out where we need to cut these layers, use keyframe navigation as follows:

    • Press the U key on your keyboard to view all the keyframes in these layers.
    • Pressing the J key will go back in time to the closest keyframe before the playhead. Pressing K will go forward one keyframe past the playhead. Press whichever key combination that will get you to the last one (at 4;02).
  3. We want the freeze frame to disappear at 4;02, but it’s important to keep in mind that when you shorten layers in After Effects, it includes one more frame. Press Cmd-Left Arrow (Mac) or Page Up (Windows) or Fn–Up Arrow on a Mac laptop, to go back one frame to 4;01.

  4. Press Opt–] (Mac) or ALT–] (Windows) to set the out points to 4;01 (which means they won’t be on-screen in the next frame).

  5. We want the colored video clip to appear at 4;02, so press the Cmd-Right Arrow (Mac) or Page Down key (Windows) or Fn–Down Arrow on a Mac laptop, to go forward one frame in time.

  6. Go to the Project panel, and from the Assets > Clips folder drag 01-motorboat.mov into the Timeline, dropping it between boat1 and [01-title-PC].

  7. In the [01-motorboat.mov] layer’s In column, click on the timecode.

  8. In the Layer In Time dialog that pops up, set it to 402 and click OK.

  9. To the left of the [01-motorboat.mov] layer number, click on the colored square and choose the Yellow label color to match the other layers associated with the boat.

  10. Select all the Yellow layers: click on boat5 and Shift–click on [01-motorboat.mov].

  11. Let’s group these layers into a pre-comp to keep things organized. Go Layer > Pre-compose and make sure the following options are set:

    • Name it 01-Trans to Motorboat-PC (to remind us it’s a P re-C omp).
    • Make sure Adjust composition duration to the time span of the selected layers is checked on.
    • Check off Open New Composition if it isn’t already.

    Click OK.

  12. To keep the Project panel on the top left organized, we created a Pre-comps folder for you. Go to the panel and drag 01-Trans to Motorboat-PC into the folder.

  13. Do a File > Save and leave this project open. We’ll finish it up in the next exercise.

Kalika Kharkar Sharma

Kalika Kharkar Sharma is a professional animator and motion designer. She has worked on projects for some of the world's leading studios and companies, creating innovative and entertaining motion graphics and character animations. Kalika is passionate about helping others learn the craft of animation and has taught at several universities and academies.

More articles by Kalika Kharkar Sharma

How to Learn After Effects

Master After Effects with Hands-on Training. After Effects is the Industry-standard Application for Motion Graphics, Animation, and Visual Effects.

Yelp Facebook LinkedIn YouTube Twitter Instagram