Rotating Wedge: Alpha Mattes & Animated Colors

Free After Effects Tutorial

Explore the subtle art of alpha mattes and color changes in this comprehensive After Effects tutorial, perfect for adding depth and visual interest to your video transitions.

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:

Alpha Mattes, Bringing Back the Colored Wedge, Animating Instant Color Changes

Exercise Preview

preview photo wipes matte

Exercise Overview

We want the text in our composition (a hotel commercial for TV) to get wiped on and off-screen by the colored wedge, and we want that wedge to instantaneously change color right before it makes another revolution. In this exercise, we’ll work toward this final result. Along the way you’ll learn about alpha mattes and how to change linear keyframes into hold keyframes.

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.

Re-Previewing the Final Movie

  1. You should still have yourname-Rotating Wedge.aep open in After Effects. If you closed it, re-open it now by going to the Rotating Wedge folder. We recommend you finish the previous exercise (3A) before starting this one. If you haven’t finished it, do the following sidebar.

    If You Did Not Do the Previous Exercise (3A)

    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 Desktop > Class Files > After Effects Class > Rotating Wedge > Finished AE Projects.
    3. Double–click on Rotating Wedge-Ready for Alpha Mattes.aep.
    4. Do a File > Save As > Save As. Name the file yourname-Rotating Wedge.aep and save it back into the Rotating Wedge folder.
  2. If you don’t already have the final movie (Hyatt-Regency-Rotating-Wedge.mov) open, re-open it from the Rotating Wedge > Final Movie folder.

  3. Play the video, taking special notice of the following parts we haven’t worked on:

    • As the colored wedge rotates into an area where text is hiding, it wipes on (reveals) that text. You’ll notice the text is hidden from view for most of the animation, and it gets wiped out as the wedge rotates away.
    • The wedge is a different color each time it revolves around. Each color stays flat and constant throughout its time on-screen.
  4. Keep the video open so you can refer back to it as needed.

Using an Alpha Matte to Hide/Show the Text Based on the Wedge’s Movement

In the previous exercise, we added text that instantaneously changes. To add visual interest, it’s a good idea to transition that change. Instead of adding animation to the text itself, we’re going to use the colored wedge to animate our own transition.

We want the text to only show whenever the wedge intersects with it on-screen. This means we’ll need a mask of sorts. We’ll use an alpha matte, which looks through the opacity (alpha) information of one layer to show the layer below it.

  1. Switch to After Effects, where yourname-Rotating Wedge.aep is open.

  2. To best preview the alpha matte we’re about to add, slide the playhead until you see a portion of the text (but not the entire text) visible on-screen such as at 2;05.

  3. An alpha matte is composed of two layers: the layer you want to look through, and the layer you want to reveal. We want to reveal the Text, so in the Timeline, make sure that layer is selected if it isn’t already.

  4. We want the Text layer to look through the alpha (transparency) information from the Wedge layer, but the Wedge can’t be looked through because it’s not on top. Drag the Wedge layer above the Text layer so it’s the topmost layer.

  5. On the left side of the Timeline panel, near the top, look for the TrkMat column. If instead you see many switches timeline switches, go to the bottom of the Timeline and click the Toggle Switches / Modes button.

  6. Currently the Text layer’s TrkMat (Track Matte) menu is set to None. Change that to Alpha Matte “Wedge”.

    Whoa, the Wedge is now invisible and the portion of the text that is inside the colored wedge is now showing, while the part outside it is hidden!

  7. Why did this happen? Let’s zoom out to get a better look. At the bottom left of the Composition panel, click into the menu with a zoom percentage and choose 12.5%.

  8. You should see the wedge’s yellow outline. Phew, the layer isn’t gone!

    How Alpha Mattes Work

    Once a layer is made into an alpha matte, After Effects makes it invisible on-screen. That’s because it’s looking through this layer’s Opacity info to reveal the layer below it that got matted. Opaque areas become “holes” through which light comes through—the more opaque the matte layer on top is, the more the contents underneath the matte get revealed.

  9. What happens to a matte layer if we can see it? In the Timeline to the left of the Wedge layer name, click in the empty eye box eye icon to show it again.

  10. You’ll see that the color is back but the text is obscured once more. It’s like painting over a window you want to see through! Toggle its visibility back off:

    turn off matte layer visibility

    NOTE: In the Timeline directly to the left of the layer names, you’ll see icons that indicate the matte (top) layer layer matte icon and matted (bottom) layer layer matted icon. In addition, the eyeball on the matted layer looks ghostly eye icon look through because it’s looking through a layer that exerts influence but appears to no longer be there.

  11. Let’s preview! Make sure the zoom is still at 12.5%, then press the Home key (or Fn–Left Arrow) to go to 0;00.

  12. Scrub through with the playhead until you get to the end of the sequence. You’ll see the Wedge layer’s yellow outline revolve around, wiping text on and off in sync with this motion. When the wedge isn’t on-screen there’s nothing for the Text layer to look through, so the text is hidden. This gives it a nice transition!

  13. Now that we’re using our Wedge layer as a matte, we should rename it to remind us what it’s for. In the Timeline, click on the Wedge layer and press Return (Mac) or Enter (Windows). Rename it to Wedge Matte and press Return/Enter again.

  14. At the bottom of the Composition panel, click into the zoom menu and choose Fit.

Bringing Back the Colored Wedge

We just saw that if we use the wedge as a matte, it disappears because it needs to get looked through, not looked at. To get our wedge to appear so it can do all those nifty color changes we saw in the final movie, we’ll duplicate the Wedge Matte.

  1. If you aren’t already at 0;00, press the Home key (or Fn–Left Arrow) to get there.

  2. In the Timeline, select the Wedge Matte layer.

  3. Go to Edit > Duplicate (or press Cmd–D (Mac) or CTRL–D (Windows)).

  4. Select the duplicate layer and press Return (Mac) or Enter (Windows). To remind us of its purpose, rename it Color Wedge and press Return/Enter again.

  5. To make the Color Wedge layer visible:

    • In the Timeline, drag it below the Text layer. It should become Layer 3.
    • Turn on its visibility by clicking the eye eye icon.
  6. With the Color Wedge layer still selected, press the U key on your keyboard and notice that the Rotation keyframes from the Wedge Matte layer got copied over.

    That’s well-intentioned, but what if we need to edit our animation in the future? Then we’d need to make sure both sets of identical keyframes stay in sync, creating unnecessary work for ourselves. Because the two Wedge layers are based on the same animation, we should parent one to another so one of them controls the other.

  7. While we normally click the stopwatch to enable keyframing on a property, it can also remove keyframes that are already there. Click the blue stopwatch stopwatch blue (which indicates there are keyframes for this property) and voilà—the animation is gone!

  8. Under the Color Wedge layer’s Parent & Link column, drag the pick whip pick whip icon toward the Wedge Matte layer name. (Alternately, you can go into the Parent & Link menu and change it from None to 1. Wedge Matte.)

  9. Go to the Preview panel and press Play play icon to preview the animation from the beginning. Now we can actually see the wedge wipe the text on and off as it moves, and the colorful child is moving with its ghostly parent!

    NOTE: The rotation would work the same if the colored wedge was the parent and the matte was the child. Because we’re about to animate the Color Wedge’s color (which wouldn’t show up on the Wedge Matte), we made it the child instead of the parent.

Animating Instantaneous Color Changes

Let’s next change the wedge’s color. Shape layers have a Fill Color property that can be animated, so we’ll keyframe that property.

  1. We want to animate the color change starting at 0;00, so press the Home key.

  2. Select the Color Wedge layer and press UU to pull up the Fill Color property in the Timeline, as well as other settings that have changed from the defaults.

  3. Under Contents > Rectangle 1 > Fill 1 and next to Color, click the stopwatch stopwatch.

  4. Go to 4;00. Remember that you can go to the top left of the Timeline and click on the timecode timecode inline so you can type in the number.

  5. In the Tools panel at the top, in the Fill Color area tools panel fill color area, click the Color swatch to open the Shape Fill Color dialog. (If you don’t see it, choose the Rectangle tool rectangle tool.)

  6. Set the color to #AF0A0A (an appetizing red) and click OK.

  7. Go to 0;00 and slowly drag the playhead forward to preview the Color Wedge’s first revolution. Notice that by the time the wedge actually starts to wipe on-screen, the blue color is a tad more purple than we set it to in the first keyframe. As the wedge wipes on-screen, it morphs from blue into blue-gray. It turns red-gray, then red as it descends. That’s not what we had in mind…

  8. Go to the Color Wedge layer in the Timeline and under Rectangle 1 > Fill 1, use the arrow right arrow menu to expand the Color property. You should see a Value: Color bar.

    This provides a nifty visual of the color change. Right now it’s a linear change from one value to another. The Color value is constantly in flux as it shifts from the initial blue to the final red. In the spirit of flat design, we want our graphic to stay the same color whenever we see it revolving on-screen.

  9. Remember that in the last exercise, we made the text automatically change by using hold keyframes. We can do that for the Color property too—we just need to toggle the option on. Draw a selection box over the two Color keyframes.

  10. Go to Animation > Toggle Hold Keyframe.

    A hold keyframe either looks like a house on its side keyframe hold trans from linear or a square keyframe hold like we experienced with our Text layer in the last exercise. Whatever its shape, hold keyframes hold their value until they encounter a keyframe with a different value.

  11. Go back to 0;00 and drag the playhead across to preview the first two revolutions. Much better—so far, so good!

  12. Go to 7;15 in time.

  13. We can also change the Fill Color value in the Timeline. In the Color Wedge layer next to the Fill 1 > Color value, click the swatch.

  14. In the pop-up set the color to #304479 (an authoritative dark blue) and click OK.

    If you look in the Timeline, you’ll see another hold keyframe was added.

  15. In the Preview panel, press Play play icon to preview our instantaneous color changes. Flat and fabulous!

Ensuring the Logo Stays in the Title Safe Grid

We’re almost done with our animation, so now is the perfect time to add in the hotel logo and have it fade up.

  1. Our logo is going to start in time around 8;07, so get the playhead there.

  2. From the Project panel’s Assets > Vectors folder, drag Hyatt-Regency-logo.ai to the Timeline, above all other layers.

  3. Grab the inside of the [Hyatt-Regency-logo.ai] layer bar, hold Shift, and drag it so it starts at 8;07, and it will snap to the playhead when it gets close to the timecode.

  4. In the Timeline, use the arrows right arrow menu to expand into the [Hyatt-Regency-logo.ai] layer’s Transform properties.

  5. Next to Opacity, click the stopwatch stopwatch to add a keyframe.

  6. This is the beginning of our fade-in, so change the value to 0%.

  7. In the Timeline, go to 8;22 (at 29.97 frames per second, 15 frames is about a half second later).

  8. Change the Opacity to 100% to add another keyframe.

  9. Drag the playhead through the fade-up sequence. There’s nothing wrong with the fade, but by default, the logo got added in the middle of the screen. The logo is covering the most important text in our TV commercial—Stay with Us!

  10. Remember that when creating content for TV, it’s a good idea to use the Title/Action Safe grid. At the bottom of the Composition panel, click the Choose grid and guide options button grid and guides options icon and select Title/Action Safe.

  11. For best results, always play title safe with type and graphics with text! To ensure the logo text is readable on all TV screens, set the following Transform properties:

    Position: 976,892
    Scale: 65%

    NOTE: In this class we’re aiming for high definition title safety, but these values should also ensure the logo also stays in the standard definition (smaller) title safe area.

  12. With the Title/Action Safety Grid still showing, scrub through the entire video with the playhead. As you preview, notice how all the text stays within the bounds of the HD and SD title safe areas. Great, all viewers will be able to get the message!

Finishing up

  1. The last thing we want to do is add a fade-out at the end. Remember that this is best achieved by fading on a new solid color layer, above all the rest. Go to 10;15.

  2. Unlike some other editing software you may have used, fade-outs in After Effects do not involve having all of your layers go from 100% to 0% opacity. It’s easier to think of it as a fade up to a new black layer. With the topmost layer [Hyatt-Regency-logo.ai] selected, go to Layer > New > Solid.

  3. In the dialog that appears, click the Make Comp Size button.

  4. Click the Color swatch at the bottom. Type in 0 (which will get you #00,000, the hex code for black).

  5. Click OK twice to exit both dialogs.

  6. Shift–drag the new layer bar so it starts at 10;15, where the playhead is.

  7. With the [Black Solid 1] layer selected, press the T key to display the Opacity property.

  8. Next to Opacity, click the stopwatch stopwatch.
  9. Set Opacity to 0%.
  10. Press the End key (or Fn–Right Arrow) to get to the last frame at 10;29.

  11. Change the Opacity to 100%, and a new keyframe will be added.

  12. Go to the Preview panel and press Play play icon to preview the entire sequence. We’re ready to render!

  13. Do a File > Save.

Rendering the Video

  1. Let’s export our final video file! Make sure the Timeline is selected.

  2. Go to Composition menu > Add to Render Queue.

  3. In the Render Queue panel that appears at the bottom, next to Output To, click on the file name or Not yet specified.

  4. Navigate to Desktop > Class Files > After Effects Class > Rotating Wedge > Renders, name it Rotating Wedge.mov and click Save.

  5. At the top right of the Render Queue panel, click the Queue in AME button.

  6. On the right you should see Rotating Wedge-MAIN has been added to the Queue.

  7. Below the Format column, click the small arrow <a href=media encoder arrow" class="inline-img"> and choose H.264 if it isn’t already.

  8. Below the Preset column, click the small arrow media encoder arrow and choose Match Source-High Bitrate from the menu.

  9. Click the words Match Source-High Bitrate to customize these settings.

  10. In the Export Settings window that opens up, a little further down, make sure you’re viewing the Video tab.

  11. Click the Match Source button to make sure our export is the same dimensions as our sequence settings.

  12. Scroll down in the Video section and check on Render at Maximum Depth so that our video exports at a high quality.

  13. Below that, find the Bitrate Settings.

  14. Set Bitrate Encoding to VBR, 2 pass. This refers to a Variable Bit Rate and number of encoding passes.

  15. Further down in the Video section, under Advanced Settings, check on Key Frame Distance and set it to 30 to match it to our project’s frame rate.

  16. At the bottom of the Export Settings window, check on Use Maximum Render Quality.

  17. At the bottom of the window, click OK to exit out of the Export Settings.

  18. Below the Output File column you’ll see the filename and location where it’s going to save your file should already be set to your Renders folder. If it isn’t already, click the blue filepath text, and set it to Desktop > Class Files > After Effects Class > Rotating Wedge > Renders.

  19. To start the rendering/exporting process, in the top right of the Queue window, click on the green Start Queue button media encode start button.

  20. When the progress bar below the Queue panel is completely blue, the rendering is complete! Once it’s done, you can click the blue filepath below the Output File column, to go to the folder where the file is located.

  21. Open the Rotating Wedge.mp4 movie and watch your new masterpiece!

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