Wrap Your Brain Around Nested Compositions in After Effects
If you’re getting into After Effects and you’re having a difficult time understanding compositions, precompositions and nested compositions, consider this article your guide to navigating this powerful feature.
Understanding Key Vocabulary
Composition –The framework for your movie. You must have a composition to hold your layers. These layers can be lights, vector images, raster images, solids, shapes and a few other layer types.
Precomposition – A collection of layers within another composition. You can precompose one or multiple layers that will create a composition within your original composition.
Nested Composition – This is any composition that’s inside of, and on the timeline of, another composition.
Comp and Precomp – After Effects short hand for Composition and Precomposition, respectively.
So, a precomposition and a nested composition are usually the same thing.
Compositions in the Project Panel
It’s also important for you to understand what happens when a composition of any kind is created: it is stored in the Project Panel.
Since any kind of composition is stored in the Project Panel, a composition, once created, is no different than any other composition. Let’s say you have an image of a car with wheels. The car and wheels are made up of several layers.
Precomposing Multiple Layers
In this case, it would be really beneficial to precompose the layers that make up the wheels so they can be animated to look like they’re turning.
In fact, if the wheels are identical, it would be best to simply duplicate the wheel composition and move it into place on the car as the second wheel. Any time you have a composition that’s duplicated on the timeline, it’s a reference to the one originally created in the Project Panel. You can drag the same comp from the project panel onto the timeline as many times as you want, go into that comp and make a change, and all the instances of that comp will reflect the change.
Now let’s say you have some other parts of the car that you want to combine. You can also precompose those to clean up your timeline.
In the image above, there are three precompositions in the main composition. The goal is to have the car look like it’s driving along the road. You can precompose all the compositions that make up the car into one composition that can be animated across the road.
Looking at the compositions, there's the main composition containing the road background layer and the car composition layer. Nested inside of the car composition is the composition for the car body and the compositions for the wheels. Inside each of those compositions are the layers that make up those comps.
So when you decide to precompose layers, you’re faced with one or more options for how After Effects will treat the attributes of the layers, the options presented, are dependent on how many layers will go into the Precomp. If you are precomposing several layers, you only have the choice to move all attributes into the new composition.
Attributes are things like effects and keyframes. Because there are multiple layers involved in our example, all of the the attributes must stay on the layers and go into the new precomp with the layers. However, sometimes you may want to precompose only one layer.
Precomposing a Single Layer
There are lots of reasons you might want to precompose a single layer, but let’s say, leaving our car example behind, that you want to have a star that‘s slowly shrinking and rotating. To achieve this look, you set a few keyframes on the scale and rotation property.
Now you decide that, even though you want the shrinking and rotating, you also want the star to be pulsating in size. To accomplish this additional effect, you’ll need to precompose the star layer, and, in this case, you would choose the other option: Leave all attributes in composition.
By leaving the attributes in the composition, the scale and rotation keys will stay on the outside of the precomp and an unkeyed layer for the star will go on the inside of the precomp. Now you have a layer you can set several scale keyframes on, within the precomp, to create the pulsating effect.
Nested compositions are an amazing and versatile aspect of After Effects. Even though they’re tough subjects to understand at first, mastering compositions and the right use of precompositions are cornerstones for every professional After Effects user.
You can learn more about comps, pre comps and nested compositions with tutorials to help you get started in After Effects.