Join Chris Meyer for an in-depth discussion in this video What could go wrong?, part of After Effects Apprentice 08: Nesting and Precomposing.
- View Offline
Trish Meyer: If you have the exercise files, go ahead and open Precompose_2-Leave. There is only one composition, the Red Apple Comp. I'll open that and we'll preview. This comp uses some of the same elements as the previous chapter, but the titles are animating and the apple is just a plain gray color. So we have the great idea of why don't we take the gray apple, this wireframe apple, and use it as a track matte? That way we can fill it with a colorful movie.
Now I could show you how to do it in an efficient way, but I thought it would be helpful if I first walk you through how not to do it, because actually how not to do it is how most people would approach the problem. But first let's understand a little more about how the apple is actually animating. I'll select the apple layer and I'll pick the Solo button just so we can focus on just this one layer. First off, notice the layer does not start until one second in. That will become important later on.
At one second, it starts fading up and it also scales up to 100%. The 3D animation itself is rotating, but it's also doing a little bit of a wiggle and that's thanks to an effect, if I select the layer and press F3, an effect called Wigglerama. If you're wondering where I found this, it's actually an animation preset that you'll find underneath Behaviors. Also notice that there's a Drop Shadow and that renders after Wigglerama. So after the apple scales up.
It has some random animation thanks to Wigglerama and that makes it look a little bit more interesting. The Drop Shadow by the way is being applied and it looks black. Let's look at the alpha channel. It's adding a black transparent shadow, so that's adding gray values to the layer's alpha channel. So that will be important in just a second. So now that we understand what the apple is doing, let's look at the movie we'll be using to fill its alpha channel with. In the Project panel, under Sources, I have a nice movie called Light Illusions.
It's got some areas that are red and pink, particularly on the left-hand side, and I think it will look good filing the apple. So let's add this movie to the composition and this is where I start going wrong. I am adding the fill movie to a composition where the matte is already animating. My first problem is that the movie is sitting on top of the matte. If you remember from the track mattes lesson, the fill always needs to be below the matte. And you might think well it's starting at time zero and my matte starts at one second, so it must be important to move it in time.
Not really. It just lines up a different part of the movie to the apple. There is my apple, so let's just see which part of the movie. I might even scale it down. There we go, something like that like that. I'll click on Toggle Switches / Modes and that will bring the Track Matte pop- ups forward and I have a choice really on whether or not I want to use the Alpha Matte which uses the alpha channel or whether I want to use it as a Luma Matte and that will take the gray values of the apple as a matte.
Because it's using the gray values, some of the apple is getting a little transparent. So I think I will use it as an alpha matte. Now we have a couple of issues. My first problem is that the apple is scaling up and as it scales up, the fill movie is not scaling with it. And as it wiggles around, it's also wiggling independently of the fill movie. I can partly solve this by opening the parent column and parenting the fill movie to the animated matte later.
Now any transformations applied to the apple will also be applied to the fill. So the fill movie will follow the scale animation at the beginning. But remember that the Wigglerama behavior continues to randomly animate the apple and because Wigglerama is an effect and the effects are not transferred from parent to child, the fill movie doesn't wiggle around as well. Since I can't think of an easy solution, I am going to have to compromise here and hope that the problem isn't too noticeable.
However, I think my client is going to notice that the Drop Shadow is no longer black. It's pink. It's getting its color from the fill movie. If you remember, when we looked at the alpha channel, while the apple was 100% solid, it's creating a drop shadow that's semitransparent and this transparency, these gray levels, are being used to make the fill movie semitransparent. Again I'm digging my hole even deeper because now I have to find another solution.
Now one solution for this problem is instead of applying the Drop Shadow to the matte, you apply a layer style to the fill. Now you can't apply a Drop Shadow because it would apply it as an effect and the effect would render before the track matte. What's kind of clever about layer styles-- and I'll select my fill movie, go down to Layer Styles, and select Drop Shadow-- is that layer styles are rendering at the end of the render order.
And they render after the track matte has already been composited. Of course this is not a great workaround, because the layer style looks a little bit different than the Drop Shadow effect applied to the two title layers. So I have to spend some time matching the look. Okay, but let's say I get that working. I like the way the fill is working. I can live with the fact that the fill movie is not bouncing around. I can match the shadow. But let's say I have another great idea and that's to apply a Distortion effect, something that really has to be applied after the track matte has been composited.
Let me give you an example. If I select the apple and apply Effect > Distort > Turbulent Displace and I displace the apple, notice it's having no effect on the fill movie. Again effects are never applied from parent to child. So let's copy that and delete it and let's apply it to the fill and now you can see that the fill movie is being distorted, but not the apple.
To distort both layers after the track matte is composited, I'll have to pre-compose and then I'll have one layer that I can apply the distortion effect to. So I select both layers, Pre-compose, and because I have two layers selected I don't have a choice which option to use. I have to move all the attributes. Attributes are all of your keyframes, all of your effects, layer styles, the position of the layer in the composition, and where it appears in time in the Timeline.
These are all attributes that are going to be moved into the pre-comp. So let's give this a name, apple + matte. We'll open the new composition, click OK and now we have our apple and track matte appearing together in the pre-comp. All of the keyframes are there. Our apple matte has Scale and Opacity keyframes as well as some effects and our fill movie has the layer style. I have just rearranged the hierarchy. So these two layers appear in one pre- comp and the output of the pre-comp is the source of layer 1 in my main comp.
Notice that the pre-comp is the same size as the main comp. Also notice it has the same duration in the Timeline. If you remembered, nothing is happening in the pre-comp for the first second and then the layer starts scaling and fading up. When I go to the main comp, however, I have a layer bar that looks like something might be happening for the first second. I call these frames empty calories. You might want to trim out the first second just to remind you that nothing is happening in this section.
But another issue I don't like is the fact that the Opacity keyframes and the Scale keyframes are appearing down in the pre-comp. I don't like to bury my keyframes. I'll also delete the layer style because I could apply a Drop Shadow effect in the top comp. I'll click on the word Opacity to select both opacity keyframes, move in time to the second keyframe, then Shift+click+ scale to select the scale keyframes. Now when I cut the keyframes, the layer will be at 100% Scale and 100% Opacity.
So I can paste my Scale and Opacity keyframes and now I have them at the top level where they are easier to manage. And let's get our Drop Shadow. We have a Drop Shadow here that we'd like to match for the apple and we'll paste and now we are kind of back in a position where we'd like to be to continue working. So now that I have both the apple and the matte as a single layer, I can apply Distortion effect, like Turbulent Displace and I can distort both the layers at the same time.
So there were a lot of steps and remember all I really wanted to do and all I've really accomplished and all of this is that I added a track matte to make the apple a little more interesting and I applied Turbulent Displace to the group. The rest of the time I spend digging a hole and then trying to solve problems with the rendering order. In the next movie I am going to show you a much better approach to accomplishing the same task and it'll be a very good example of the differences between Leave all attributes and Move all attributes.
The After Effects Apprentice videos on lynda.com were created by Trish and Chris Meyer and are designed to be used on their own and as a companion to their book After Effects Apprentice. We are honored to host these tutorials in the lynda.com Online Training Library®.
- Grouping layers by nesting and pre-composing
- Identifying and solving render order issues
- Navigating composition hierarchies
- Editing a precomp while viewing the result in another composition
- Preserving the frame rate of a nested composition