Project files: There are two After Effects (.aep) project files that support this article. You can download them both before beginning your project: Project 1 -- Project 2.
Windows users note: These files are compressed using StuffIt's .sit format, if you're on Windows and don't have the expander for Windows, download it here. It's FREE.
Precomposing in After Effects
Reading just about any post on any given day to an After Effects users group, youll run across someone (usually a newbie) asking how to do this or that effect -- or fix this or that problem arising from an effect -- and experienced AE users will immediately suggest precompose. Precomping is one of the fastest ways to fix a host of glitches and is also one of the quickest ways to build complex effects. And once you understand the use of precomposing, it is also a great management tool for keeping your projects clean and understandable. It can also be used to build templates for projects that will belong to a family or set, such as a broadcast ID package. Simply: precomposing is one of After Effects' cool features.
Isnt precomposing something my socks do if I leave them in a locker too long?
Um, no, thats decomposing and you should really try to avoid it. Precomposing is just taking one or more layers that are already in a comp and turning them into a comp of their own. To precomp one or more layers, select them and hit Shift+Control+C (thats Windows
on Mac, substitute Command for Control). Notice that the layer is now a composition within the original comp, and a new comp has appeared in your project window. Thats a precomp.
You can give it a new name if you want by selecting it (by clicking on the new comp's name on the timeline window) and hitting [Enter] or [Return] on your keyboard. It will be highlighted and now you can type in your new name and hit [Enter] or [Return] again.
If you still want to manipulate the original layers, double-click on the new comp in the project window. Now youre inside the precomp, and the layers are right in front of you waiting for manipulation. But why would you want to do this?
Avoiding Quagmires: Managing Your Comps
If youve spent more than an hour or two trying to build a complex effect, youve probably noticed that one of AEs greatest strengths is also one of its thorniest problems -- unlimited layers. Yes, you can layer to your hearts content, and you can "parent" those layers and use transfer modes and plug-ins and build a magnificent comp that will be the envy of the digital world. Now, lay that project aside for a week, and then come back to it. Youll see a bewildering comp with a zillion layers, and it will probably take you a good half hour to figure out what is doing what to whom.
Precomping can help you organize your layers into groups that make sense in terms of motion, effects or other attributes, and will be easier to navigate if you have to put that project aside for a while to work on something else.
I dont like to spend too much of my limited brain wattage hunting for imported files and pre-renders to manipulate, so I use precomps to keep things straight. I usually start building my animations in a comp I call AA-Main. AA keeps the comp at or near the top of the project window, and Main to tell me that its my main render comp. As I build the layers and apply effects to them, I create precomps for the various layers or layer groups if theyre, say, moving in unison, and all of those comps feed into the AA-Main comp. That keeps the main rendering comp fairly simple -- usually no more than about 15 layers, and each layer in this main comp has a clear name telling me what that layer is supplying to the final animation.
File management hint: Though it doesnt have much to do with precomping, another organization method I use is to take all imported image files and animations and put them into one folder in the project window. That cleans up the project window and leaves all your comps and precomps exposed for easy viewing and navigation. It also keeps imported images in one place, so that if you have to replace or edit them youll have an easier time finding them.
Applying Effects
One of the first things a young AE animator will want to do is make some text in Photoshop and import it into AE to make it fly across the screen. And, just for fun, youll probably want to add a glow or blur to it, but youve no doubt noticed what happens if you make that glow or blur too intenseit clips off not too far from the edge of the lettering, making an obvious box around your text. Not good. Precomposing the layer solves the problem. Delete the offending blur or glow effect, then precomp using Shift+Control+C, then apply the effect to the new comp and tweak to taste. Notice that no matter how extreme you go, you wont see any clipping around the text. Precomping is your friend.
Another good use of precomping involves making multiple layers do similar things. Yes, parenting can usually accomplish the same thing, but this tutorial is about precomping. For example, Im often assigned the task of creating cosmic zooms from earth into some far-off nebula that the Hubble Space Telescope has imaged. These zooms often go from 1 to 500,000 percent scale in about 20 seconds, ending on some spectacular Hubble image that was less than a pixel on the start image. Lets say we want to start with the wide shot, called Image A, and progress to the final image in the zoom, Image D, with B and C as transitional images. To build this effect, I start with the A at full resolution in its own comp, and precomp all of the other images as well. Precomping them puts them into their own comps, and at their original resolution. Ill then line up the Bs comp in the sequence to its place in the As comp, then line up the Cs comp in the second Bs comp, and Ds comp in the Cs comp. Now Ill go back to the As comp, and if you zoom in on it either with the scale tool or the magnifying glass, youll see that all the images, steps 1 through 4, are visible and in their place. Then I build one more comp and call it AA-Main. Its 720x486 to account for NTSCs resolution, and its the comp Ill use to make the zoom motion and render the final product. Drag the Image As comp into AA-Main, hit the rasterize button (the icon that looks like a sun in your timeline), and scale it down so that it fits into AA-Main. Using a combination of Exponential Scale and animating the Anchor Point, you can zoom from 1 to 500,000 scale or more smoothly and easily, and precomping makes it all possible.
One additional benefit of precomping is that it allows you to apply an effect to a layer already under the influence of other effects without deleting or deflating that influence. For instance, make a solid layer thats black and apply Path Text to it. Type in enough text to complete a full circle. (Note the lovely red text -- why on Gods green earth did Adobe set the default text color to red? Who in their right mind uses red text for broadcast design? Well, some people do, but not most Id expect. How about 80% white as a default? Now that would be useful
but I digress.) A flat circle of text is a little boring, so lets hit the R key and set it to rotate around a full turn in, say, 10 seconds. Now itll rotate, but it still looks very two-dimensional.

Apply the Basic 3D filter and set its tilt back to -45 degrees. Do a RAM preview
and see the problem. Its rotating all right, but not in any way that looks useful.

The way to make these effects work in harmony is to remove the Basic 3D effect, precomp the layer, then apply the Basic 3D and tilt back to -45 degrees. Now you have a pseudo-3D layer that, if you use masks carefully, you can wrap around another layer to give your animations a little more depth. If you have any questions, just take a look at the example project. {{precomp-ex1.aep}}

Is it Precomping or Nesting?
The AE manual makes a distinction between nesting comps, which it defines as building a comp that is used in another comp in the rendering hierarchy, and precomposing, which it defines as creating a comp from a layer that already resides in a comp. Honestly, its basically the same thing -- one comp feeding another comp on the road to rendering. The difference is that, when you nest, you build a comp and set it up to suit your needs, then place that comp into another comp along with other nested comps and layers to create your final product. When you precompose, you take a layer or layers that already live in a comp and remove them one step away from the rendering pipeline, either to apply an effect to all of them, to make them move in unison, to apply the same transfer mode to them, or something equally devious. There are at least two meaningful differences between nesting and precomposing. One real difference is the matter of attributes -- effects, etc. -- when you precomp a layer or set of layers, youre given the chance to keep or dump what youre already done to them. Precomping also sets the new comp to the same resolution as the original comp, and sets the new comps beginning at the beginning of the original. Climb inside the new comp, though, and youll see that the layers inside have kept the in and out points you had set for them prior to precomping.
Rendering for Avid
A common problem for the AE user is rendering for the Avid Media Composer. Avids native resolution is NTSC D1 720x486 with non-square pixels, but you can run into problems if you build and render in comps that begin and end with that resolution. Thats because computer monitors use square pixels, while 601 and DV video use non-square pixels. What will be circular on your computer monitor will come out oval-shaped in your Avid. One way to beat this problem is to design in the square pixel world of the computer, but make sure to render in the non-square pixel world of NTSC. Take a look at the example project. {{precomp-ex2.aep}}
It consists of two comps, one to build the effect and one to render it. The build comp is Comp 1, and has two layers -- a white background and a green circle.

Now look at AA-Main. This comp contains Comp 1, but looks completely different. Now the green circle is squashed into an oval.

Whats the difference? Comp 1s resolution is 720x540 with square pixels to match your computer, while AA-Mains resolution is 720x486, with a pixel aspect ratio matching D1/DV NTSC (non-square pixels). Comp 1 has also been shrunk to fit (Ctrl+Alt+F) AA-Main. What thats doing is converting the square pixels of computer land to the non-square pixels of TV land. When you render this and import it into your Avid, youll see that the green object is circular, as you intend. As a bonus, change the green circle to red and youve just built the Japanese flag in AE. Of course, Avid has its own way around this problem. In Media Composers Import dialogue box, youre given the choice (in the first pull-down menu) of importing footage with either square or non-square pixels. For the most part, use the ITU-R 601, non-square pixel aspect ratio. It will automatically convert anything youve rendered with square pixels into the NTSC non-square realm.
|