In the Composition section, we described a composition as a box containing layers, similar to how a hamburger with all its composing food item layers could also be stored in a box. Just like how it’s possible to put a box into another box, it is quite possible to place a composition into another composition.
Remember that a layer is a line in the stack, and its appearance depends on the source used. The purpose of a composition is to render an image according to the stack of layers that it houses. It's therefore possible to use this resulting image as the source of a layer in other compositions. This layer is then called a sub-composition (or sub-comp for short). It's in fact a layer like the others, but this denomination allows us to indicate that a composition is used as a source by a layer.
Creating a sub-composition is done in exactly the same way as any layer. It is possible to:
- Drag and drop a composition from the Project panel into another one in the Timeline
- Define a composition as the source of an existing layer by clicking its generator slot
In both cases, your layer will reference an existing composition, visible in the Project panel. The term reference is really important here, because the source uses the result of this composition as an input image. If a change is made to this referenced composition, the source of the layer/sub-comp will automatically be updated.
If you drag and drop the same composition twice to generate two layers/sub-comps, these two layers will reference the same source. In the same way, any change made to the source composition will update the source of both layers.
The same behavior applies if you drag a composition only once, then duplicate this sub-comp to generate a second layer.
Beware of dependency loops:
Any composition can be dropped into another one, but there only one restriction. You cannot create any dependency loop. To get a better understanding of this issue, imagine you have two empty comps in the Project panel, "Comp1" and "Comp2":
- You start to double-click "Comp1" to open it in the Timeline, and you drag and drop "Comp2" as a new layer/sub-comp
- Now you double-click "Comp2" to open it in the Timeline, and you try drag and drop "Comp1" into it!
It's like putting the hamburger box into a bag, then trying to put the bag in the box. It is completely paradoxical.
That's why Autograph won't allow you to do this second drag and drop. The cursor of your mouse will be replaced by a "no-entry sign to indicate that this action is not allowed.