Newbie - How to Replace an Object

I have an oblong object that moves in an irregular way that I want to replace with another object. The 1 side of the object sometimes gets blocked. Can this be done in Mocha stand-alone? If so, can someone give me the basic steps I would need to take to do this?

Thanks much.

I would try using the insert tool for this. But I need more information to give specifics.

Does the insert tool work with shapes like glasses, where they are almost identical but not quite? Are you given an opportunity to shape so they are as close to the same as can be and do the replacement?


Yes, you can use the grid warp. This is for premiere, but will work in any version of Mocha: Boris FX | Track and Replace Logos on Curved Surfaces

So the surface tool determines where the inserted object goes? Are you limited to a 4-point, straight sided tool? What if you want to insert a more complex object? How do you establish the section where it will be inserted?

If you have a more complex object, it’s still 2D, and you can use the surface tool to position it at first and the grid warp tool to further warp it inside the Insert Module in Mocha Pro.

This covers what is in the insert module: Boris FX | Mocha Pro: Insert Module

This tutorial covers how to insert curved surfaces: Boris FX | Track and Replace Logos on Curved Surfaces

The host there is premiere, but any version of Mocha Pro works similarly.

Yes, I saw the coke bottle 1. My issue is replacing an object with another that isn’t square on its edges like that (or at least straight). And I can only track the first object by rotoscoping it directly around its edges. There is no other plane I can track.

How do I then insert a second object to replace it? The 4-corners of the insert tool have to be inside the tracking spline, right? Which means inside (or right on the edges,) of the original object. Not sure I see how I can fit the replacement object to be big enough to cover the first object.

I have the AE version (for the moment), so no insert tab, but I have the insert option menu.

I feel like I’m missing something basic here.


In the Mocha AE version you only have access to corner pins or to transform data, so curved surfaces are going to be very hard at best. Fit your object you want to use to the size of the comp and precomp it and move all attributes into that comp, then use the corner pin to align your object. That’s the best you can do with just a corner pin.

You could use just roto shapes and a solid color or texture to comp a complex shape in. But that won’t have lighting a 3D object would.

There’s a very advanced tutorial for a workaround with the Mocha AE version, but it’s pretty complicated, you can find that here: Boris FX | Videos

I think those are your options.

Ok, I have full Mocha Pro now. Still a bit lost.
So I have a video of someone chewing on a pen. I want to replace the pen with a Slim Jim (SJ). Tough issues are:

  1. both ends of the pen disappear and re-appear (1 end in the mouth, 1 end in the hand);
  2. I can’t remove the background as is, but I can matte out the pen, leaving the pen space transparent;
  3. neither shape is a true rectangle, and has different proportions.

Strategy was…

  1. track the pen
  2. get rid of the pen, leaving a transparency where the pen was. Do this because once I put the SJ in the background, only what should come through the main clip will be visible from beneath. Where the hand and the mouth cover the SJ the SJ won’t be visible.
  3. use tracking data to set the SJ in the right place and orientation each frame.

Problems are mostly in applying tracking data from the pen to the SJ. The changes in length of the visible section, the at times changes in angle w.r.t. the front view (i.e. not always perpendicular to looking straight on), etc.

I’d love to use the planar surface, but it changes length and angle and is messy.

Any advice for a newbie on this odd project? :wink:

This sounds like a 3D match move, not a corner pin replace, if the object is rotating in 3D. You can’t just replace with with a corner pinned slim jim and have it look right if it moves in a very 3D way. You will also have to remove the pen to replace the pen with transparency on your SJ. This is not a newbie shot, this is a paint and 3D compositing shot.

You can use Mocha Pro to find a 3D solve so you can insert a 3D object, but you will still need to paint the pen out, and it’s likely that the Remove module will not give you a good solution for this type of remove as it’s extremely complex, so you will almost certainly have to paint out the pen with rotopaint attached to tracking data.

We don’t have a tutorial for something this complex, but we do have a tutorial for object solves for the 3D solver. You’d need to find a rotopaint tutorial for your host software on their website like After Effects or Nuke, but Premiere doesn’t have paint tools inside of it.

You will almost certainly need to do some manual tracking or hand animated corrections to make this shot work. It is not an easy thing to do to replace a 3D rotating pen with a slim jim. Please let me know if you have any questions and I will be happy to help you.


For the parts where I can treat it as 2D, with full Mocha Pro, with 4 corners for a pin seemingly moving with respect to each other, what is the best strategy? Thanks.

The best strategy would still be paint the pen out if you need the SJ transparent, or you could try to blur it and hope no one notices with a roto shape. Then you would track the object tracking tanslation scale and rotation only for difficult areas, and translation scale rotation shear and perspective for easier areas. You will probably need to increase your zoom values and your rotation values to increase Mocha’s search area. Then I would try upping the percentage of pixels used to 100% for the most accuracy in your tracking and correct any problems with manual track. Again, it’s not a newbie track even in 2D. It will take time. And probably a lot of hand correction. But I would try that. And then use a corner pin to composite the SJ into the shot and apply motion blur.

You could also try to cheat some 3D looks with the Mocha Pro insert module mesh warper and apply motion blur directly in Mocha Pro.


Thanks much. I just toyed with corner pin, and it works well when the pen ends that are visible don’t move towards or away from each other too much. The SJ behaves nicely when inserted. That’s for probably 1/3 of the clip. Will go through what you just suggested for the harder parts. The tracking itself I can do for it all, with manual adjustments, but it’s transferring the data to the SJ that seems hard

Actually, how do I do a corner pin when the corners are moving, and thus their scale to my SJ then changes as a result? When the corners get closer, the inserted SJ gets too small as a result. Where do I set the corners? The mouth and hands and visible length of the pen change.

Thanks again.

You can try aligning the SJ texture to the comp size, precomping that, and putting the Mocha Corner pin on the precomp, it can solve weird distortions. But your corner pin needs to move correctly as well. Adjust with manual track where it doesn’t.

Sorry, 1 last question. Promise. :wink: Not sure what you mean by " aligning the SJ texture to the comp size, precomping that, and putting the Mocha Corner pin on the precomp."

The SJ is the correct size already for 1/3 of the clip. It’s the right size and orientation, and covers the pen completely during that time. Not sure what you mean by precomping the SJ. Is there a way to make sure the SJ stays at the initial size, only to change position and orientation?

Otherwise, I will just have to keep adjusting the corners each frame if they relatively shift?

Check this tutorial out for a more thorough explanation of what I mean: Boris FX | Align Surface and Mismatched Resolutions

Could the camera shot zooming in and out affect the change in size of the SJ? I thought if the pen changes size when zooming in and out then the SJ would do the same, but maybe not?
Also, what does pre-comp due if there is no editing to compile and the base insert image is already at the proper scale? Thanks.

Precomping keeps everything clean so corner pins do not interact poorly with any transform data. The proper aspect ratio for the SJ might not be the same size as the comp, that’s the reason to fit to comp.

And yes, the track will change size depending on the data it has available to track. However, if it does not have enough texture to track, you will run into problems.