I am trying to make a script that takes a (selected) Tracker full of Tracker Points and makes multiple Trackers with a single Track Point each out of it.
This is because I like to track stuff at the same time, but TrackerViz wants tracks in separate trackers.
However, when I want to remove all Track Points except for one, it appears there are no Properties in the Property Group.
Look for this line:
Code: Select all
newProp[0].remove(); // THERE ARE NO PROPERTIES!?! But in AE there are.
Code: Select all
/**********
* RED TrackerUnique
**********
* Filename: RED TrackerUnique.jsx
* Written by: Redsandro - http://www.rednet.nl/en/
* Date: 2009/03/19
* Last updated:
**********
*
* Description:
*
* Turns a Tracker with many TrackPoints into a multiple Trackers with a single TrackPoint
*
**********/
clearOutput();
var myComp = app.project.activeItem;
if (myComp == null) {
alert("No composition selected.");
}
else {
// Local Vars
var myLayers = myComp.selectedLayers;
var selProp = myComp.selectedProperties;
var expanded = 1;
app.beginUndoGroup("Tracker Unique");
// Walk Selected Properties
for (var p = 0; p < selProp.length; p++) {
if (selProp[p].matchName == "ADBE MTracker" ) { // Tracker Group found //MTrackers -> MTracker -> MTracker Pt
var selPropNo = selProp[p].numProperties;
if (selPropNo > 1) { // Multiple trackpoints found
for (var i in selProp[p]) { // Walk Track Points
// Create New Tracker
var newProp = selProp[p].duplicate();
for (var n = (selPropNo-1); n >= 0; n--) // Remove other Track Points from clone
if (n != i)
newProp[0].remove(); // THERE ARE NO PROPERTIES!?! But in AE there are.
//alert(newProp);
}
// Delete parent tracker
selProp[p].remove();
}
}
}
app.endUndoGroup();
}