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

If you want to move After Effects layers with a mocha track, it is a VERY bad idea to apply the tracking data to a null object or directly to the position, scale and rotation of your layers: The result is very inaccurate, because the skew and perspective deformation of the track is ignored if you are doing that. A much more accurate way to move layers is using a corner pin effect, but with a normal corner pin, your layers are stretched into the corner pin surface which is often not what you want. The “keep current frame” option of MochaImport+ offers an 100% accurate solution that is as easy to use as a null layer.
Learn how to do “keep current frame” corner pins in less than 4 minutes!

used stock footage:
https://stock.adobe.com/video/aerial-car-driving-up-the-mountain-pass-above-the-ocean/115809300

Transcript

Hello, this is Eric D. Kirk for mamoworld.com and in this tutorial I want to explain you how to use the “Keep current frame” option of MochaImport+ to move images with your track and I also want to explain why you should never use null objects to do that, although it seems to be such a simple solution.

So here I have got this video and I already tracked the street in mocha and loaded the tracking data into MochaImport+. If you don’t know how to do that, please first watch our tutorial about Stabilized Precomps, where I explain that in full detail.

I also prepared this image here in Photoshop that we want to move with the track now. Later I want to set the blending move of the image to “multiply” to combine it with the background, but for now we keep it at “Normal” blending mode because then it is a bit easier to see what is going on.

When you want to move layers, it might seem intuitive to use the “Move Layers” function. But as you can see, this gives us a warning, because it is usually not a good idea. Let’s do it anyway and now we have a null moving with our track and the image is parented to it. As you can see it is moving with the track, but the result is not accurate at all.

So you might think that the track is not accurate and to check that let’s open mocha. In the layer properties, we set this 16×16 grid as an insert clip and now you can see that it moves very accurately with the track. So the track itself is not the problem, the problem is just how we used it!
If you take a look at the tracking options of mocha, you can see that it can track
– translation
– scale
– rotation
– skew and
– perspective deformation
If we apply the tracking data to a null layer – or actually to any layer in After Effects – then ONLY translation, scale and rotation can be applied to the layer, because After Effects layers only have transform controls for position, scale and rotation, but there is nothing like a skew or perspective property in the transform section of the layer properties.
This means, if you use null layers to move something with a track, the skew and perspective data is simply ignored and this causes a lot of inaccuracy.

Now what alternative do we have to get a 100% accurate result? We need to use a Corner Pin instead! So we delete the null again, select our image layer, choose the corner pin function and click apply.
Now we can choose the corner pin effect we want to use and also have some more options here at the bottom. The one that is very important for us now is the “keep current frame” option. This tells MochaImport+ that it should make sure that at the current frame the image stays exactly where it is and from its current location it should move with the track. In other words, it should ignore how the corners of the corner pin surface have been set inside mocha, because otherwise our image would be stretched to fit into the region that was visualized by the checkerboard.
So we make sure “keep current frame” is enabled and click “ok”.

Now you can see that with exactly the same tracking data, the result is much more accurate than it was when we used the “move layers” function.

So to finish this shot, we set the transfer mode to “Multiply” to blend it nicely with the background. Of course, we would also need to mask out the car, such that it is above the insert, but this is another story.
To summarize, what you’ve learned: When applying tracking data to the position, scale and rotation of a layer, your results are not accurate, because you ignore the skew and perspective data of the track. Instead, you can use a corner pin and if you use the “keep current frame” option of MochaImport+, you don’t need to worry about how to set the corners because MochaImport+ will move the layer based on its current position.

Again, this is Eric D. Kirk for mamoworld.com – see you next time!