Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Subtitle To Disappear After Marker End

  • Subtitle To Disappear After Marker End

  • Henri Yates

    August 5, 2022 at 8:28 pm

    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;

    }

  • Dan Ebberts

    August 5, 2022 at 8:37 pm

    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
  • Henri Yates

    August 7, 2022 at 8:13 pm

    Thank you very much, Mr. Dan Ebberts.

Viewing 1 - 3 of 3 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy