Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get Number of Comp Markers

New Here ,
Jul 06, 2018 Jul 06, 2018

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?

TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 06, 2018 Jul 06, 2018

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

Translate
Community Expert ,
Jul 06, 2018 Jul 06, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2018 Jul 06, 2018
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines