Sometimes animating mask path can be really difficult if you are trying to animate it to follow an object.
This tip may be used in motion graphic work to focus moving object (maybe tracked).
First of all, it is impossible to solve that problem by After Effects itself, so we are going to get some help by a script.
Script name is; RotAE rotoscoping script. I’m giving its download link and information at bottom.
Now, open After Effects (im using CS5) and create a composition.
In your composition, create a 100×100 pixel size solid,
This solid will be moving object example (in your real porject, it will be your tracked keys null object)
Now give some random position keys to this solid;
Select this layer and Pre-Compose [Ctrl+Shift+C] it. We will track it.
Track this pre-compose (I’m assuming you know how to track an moving object in After Effects, because it is another lesson 🙂
When finished, your pre-compose will have track position data.
Now, create a new solid more, select [Make Comp Size], on this solid draw a mask line,
Give this layer a Stroke effect and select [On Transparent] as Paint Style in Stroke effect properties window.
Now, download RotAE script from the bottom of this page; and Run this script,
You should see a script user interface window like this;
Now Select your mask layer and press “>” on script window;
You will see you can select mask point with this button.
Select the button that you wish to parent,
Press [Apply Tracker], this will create a Motion Trackers menu to your object.
Now select pre-composed layer’s [Track Point 1] and press Ctrl+C to copy.
Select [Track Point 1] in mask layer and press Ctrl+V to paste.
Your all keys will be transfered to mask layer’s Track Point 1;
Now select [Mask 1] and and [Tracker 1] in mask layer and press [Apply Mask] in script window.
Your mask point will snap to track center and play it, it will track your mask point with your object.
Idea by Alejandro Perez
Main code by Juan Corcoles
Additional code by Alejandro Perez, Michael Natkin, Paul Tuersley
Originally based on a script by Dan Ebberts at Creative Cow
v1.1 fixed a small bug, an unnecesary check that blocked Apply Tracker if the first layer
in comp didn’t have a mask; it ignored if it was the layer selected to apply the trackers.
v1.2 quick fix to prevent out of memory error or crash caused by overloading the undo
when applying trackers to a mask.
v1.3 the solution to the memory error / crash issue, thanks to Michael Natkin from Adobe.
That’s all folks,
Keep in Fxfx,