Note: This is an ongoing series that features one After Effects script a week. For an overview on scripts, check out the debut post.
Just this morning, I found myself stuck. I had a good corner pin track of a handheld cell phone screen that needed to be replaced, but there was a problem; the visible, trackable object was the hand holding the phone rather than the phone itself, and the hand moved and changed its angle as the shot progressed. Fixing this in MochaAE, where the track was created, was difficult, because Mocha was doing its job correctly.
Instead, I used KeyTweak (Shareware, current suggested price $5) to change the frame-by-frame motion track data over time.
All I had to do was make a duplicate of the layer with all of the tracking frames. I then went in and deleted all but a few keyframes, leaving one roughly every 10 frames or so. I manipulated those to new positions to roughly block in the correct points for the Corner Pin and Position properties. Then, by selecting each key framed property on both the original a duplicate layer, I only had to open the KeyTweak panel and press the KeyTweak button, and all of the motion of the intermediate frames was recreated, but adjusted to hit the adjusted position points.
It’s hard to believe that this actually works, but it does; you can often get away with very few adjusted keyframes, and you can even adjust an entire Mask Shape property, which makes this effect a great companion to Tracker2Mask, which I’ll profile in some future script-of-the-week column. So if you ever find yourself with lots of keyframes that are basically correct but drift out of place, KeyTweak will save you a lot of tedious, painstaking work to correct the problem.