Join Chris Meyer for an in-depth discussion in this video Obscuration and exclusion, part of Screen Replacement with After Effects and mocha AE.
Now, as I mentioned in the previous movie, whenever you have anything that's obscuring the main plane you want to track in Mocha, you want to set up an exclusion layer, to say don't track those items. Now, these hands are very obvious. You know, they're moving in front of that screen that we want to track. But, there's other things to watch out for. For example, if this screen was very reflective and it had a reflection of the user in this screen, those reflections might be moving counter to the movement of the rest of the screen and you'd want to exclude that as well.
You basically want to exclude any information that does not match the main movement of the screen. There's two ways to set up exclusion zones. One, if you have an intersection of two different shapes on the same layer, Mocha will not track what's inside that intersection. To draw a second shape on the same layer, I would not use the x spline tool. But the x spline plus. That says add a spline to this layer instead of starting a brand new layer. I would just start to outline these hands and key frame those from frame to frame.
However, another workflow that I personally prefer is to set up my exclusion zone on a separate layer. So I'm going to undo that shape, name this first layer Screen. Choose my X Spline tool. And now, using it, will create a second layer. As soon as I click, you'll see a new layer has been created. I'm going to outline these hands. And now you see where the automatic rounding of the X Splines come in very handy. And Mocha will automatically set a key frame on that frame of the animation.
Mocha has an automatic key frame mode by default. That means whenever I move the time indicator to a new frame, it will automatically place a new key frame as I edit these points. That's very different than the way masking works in After Effects where first you need to enable masking for the mass shape. Then go edit your mask. Just to be complete, I'm going to go ahead and name this Exclusion and give it a different color to help me differentiate the different mass shapes. Click OK. Now let's move along and watch the movement of those hands. You'll notice that I don't need to be very tight about my shape around these hands.
I basically just want to exclude most of their movement. I want to increase the number of viable pixels that Mocha is using, when it's doing a track, by excluding bad pixels on the shape. Therefore I don't need to to a full-blown rotoscoping job and get really accurate here. I just need to make sure that I'm getting most of those pixels removed from my desired tracking plane throughout this animation. Like, that case there where that knuckle goes slightly outside, that's not really something to worry about, but since I'm here, I'll go ahead and make that key frame.
And I'll just create a couple more quick key frames here to show you what's involved. I'm trying to stay somewhat tight, because I'm trying to increase the number of good pixels, Mocha tracks. But again, this is not like a rotoscoping job on a feature film, where you have to be really tight. Just set the balance in Mocha's favor so most of the pixels it sees are good pixels. Now you might ask, how am I deciding where to set these key frames. I'm basically looking for extremes in the movements.
Like, watch this hand on the left here as it goes up and down again. I want to key frame that extreme of the movement. And then let Mocha interpolate in between those end points or those key frames of the animation. So, back down here, put another key frame there. And I'm not going to labor this too much as I know this gets very boring to watch. You know the hands keep the same position for most the time there, so I'm going to go ahead and just insert another key frame with those same values to keep that mask shape the same and go a little bit lighter here to where the knuckles are at a high spot.
And update that mask, and tighten up a little bit on that. Anything else going on here? I can probably lower this at the end. I'm going to press the space bar, just play it back and forth. Watch my animation, and I see that my animated mask is indeed enclosing most of those hands during the course of this animation. Increasing the odds that Mocha's going to do an accurate track. Now there's one more crucial thing that you need to do when setting up an exclusion layer. You need to turn off the process icon for that exclusion layer.
The way that Mocha's logic works is, it will track the layer that has the process icon turned on. And then exclude layers above that tracking layer that have the process icon turned off. So exclusion goes above your main tracking. Process is off for exclusion, on for the tracking layers, and I tend to select the tracking layer just as an additional reinforcement of what I'm doing. Okay, now that that's done, in the next movie we'll actually perform the track and see how good it turns out.
This course was created and produced by Chris and Trish Meyer. We're honored to host this content in our library.
- Tracking in mocha AE
- Corner pinning in After Effects
- Rotoscoping with Roto Brush and Refine Edge
- Matching color and depth of field
- Reversible stabilization with Warp Stabilizer VFX