Subtitle To Disappear After Marker End.

Community Beginner ,
Aug 05, 2022 Aug 05, 2022

Copy link to clipboard

Copied

Hello, I am working with this expression for subtitles but the subtitle stays on even until the next marker. I want subtitle to disappear when there's a gap between markers.

Any help?

Here's the expression I am using;

m = thisComp.layer(1).marker;
n = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time){
n--;
}
}
if (n == 0){
""
}else{
m.key(n).comment;
}

 

 

ae.png

TOPICS
Expressions , How to

Views

24

Likes

Translate

Translate

Report

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

Adobe Community Professional , Aug 05, 2022 Aug 05, 2022

Try it this way:

m = thisComp.layer(1).marker;
n = 0;
val = "";
if (m.numKeys > 0){
  n = m.nearestKey(time).index;
  if (m.key(n).time > time) n--;
}
if (n > 0){
  t = time - m.key(n).time;
  if (t < m.key(n).duration){
    val = m.key(n).comment;
  }
}
val

Likes

Translate

Translate
Adobe Community Professional ,
Aug 05, 2022 Aug 05, 2022

Copy link to clipboard

Copied

Try it this way:

m = thisComp.layer(1).marker;
n = 0;
val = "";
if (m.numKeys > 0){
  n = m.nearestKey(time).index;
  if (m.key(n).time > time) n--;
}
if (n > 0){
  t = time - m.key(n).time;
  if (t < m.key(n).duration){
    val = m.key(n).comment;
  }
}
val

Likes

Translate

Translate

Report

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
Community Beginner ,
Aug 07, 2022 Aug 07, 2022

Copy link to clipboard

Copied

LATEST

Thank you very much, Dan Ebberts.

Likes

Translate

Translate

Report

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