Mastering Nested Compositions in After Effects for Dynamic Photo Animations

Learn to create complex, reusable photo animations using nested compositions (precomps) in After Effects by replacing and managing media within modular comp structures.

Build reusable, modular animations in After Effects using nested compositions—also known as precomps—by creating a dynamic photo collage. This article covers how to manage and replace media, navigate precomps efficiently, and apply track mattes for seamless image integration.

Key Insights

  • Nested compositions, or precomps, allow users to embed one composition within another, enabling the reuse of design elements like wide and Polaroid-style photos across a complex animation.
  • Efficient media management is crucial; by replacing missing files in the project panel, users can quickly restore broken links when assets are moved or renamed outside of After Effects.
  • Noble Desktop’s training highlights techniques such as using the tab key to open the mini flowchart view for navigating between precomps, and applying track mattes to dynamically update photo content within templates.

This lesson is a preview from our After Effects Certification Course Online (includes software & exam). Enroll in a course for detailed lessons, live instructor support, and project-based training.

This is a lesson preview only. For the full lesson, purchase the course here.

In this lesson, we're going to work on a photo animation that will help everyone understand the idea of nested compositions. Nested comps or precomps are basically ways of having one composition inside of another. It's a way of creating kind of modular content that you can use and reuse over and over again.

But if you don't understand them, you're going to be very limited in how you can actually build more and more complex, detailed animations. So this is what we're going to make. Now in itself, it's just a couple of images because how it's built is each of these, the wide photos and the square photos, the little Polaroids, are basically the same comp.

There's one for a wide and one for a Polaroid. And what we're going to do is basically learn how to duplicate that and manage it so we can have multiple compositions and just swap out their content so we can use them over and over and over again. This will allow us to build this animation, could have hundreds of these photos still based on the same original, original content.

So for this is a starter file, photo collage started, I'm going to open that. It was made in an older version, so I'm going to say, OK, that it's got to update it. OK, and five files are missing.

So somehow it's missing these files. This happens whenever you move things, rename things, that sort of thing. I'll just say, OK.

Now in After Effects, I don't have the opportunity to do anything until I get into the application. So these little color bars indicating that I have like missing files. Now I'm still using the two views from before, which I don't actually need right now.

So I'm going to switch back to a one view. Again, I'm going to use the fit command and I can see they're missing. So I'm just going to do a search in the project panel over here for missing footage, and that's all the missing files.

Now, photo array, photo array. These are all based pretty much on the same exact. Photoshop document, there's actually one Photoshop document for everything in here, the background and the two kind of photos.

So I'm just going to right click on any one of them, let's say matte, for example, replace footage file. And then I was going to have to navigate manually where it is. I'm working in 3D is where it's looking at my last folder I used.

I go to the advanced animation folder and this is in the photo collage folder. I'm going to find media. I'm going to find images.

And the only issue is I have to know where the files are. That's why I try to keep them organized. OK, and I'm looking for photo array.

There's photo array. I'll just double click on that. So there were five files missing.

I found one, it found the other four, which is kind of funny because they're all one single Photoshop document. But now everything comes back to normal. OK, and all this is is a background image that is the great Photoshop square one and landscape one.

Now, these are both. I'm going to actually clear my search field in the project panel. Both of these are actually found in the zero zero comps folder images folder.

That's the actual Photoshop documents and everything else. And the nested comps. So there's one Polaroid, one wide photo.

Now, the graphics here are made in Photoshop, so they're all like basically a single Photoshop file. That's why they were so easy to find. So what I'd like to do is basically.

Change out the content that is in landscape one and square one. So. What we have here are called nested comps, comps inside of comps, they're also called precomps, but they're the same thing, basically.

OK, so I can either double click on one of the precomp layers. I can actually go into the project panel, double click on one of the actual source precomps, Polaroid or wide photo, same difference. But my personal favorite way of actually getting around inside nested comps is the tab key.

When you tap the tab key on your keyboard, it actually opens the mini flow chart view. And it's only useful, really, when you have precomps and it says that I'm in photo animation right now. Right now I'm in the photo animation comp and that wide photo and Polaroid are both in here.

So I'll just go to wide photo. And it takes me to the wide photo, no problem at all. And I can move these around, adjust them, that will change their position inside of the photo animation.

So I'm leaving where they are. What I actually have is a frame, which is the photo here and I have a mat right there. And it's really this, this, that basically.

Even though I can see the background color, really this is just empty space. I'll turn on a little transparency button. So that's just like empty space back there.

The space inside of the photo is in fact black. But the idea is that I can grab another image and use the mat as a track mat for it. That's my goal.

So I'm looking at my images. I'm going to look for one of them that is widescreen, logo sketch for example. I'm just going to drag that into my timeline.

And it's quite large. Okay, I can rename it. I can leave the default name, no problem at all.

It's entirely not going to affect anything. I will just scale it down a little bit using the property panel scale. I'm just going to drag it a bit.

Jerron Smith

Jerron has more than 25 years of experience working with graphics and video and expert-level certifications in Adobe After Effects, Premiere Pro, Photoshop, and Illustrator along with an extensive knowledge of other animation programs like Cinema 4D, Adobe Animate, and 3DS Max. He has authored multiple books and video training series on computer graphics software such as: After Effects, Premiere Pro, Photoshop, Illustrator, and Flash (back when it was a thing). He has taught at the college level for over 20 years at schools such as NYCCT (New York City College of Technology), NYIT (The New York Institute of Technology), and FIT (The Fashion Institute of Technology).

More articles by Jerron Smith

How to Learn After Effects

Build practical, career-focused skills in After Effects through hands-on training designed for beginners and professionals alike. Learn fundamental concepts, tools, and workflows that prepare you for real-world projects or industry certification.