Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Make this expression works with specific marker key

  • Make this expression works with specific marker key

    Posted by Muhammad Mont on November 26, 2020 at 4:48 am

    I have this expression written by Dan Ebberts works well with any marker key…

    Is there any method to make it works with a specific marker key?

    Say i have three keys i need it works with key number tow only

    Thanks.

    attackTime = .1;

    holdTime = .1;

    decayTime = .25;

    n = 0;

    if (marker.numKeys > 0){

    n = marker.nearestKey(time).index;

    if (marker.key(n).time > time)n–;

    }

    if (n > 0){

    t = time – marker.key(n).time;

    t1 = attackTime;

    t2 = t1 + holdTime;

    t3 = t2 + decayTime

    if (t < t1)

    linear(t,0,t1,0,100)

    else if (t < t2)

    100

    else

    linear(t,t2,t3,100,0);

    }else 0

    Muhammad Mont replied 5 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 26, 2020 at 7:18 am

    Something like this:

    markerNum = 2;

    attackTime = .1;

    holdTime = .1;

    decayTime = .25;

    val = 0;

    if (marker.numKeys >= markerNum){

    t = time - marker.key(markerNum).time;

    t1 = attackTime;

    t2 = t1 + holdTime;

    t3 = t2 + decayTime

    if (t < t1)

    val = linear(t,0,t1,0,100)

    else if (t < t2)

    val = 100

    else

    val = linear(t,t2,t3,100,0);

    }

    val

  • Muhammad Mont

    November 26, 2020 at 1:32 pm

    Works well

    Thank you very much

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