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 newbuilding 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 centerbuilding 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 mighthave a different set of points, that's okay, select one that's in the center, Iam 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 thisbuilt 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 calledMattePainting, it's a Targa file, just one image.You can tell by the thumbnail that this is a new building that was painted over astill 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 atthe 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 clickthis icon and because it's going to be in the wrong place compared to wherethe camera is, it disappears temporarily, that's okay, we're going to relatethe MattePainting to this null and just as a quick shortcut, I'm going toapply expression again.

I'm going to pick the position of the MattePainting, go to Animation>AddExpression 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 andactually 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 theorientation 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, soit sits right over the old one.

In fact, you can line up the old buildings, like this foreground buildingand even the tree here.So you need to adjust the Scale and the Anchor Points and in fact, in thissituation I probably need a negative anchor point value to get it back down, buteventually 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 Iput -1 in X of orientation, 4 in Y and -1 in Z, it snaps and it's almostperfect, almost the perfect match up here.Now again, if you are tracking these a little bit different, you select adifferent point, you are going to have to use different values here, you mightfind, you need a completely different anchor point, different scale anddifferent orientation.But you go through the same process, you are trying to get this lined up again, whereit 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 atthe top, carefully go over the roof line, I just want the front of the building. Now thisbuilding has a little corner to it, but I'm going to go to the corner and then down thiscorner edge, to the edge of the glass here, I'm going to cut off that browncolumn, down to here, across, back up.

So now the building is cut out, you can see how the new building lines up tothe old building really well, the roofline lines up, the edge of the building linesup, 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 trackingdata, I'm going to go back to BuildStreet composition and go ahead and drop thatnew 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 infront 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 topof 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 keepthat, this truck here on the left is trapped in the MattePainting, it's justgarbage, 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 newmask 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 thematte painting we don't want, and actually what it's doing is it's just adding a newpart 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 thiscolumn, to save the column across and then down this column here, to save thecolumn, 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 andthen start to bisect animate.So there's the last frame, definitely need to move this over, where you tweak itso 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, becauseright now, the way, I've cut it just ends suddenly, it doesn't really mesh withwhat'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 thebottom 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 thatcolumn 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, makesure everything lines up.Again, I'll leave that up to you.All right, but we used the FoundryCameraTracker to apply tracking data tothis new MattePainting.

We cut it out and then nested it into this BuildStreet Composition to get it behindthe Foreground building.

Resume Transcript Auto-Scroll

Author

Released

4/19/2013

VFX Techniques with author Lee Lanier introduces common yet critical visual effects for film and television. This installment shows how to remove an unwanted building from a live-action plate and replace it with a new digital matte painting.

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.