download MochaImport+
https://aescripts.com/mochaimport/

Learn how to use stabilized precomps to do complex compositing tasks in After Effects in no time. In this tutorial we use a stabilized precomp to manipulate the facade of a building: We add additional windows and even an oriel. And although the camera is moving, all of this can be done in just a few minutes.

A stabilized precomp is a composition in which the tracked region no longer moves. Inside this precomp, you can make any modification – as if it were a still image – and all your changes are also automatically applied to the original perspective.

used stock footage:
https://stock.adobe.com/video/castle/72962731

Transcript

Hello, this is Eric D. Kirk for mamoworld.com and welcome to this After Effects tutorial about using stabilized precomps with our extension MochaImport+ and the mocha plugin that is bundled with After Effects.

As an example, we want to manipulate the building here and with the help of MochaImport+ this will be surprisingly simple and a lot of fun!

We start with a composition that just contains our clip and launch MochaImport+ from the Window menu. With our clip selected, we now choose the mocha version we want to work with and click on “Track”. Since we’ve chosen a plugin version of mocha, this creates a mocha effect on our layer. For standalone versions of mocha, MochaImport+ will send the clip to mocha instead.
In the effect controls, we click on the “MOCHA” button to open the mocha user interface. We are working with the “essentials” user interface, which is designed for beginners – if you are an experienced Mocha user, or are familiar with the user interface of older mocha versions, you can also switch to the “classic” user interface which contains many advanced controls.

Now we draw a mask roughly around the area that we want to manipulate and make sure that in the tracking options also perspective is enabled. With perspective enabled, tracking is slower, but often more accurate.

Now we click on “Track backwards” since we are currently at the last frame and then wait until the track is finished. Then we close mocha and save the changes.

To load the tracking data into MochaImport+, we first click on “create track data” on the mocha effect and then select the mocha layer, from which the track data should be loaded. Then we click on the “load” button to load the data from the plugin effect into MochaImport+.

Now we can create the stabilized precomp. Stabilized precomps are always created on a duplicate of the background layer. So we duplicate it and give the duplicate a meaningful name like “wall”. Then with the wall layer selected, we choose “stabilized precomp” and click apply.

In this dialog we can choose the corner pin effect that should be used to create the stabilized precomp. We use the default “CC Power Pin” here. Also make sure that the “live expressions” option is enabled, because it will allow us to adjust the region that is included in the stabilized precomp.
Finally make sure that the resolution of the precomp is set to 100%. Lower resolutions only make sense if you create stabilized precomps for very small portions of your image and want them to render a bit faster.

If we hide the background layer for a second, you can see that the stabilized precomp looks exactly like the background, but only contains the region that we tracked. It also moves with the track. In the effect controls you can see that there is a corner pin effect on the layer. It moves with the track, but since we enabled the “live expressions” option, in only has a single keyframe. We can change this keyframe now such that it contains exactly the region we want to manipulate. We set the region such that the edges of the corner pin are parallel to the wall. Then, on the left side we make it a bit larger, since we want to extend the wall in that area.

Also this new region moves accurately with our track now.
Now let’s double-click the stabilized precomp layer to open the precomp. Inside the precomp we can see the region that we have just chosen and it is perfectly stabilized. Therefore, it is easy to make any kind of manipulations here now.

Let’s duplicate our background, for example, give it the name “Window” and add a mask around this window here. Now we can move it over and maybe scale it down a bit and in just a few seconds our building has an additional window. If we go back to our main composition, you can see that the window is visible there, too, and moves accurately the the track.