Rototracking palette for AE (6.5, 7, CS3)
Posted: December 18th, 2005, 12:19 am
June 2008: v1.3 script update. Fixes the cause of memory errors when converting track points to a mask. Thanks to Michael Natkin.
Download RotAE1.3.zip
http://usuarios.lycos.es/thehardmenpath ... tAE1.1.jsx
http://usuarios.lycos.es/thehardmenpath ... /RotAE.jsx (old version)
Many people ask if roto tracking is possible at all with AE. It can be done with some plugins, yes but I always wondered if I could do it just with scripting.
Based on an old script Dan Ebberts wrote fast on the COW forums, a friend of mine, Juan Córcoles, and I saw possible to do some things:
1) Set up a tracker where all trackpoints correspond to a max vertex. (not just four, but as many as needed)
2) Make each vertex of a mask follow each trackpoint of a tracker. Not in real time, it's a pity, but once when the tracking has been done.
3) Also, correct some issues of making a mask with multiple independent points, such as a vertex going where it shouldn't go. Half of the script focuses on interpolating vertex and tangents regadless of the keyframes inbetween.
Two things are really missed here: One is to attach the masks to the trackers in real time, but as you know, expressions are not suitable for mask shapes without plugins. The other, that as far as I know, a script can't know which vertices are selected when it's executed.
The script works as well as the built in tracker in AE can be. This means it can make very nice works with objects that don't change much. For many jobs there will be need for manual work, as always happens with rotoscoping. First make a mask around the object you want to track, select it and click on Apply Tracker. It will instantly create the trackpoints. Now it's your choice if you want to handle them all at the same time or not. As you probably know, there's an eye next to the tracker makes them visible or not visible. Invisible trackers do not track when you push the play button in the tracker controls. When you are finished, select the tracker and the mask you made together and click on Apply Mask. It will now be animated.
For those changes in the image of unnacuracy of the trackpoints, use the other half of the palete. When you feel you should alter a tangent or vertex from one point in time to another, insert a layer marker where you want to make the adjustments and one before and one after the places where it's gone wrong. The interpolator script will make a linear movements of either the vertex or the tangents. Only keyframes between markers for a single vertex of its two tangents will altered.
For selecting which vertex to change, use the << < > >> buttons to set the first vertex (the big one) at these places. Do not use the Use first vertex feature of AE, because it will completely change the structure of the mask in a single keyframe and screw up the interpolation.
The script is far from perfect. Juan, the main coder, had to stop working on it some time ago, and I feel I won't have anymore time from now on, so I decided to correct the main issues alone and build the palette, even if there are some little problems, I think it can be helpful. It has already been quite useful for me, even more than what I expected.
I think that's all. As I said, I am afraid I won't have time to improve it, so to anyone who likes the script, feel free to play around with it.
Alejandro Pérez
Download RotAE1.3.zip
http://usuarios.lycos.es/thehardmenpath ... tAE1.1.jsx
http://usuarios.lycos.es/thehardmenpath ... /RotAE.jsx (old version)
Many people ask if roto tracking is possible at all with AE. It can be done with some plugins, yes but I always wondered if I could do it just with scripting.
Based on an old script Dan Ebberts wrote fast on the COW forums, a friend of mine, Juan Córcoles, and I saw possible to do some things:
1) Set up a tracker where all trackpoints correspond to a max vertex. (not just four, but as many as needed)
2) Make each vertex of a mask follow each trackpoint of a tracker. Not in real time, it's a pity, but once when the tracking has been done.
3) Also, correct some issues of making a mask with multiple independent points, such as a vertex going where it shouldn't go. Half of the script focuses on interpolating vertex and tangents regadless of the keyframes inbetween.
Two things are really missed here: One is to attach the masks to the trackers in real time, but as you know, expressions are not suitable for mask shapes without plugins. The other, that as far as I know, a script can't know which vertices are selected when it's executed.
The script works as well as the built in tracker in AE can be. This means it can make very nice works with objects that don't change much. For many jobs there will be need for manual work, as always happens with rotoscoping. First make a mask around the object you want to track, select it and click on Apply Tracker. It will instantly create the trackpoints. Now it's your choice if you want to handle them all at the same time or not. As you probably know, there's an eye next to the tracker makes them visible or not visible. Invisible trackers do not track when you push the play button in the tracker controls. When you are finished, select the tracker and the mask you made together and click on Apply Mask. It will now be animated.
For those changes in the image of unnacuracy of the trackpoints, use the other half of the palete. When you feel you should alter a tangent or vertex from one point in time to another, insert a layer marker where you want to make the adjustments and one before and one after the places where it's gone wrong. The interpolator script will make a linear movements of either the vertex or the tangents. Only keyframes between markers for a single vertex of its two tangents will altered.
For selecting which vertex to change, use the << < > >> buttons to set the first vertex (the big one) at these places. Do not use the Use first vertex feature of AE, because it will completely change the structure of the mask in a single keyframe and screw up the interpolation.
The script is far from perfect. Juan, the main coder, had to stop working on it some time ago, and I feel I won't have anymore time from now on, so I decided to correct the main issues alone and build the palette, even if there are some little problems, I think it can be helpful. It has already been quite useful for me, even more than what I expected.
I think that's all. As I said, I am afraid I won't have time to improve it, so to anyone who likes the script, feel free to play around with it.
Alejandro Pérez