PreComposing - What is it?
First off a definition: PreComposing is the process of creating a separate composition out of one or more layers in your open composition.
So what's the point?
Well there are many. Too many in fact for me to list here. What I will do is explain two common uses of precomping and let you discover the others.
One reason to precomp is to avoid having the effects on a layer clipped. This can happen with many 3rd party plug-ins that warp/distort/apply particles to a layer. For the sake of this tutorial we'll use a basic, but incredibly useful effect - Compound Blur. Briefly, if you're not familiar with the Compound Blur, this effect blurs one layer based upon the luminance values of another layer selected by you. Movies make great sources for Compound Blur effects. So, to continue...
PART ONE
Step One:
(Download the project files here. The file is in .sit format. Aladdin Systems has a free Stuffit Expander utility for Windows users. Download it here. Look through the files to check your work, but you'll learn more if you create your own comps.)
Create a new Project and in that project create a new Composition "Comp 1" (mine is 720x480, 5 sec.).
Step Two:
Import a graphic - this can be your client's logo, a piece of clipart, type created in Photoshop, Illustrator, whatever. Here i've used an imaginary logo created in Photoshop, Compound Computing.psd. As you can see the image is smaller than the comp it's going into.
Next import a movie to be the source for your Compound Blur (I've included a Quicktime movie, Compound Blur Movie, in the project files).
Step Three:
Apply Compound Blur to your logo (Effects/Blur & Sharpen/Compound Blur). In the Effect Control Window there is a drop-down menu labeled "Blur Layer."
The menu should have your current layer selected. Click the menu to open it and select your blur source (Compound Blur Movie). Blur amount defaults at 20 pixels.

Now look at the comp window. You should be able to see a fair amount of blurring in the image (adjust Maximum Blur if you cannot) but it should look terrible as it's cut-off at the edges of your graphic. This, friends, is where we Precomp.

Step Four:
Select your graphic layer and select Layer/Precompose (Command+Shift+C on the Mac). This opens a Precompose box where you're given two options:

"Leave all attributes in 'Comp 1" and "Move all attributes into the new composition." ("Attributes" are all effects, keyframes, transforms, transfer modes applied to a layer.)
So how to choose?
(Note - if you Precomp only one layer you get both option, if you Precomp multiple layers you only get one option, "Move all attributes into the new composition.")
The difference between the two options is this:
"Leave all attributes in Comp 1" creates a precomposition with your one layer in it but with no effects applied to this layer. Any effects you applied to the layer remain in your original composition, now applied to the precomp. Further, the size, shape and duration of this new composition match the proporties of the precomped layer."Move all attributes into the new composition" moves the layer(s) and all effects into the new composition. There are now no effects applied to your precomposition nested in your original composition. Here, the size, shape and duration of the new composition match your original comp, not your layer proporties.
Having said all that, what to do with our Compound Blur? "Leave all attributes in Comp 1." Name it Precomp 1. (if you chose the other option "Move all attributes..." you would copy the source layer for your compound blur effect into the precomp, even if it wasn't selected, because it is linked via the compound effect to the layer you precomped)
OK, not much happened in the comp window. You will see in the time layout window that the icon for the layer changed from a Photoshop icon to a composition icon. You should also see that you have a new composition in your project window. Select the composition, Precomp 1, in your time line and type "E." You'll see that Compound Blur is still applied to the layer with your original settings.
Step Five:
Open the new composition, Precomp 1, from the project window. As you can see, this composition is now the size of your graphic, which happens to be smaller than your original compostion. Select Composition/Composition Settings (command + K on the Mac) and make this composition the same size as your original comp. Go back to your original comp and you should see your graphic beautiflly blurred with no edge clipping in sight.

RAM preview to get the full effect of using a movie as a Compound Blur source.
I've included screen grabs for this same technique but using FE Burn Film instead of Compound Blur. The benefits of precomping are a bit more obvious in this example but it would be unfair in a basic tutorial such as this to assume that everyone has all the same plugs. Click here if you'd like to see them.
---End part one.
PART TWO:
(This part uses FE Particle Systems. If you don't have FE, use another particle-based effect. The concept is the same.)
The other main reason for precomposing is to get around After Effects' render order. What's a render order? Well it's the specific sequence in which After Effects renders Masks, Effects and Transforms applied in your composition.
So what is the order? It's easy as pie to remember.
Step One:
Open up a new composition (mine's 720x480, 5:00 sec.) and create a new layer in this comp. Twirl down the arrow to the right of the layer name and you see Masks, Effects and Transform. Voila. That's the order. After Effects will always render any masks applied to a layer first, then it will render any effects and last it will render any transforms (scale, opacity, position). For the most part this is a convenient order, which is good because you can't change it. You can get around it, if you precompose.

One reason, and you'll find many as you work, you may want to get around the layer order is if you want to scale a layer but don't want to scale an effect. We'll use FE Particle Systems for this example.
Step Two:
Create a new solid (mine's called Scale + Particle Systems Solid) in your composition. Keyframe scale 100% at frame 0:00, 0% at 2:15 and 100% at 5:00 (these values are completely arbitrary and not particularly attractive - they're chosen to make the point rather than to look good). Now apply FE Particle Systems (or another particle effect generator) to taste. For this example i've left everything at default except that i've changed the Particle Animation System to Rain Drops. RAM preview. It should look pretty ghetto. The layer leaves hard egdes as it scales (the clipping problem explained above) and the particles scale along with the layer. The particles scale in conjunction with the layer because the particle effect was rendered first and the scaling (transform) rendered second.
The solution:
Create another solid (mine's called Scale Solid). Keyframe scale as above. Now precompose (Command + Shift + C). Move all attributes into new composition so that the scale happens there. Now apply FE Particle Systems to the precomp and RAM preview. Two changes should be immediately obvious. The hard edges have disappeared (clipping again) and the layer scales but the particles do not. The actual scaling of the layer is not immediately obvious, rather what you see is the area to which the particle effect is applied scales. You've forced AE to render your transform (scaling) first and your effect (Particle Systems) second. See, AE is not exactly linear when it comes to rendering w/ precomps. Precompositions and nested comps are rendered in their entirety, as units, within your compositions. All the masks in your precomp are not rendered at the same time as the masks in your composition and then all the effects in your precomp are not rendered at the same time as the effects in your comp, etc. Precomps are rendered first, all the way through - Masks, Effects, Transforms. Then, and only then, are the Masks, Effects and Transforms rendered in your composition.
What this particular use of precomping allows you to do is broadly control particle system generators without having to tweak the actual parameters of the particle system. That can be a benefit if you're new to particle systems because they typically have a lot of parameters to tweak. What i've done here with the particles can be done using the effect controls only but this is, to me at least, much easier.
I've added one more example of how you can tweak particle effects by precomping animated solids, "Multiple Animated Solids" and "Multiple Animated Solids Comp 1". Again, they're not high art but should give you an idea of how you can use precomping to control the render order in your own work.
---Barry McWilliams
|