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

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

138

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

Community Expert , 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

Votes

Translate

Translate
Community Expert ,
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

Votes

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.

Votes

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