Join Lee Lanier for an in-depth discussion in this video Applying artwork to a tracked null, part of VFX Techniques: Building Replacement with After Effects.
We've used the FoundryCameraTracker to produce some 3D tracking data. Now we can use that data and apply it to a matte painting to create our new building in the center. First thing we need to do though before we bring the matte painting in is create a null. This is a similar process as you might take with the After Effects Camera Tracker. So what I want to do is look for a point somewhere in the front of the center building to create a null with. So let's zoom in. I'm going to play it back to see which points stick around. A few disappear.
So in terms of points to stay around that are in the center of the building. This one right here works pretty well. Now, if you have slightly different settings on your Camera Tracker, you might have a different set of points, that's okay, select one that's in the center, I am going to select this one right here, it's about the third window up. Once it's selected, you can just click on it and it's yellow, you can go to this built in menu, and choose Create>Null Object. That creates a null. Now null here, looks like a red square. If I select that new layer however, you'll see the axis handles at the top left.
I'm going to rename this new layer, while I'm thinking of it. I'm going to call this BuildingFrontNull. So there we have a null. So let's bring in the matte painting next. So File>Import>File, this will be in the Matte folder, there is a file called MattePainting, it's a Targa file, just one image. You can tell by the thumbnail that this is a new building that was painted over a still frame from the original image sequence; that was done just to make sure the perspective fit and everything fit nicely. Also it was done to maintain some of the original parts of the center building.
In any case let's pull this down, top of the composition, here it is. Now this was painted over frame 119, so I want to make sure my timeline is at the very end on the same frame, so make it easier to line up later. So before we apply this, we need to convert this to a 3D layer, so click this icon and because it's going to be in the wrong place compared to where the camera is, it disappears temporarily, that's okay, we're going to relate the MattePainting to this null and just as a quick shortcut, I'm going to apply expression again.
I'm going to pick the position of the MattePainting, go to Animation>Add Expression and pick whip the position of the null, click off and there's the expression. So MattePainting becomes visible again, however, it's more in the foreground and actually it scales too large. Because it scales so large, it looks like it's been pushed over to the left and up. So we still need to address the anchor point and the scale and possibly the orientation to get this mapping back to where we want it. Because we are looking at the entire frame, the goal is to get that situated, so it sits right over the old one.
In fact, you can line up the old buildings, like this foreground building and even the tree here. So you need to adjust the Scale and the Anchor Points and in fact, in this situation I probably need a negative anchor point value to get it back down, but eventually I should be able to get this frame to line up with the old one. So in this situation, a scale of 54 works pretty well, also an anchor point of -989.5 in the X, -621 in the Y, and I also might need to adjust the Orientation.
It's getting close, but it's still angled because of perspective. Now if I work that orientation, I can get it closer. So small values will actually make a big difference here, so for example, if I put -1 in X of orientation, 4 in Y and -1 in Z, it snaps and it's almost perfect, almost the perfect match up here. Now again, if you are tracking these a little bit different, you select a different point, you are going to have to use different values here, you might find, you need a completely different anchor point, different scale and different orientation. But you go through the same process, you are trying to get this lined up again, where it fits the frame perfectly instead on to camera.
This is because again, the mapping was created over a top of the original frame, so I really want to get the two to match. So now, we can cut out the MattePainting. We're going to deal with just the front of the building first. We're going to treat the side of the building in a separate step. So I'm going to use my Mask Tool, my Pen Tool, to create a mask, I'll start at the top, carefully go over the roof line, I just want the front of the building. Now this building has a little corner to it, but I'm going to go to the corner and then down this corner edge, to the edge of the glass here, I'm going to cut off that brown column, down to here, across, back up.
So now the building is cut out, you can see how the new building lines up to the old building really well, the roofline lines up, the edge of the building lines up, down to the bottom. So now let's cut out, let's see what it looks like. I'm going to turn off my original street, which we're just using for tracking data, I'm going to go back to BuildStreet composition and go ahead and drop that new composition into this one. So FoundryCameraTracker, I'm going to pull that down, put that below Foreground. It needs to be behind the Foreground layer, and there it is. Because the foreground was dealt with separately on separate layers, it's now in front of this new building.
So that's looking pretty good. I'll deal with the sides separately and we'll also eventually cut off the top of the old building. For now the one thing we want to work on, maybe is the integration on the bottom better. You'll see there is this red truck here, that's trapped. We have two red trucks. Well, this red truck right here is from the still retracked, we want to keep that, this truck here on the left is trapped in the MattePainting, it's just garbage, you want to cut that out. So what I can do is go to the foreground, and actually the ForegroundMatte, remember the mask is on the ForegroundMatte for the Foreground and add a new mask here, just add a new one right here, and get by with the old one.
So what I can do is draw a U-shaped mask that basically cuts out part of the matte painting we don't want, and actually what it's doing is it's just adding a new part to the foreground. So we're retrieving part of the original footage. So a U-shape like this, I'm going across the top of this brown area down this column, to save the column across and then down this column here, to save the column, but cut out this truck. I'll go across then up here, finish the U. So what I've done is retrieve part of the original footage that way. But I kept this column right here, I kept this column right here, from the MattePainting.
Now I'm going to need to animate this mask over time. So I'll expand the ForegroundMatte look for that new mask, key on Mask Path and then start to bisect animate. So there's the last frame, definitely need to move this over, where you tweak it so it fits well, and then continue to bisect. You'll need more keyframes than I'm doing right now, but you get the idea. One last step would be to get a nicer transition on the center column, because right now, the way, I've cut it just ends suddenly, it doesn't really mesh with what's there originally, in terms of the store front.
So I'm going to draw one more little mask right here to soften it. Now I could add a feather to this mask. I could also use the Feather Tool to try to get a soft edge right here, at the bottom of the column. This shape makes it really hard though. So what I'll do instead is create a second mask, to just feather that area. So, I'm going to draw another mask, a little box mask right here. What I can do is feather that one really heavily because the two overlap, I'll get the net result of a fuzzy edge on the bottom and hard everywhere else.
So if I increase the Feather of this Mask 3, it's going to start feathering that column at the bottom. So if I try a value of say 20 or 30, and hide the mask, it starts to fade in to the background. So this might also need to be animated over time, this little box mask. So I'll do the same thing after I key it, I'll just bisect it over time, make sure everything lines up. Again, I'll leave that up to you. All right, but we used the FoundryCameraTracker to apply tracking data to this new MattePainting.
We cut it out and then nested it into this BuildStreet Composition to get it behind the Foreground building.
Learn how to track the footage with the Adobe After Effects 3D Camera Tracker, replace areas such as the sky, rotoscope moving elements such as buildings and cars, and integrate a digital matte painting so it gains appropriate shifts in perspective and scale. You'll also apply color-grading techniques and learn how to fabricate reflections. The course also covers an alternative motion-tracking workflow with the Foundry CameraTracker plugin.
- Using the After Effects 3D Camera Tracker
- Applying tracking data to 3D layers
- Constructing and refining motion graphics
- Keying out the sky
- Rotoscoping to remove and save features
- Using the Foundry CameraTracker plugin
- Creating reflections
- Color grading