Copy link to clipboard
Copied
Is there a way to get the total number of comp markers with a script?
How about a way to advance to the time of the next comp marker with a script?
This works as of CC 2017, I think.
Number of comp markers:
var myProp = myComp.markerProperty;
alert (myProp.numKeys)
Move CTI to next comp marker:
var myComp = app.project.activeItem;
var myProp = myComp.markerProperty;
var myTime = myComp.time;
var n = 0;
if (myProp.numKeys > 0){
n = myProp.nearestKeyIndex(myTime);
if (myProp.keyTime(n) <= myTime) n++;
if (n > myProp.numKeys) n = 0;
}
if (n > 0){
myComp.time = myProp.keyTime(n)
}
Dan
Copy link to clipboard
Copied
This works as of CC 2017, I think.
Number of comp markers:
var myProp = myComp.markerProperty;
alert (myProp.numKeys)
Move CTI to next comp marker:
var myComp = app.project.activeItem;
var myProp = myComp.markerProperty;
var myTime = myComp.time;
var n = 0;
if (myProp.numKeys > 0){
n = myProp.nearestKeyIndex(myTime);
if (myProp.keyTime(n) <= myTime) n++;
if (n > myProp.numKeys) n = 0;
}
if (n > 0){
myComp.time = myProp.keyTime(n)
}
Dan
Copy link to clipboard
Copied
Thank you Dan! I knew that comp markers were now accessible through scripts, but couldn't find what I was doing wrong since it is so new.