# mamoworld

## Tools and Tutorials for After Effects

This After Effects tutorial is inspired by an HP commercial. You learn how to do corner pin tracking with Mocha. Actually, a simple corner pin can be done in MochaImport with just one click. But you will also learn about more advanced stuff like adding motion blur in After Effects that makes your corner pin more realistic.

Things to learn:

• Learn how to do a quick corner pin track in Mocha and how to improve the track.
• Learn how to create a corner pin with motion blur in one click, if you have Red Giant Warp.
• Learn how to create a corner pin with motion blur just with After Effects and no additional plugin even if your version of Mocha (e.g. the one included in CS4) does not support motion blur.

#### Expressions Used for the Motion Blur

for the blur direction:

```var pt1=effect("CC Power Pin 2")("Bottom Right").valueAtTime(
time-thisComp.frameDuration/2);
var pt2=effect("CC Power Pin 2")("Bottom Right").valueAtTime(
time+thisComp.frameDuration/2);

deltaX = pt1[0] - pt2[0];
if (deltaX == 0) { deltaX = 1; }
deltaY = pt1[1] - pt2[1];
sign = (-deltaX / Math.abs(deltaX)) * 90;
radians_to_degrees(Math.atan(deltaY/deltaX)) + sign
```
for the blur length:
```var vx=effect("CC Power Pin 2")("Bottom Right").velocity[0];
var vy=effect("CC Power Pin 2")("Bottom Right").velocity[0];
Math.sqrt(vx*vx+vy*vy)/50
```

#### After Effects Project Download

tut-corner-pin.zip (24,9 MB)

german version of footage (25,8 MB)

#### Comments

0 # Tom Daigon 2010-12-03 00:38
This is a spectacular tutorial that is very clearly communicated.
I thank you for also making the footage available to follow along with. Its nice to have more opportunities to refine my Mocha skills. Keep up the good work!

0 # Mathias Möhl 2010-12-03 10:49
Thank you for the encouraging feedback!

+1 # Mystic7 2010-12-03 19:55
When I click "apply" the pin positions move to the last position, not the start position. Grrrrr....

0 # Mathias Möhl 2010-12-03 20:57
Did you track it correctly in Mocha? Does the same happen if you use the tracking data contained in the project download?

0 # Mathias Möhl 2010-12-04 17:40
UPDATE:
Probelm is now solved.
This was acually a bug in MochaImport that occurs when the file you tracked didn't start at the beginning of your AE composition.

The fixed version (MochaImport 3.02) is now available for download.

0 # ISO 600 2010-12-09 09:43
well done for this training I hope you well more make advance training a bout mocha and after effect i well wait you for new training...

0 # Müd 2010-12-22 13:44
Congratullation s for this clean and welldone job!
I've a question...is there a reason to use image sequences to track something? I mean, you think is better or it's not an importanr issue...(sorry for my english)
Thanks for sharing!! Have a nice day

0 # Mathias Möhl 2010-12-22 13:49
Thank you!
I am just used to use image sequences everywhere as you don't need to rerender the entire sequence if you need to change something later. But any other file type supported by Mocha is fine. You can, for example, directly use the h264-files provided in the tutorial's download package.

0 # Abdul 2011-02-01 14:10
thank you man, i learnt a lot from this. great tutorial.

0 # Max Jackson 2011-03-04 01:30
Hi Mathias,

This has been my favorite tutorial on Mocha I've done yet. It's very basic, in-depth, shows variations, and is very practical for future usage and tutorials.

One major question if you're still reviewing this tutorial thread...

In the tutorial, the image inside the frame has a small crack of background showing through even with the added motion blur. I would like to make my track window more seamless with the frame. is that due to amount of blur or something I should redo in terms of x-splicing the track.

Thanks for making an awesome tutorial

0 # Mathias Möhl 2011-03-04 09:07
Hi Max,
you can try to enlarge the mask in AE (if you use the RG warp technique) or the blue surface rectangle in Mocha to contain more of the actual picture frame.

0 # Fabien from France 2011-03-09 18:30
Thanks Mathias for your incredible Mocha course.
Clear, easy, well done for every one.
Waiting for the next one (all of us know the time it takes
to provide such a quality tutorial, we will be patient).
Danke,
Fabien

0 # Mathias Möhl 2011-03-10 10:12
Hi Fabien,

I have already planned a few new tutorials. The next one will not be specifically about Mocha, but also related to it.

0 # Ammar 2011-03-18 21:02
Thats amazing ! well done, make more please :D:D
specially for the Motion tips that the use in the action movies AMAZING thats only what i can say, Thank u again

0 # Jake Johnson 2011-03-19 22:10
Yes, great and polished tutorial! Unfortunately, I didn't understand where CC Power Pin was used twice and one of them involved the whole plate 'unsqueezed'. You said it was just what we wanted but you didn't say WHY. I guess sometimes we need to know why we're doing something. Although, yes, I can just go through the motions. Thanks.

0 # Jake Johnson 2011-03-20 00:09
Sorry, its 'unstretched' (the checkbox in the CC Power Pin effect). It was a bit confusing that clicking on unstretched would actually stretch the image to full screen. And, why two CC Power Pins? Did the first one only define the part of the frozen frame that will be affected by the second CC Power Pin? (Since the first CC Power Pin didn't have any coordinates.)

0 # Mathias Möhl 2011-03-20 12:21
Hi Jake,
than you for this question. It is in deed a little tricky:

When you do a normal corner pin, you take an image and stretch it to fit exactly in the picture frame. For this you need one CC Power Pin Effect.

In our case we don't have the picture we want to corner pin available as a jpg or similar. We first have to extract it from the video clip. What picture do we want to corner pin? The picture of my face. Therefore, I need a second CC Power Pin to extract exactly this part of the entire scene from the clip. The 'unstretch' takes the part from the clip that is inside the picture frame and stretches it to full screen. And this is the perfect source we need for the first CC Power Pin. Is it more clear now?

+1 # Ash 2011-04-02 12:49
Hi i'm having problems using mochaimport and rg warp.
i've followed exactly your steps but when i hit apply after effects crashes. Have you any idea what i'm doing wrong?

0 # Mathias Möhl 2011-04-04 07:10
Hi Ash, do you get any error message? Is your track and composition very long (then MochaImport may also take some time)? If it still does not work, can you send me your project and tracking data?

0 # AntoxaGray 2011-04-30 21:28
Is it possible to export true 3d data (not corner pin; but X, Y and Z orientation/position) for a camera?

+1 # Mathias Möhl 2011-05-01 14:35
No, you can only export corner pin or transform data, but no true 3d data like camera movement. For this you need a matchmover software.

0 # marcos 2011-06-03 18:59
muchisimas gracias por enseñarnos. Exitos desde Argentina!!!!!, exelente plugin!!!! eres un grande!

0 # pluto 2011-07-21 02:00
Real amazing tutorial Mathias! :D... I have installed your mochaimport.jsx in my After Effects CS5 but when I import data it crash!... I can not IMPORT data from Mocha so, I saw your tuto but I can not work with it :(... Can you help me?

0 # Mathias Möhl 2011-07-21 08:01
Do you get any error message?
Depending on how fast your computer is and what function you use, it may take some time until it is finished. For long tracks or on slow machines it might be necessary to wait a few minutes until it is finished and reacts again. Does is work with short tracks (say 50 frames) ?

0 # Cris is Bliss 2011-09-05 05:04
Thank you for helping me understand how to use Mocha

0 # Joe 2011-09-10 19:09
mathias, thank you very much for this tutorial, it is extremely well done. I love the organization of it.

I do have a slight problem though. I don't have Red Giant Warp, so I'm using the steps without that. The first track worked out great. However, in the second track, after moving the four corners of the CC PowerPin to the insides of my frame, when I load the MochaImport file, the shot doesn't align within my frame. It tracks the frame ok as far as movement is concerned, but the picture doesn't align or fit in the frame. Any ideas what may have went wrong? I've checked the track in Mocha, and it appears ok... Perhaps I should just re-try...

0 # Joe 2011-09-10 19:39
Duh, never mind, I figured it out... One critical step I forgot on the second track, to realign the surface... Sorry to post a non-existant issue...

I still really love the tutorials though, wish all tutorials were so well organized.

0 # Matt C 2012-01-27 09:06
I have been working with after effects for 8 years and am a native English speaker and I must say that I think your tutorials are amazing. Very clear and extremely useful & powerful! Keep up the good work!

0 # Ruben 2012-03-16 03:22
Great Tutorial. Just opened Mocha CS 5.5 as I just got it and the tool bar icons do not match what u have. It would have been really helpful to name the toolbar icon u are selecting so I can map to what is in CS5.5. Trying to find the pdf for 1.2 so far I have been unable to track from Imagineer site.

0 # Mathias Möhl 2012-03-16 07:50
good hint, in future tutorials I will also use one of the newer versions of Mocha.

0 # Pantyhouse 2012-05-03 19:38
Thanks a lot Mathias, i know its a little bit late, but id like to congratulate you, since its an amazing tutorial.

BTW i too see your job with the Graffiti girl, comes alive.

PRETTY GOOD!!

0 # #Karthik 2013-02-23 04:57
Whenever i import i am not able to see the import .. I mean the images are not visible
please help :)
and nice tutorial :)

0 # Mathias Möhl 2013-02-23 11:16
Hi Karthik,
when you load the tracking data, nothing happens, yet, except that the status light changes. In a second step you need to apply the data to the layer (as shown in the tut).

Cheers,
Mathias

0 # Chowming 2013-03-27 14:19
I looking for this tutorial for a long time.May i downloan this tutorial?

0 # Administrator 2013-03-27 15:24
Hi Chowming,
the project file can be downloaded on this page. I think you can download the tutorial video on vimeo if you are a registered user there.

#### Add comment

Refresh

Orthopäde Steglitz Zehlendorf