Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Fade in and out based on markers

  • Fade in and out based on markers

  • David Cabestany

    September 28, 2022 at 5:20 pm

    I’m trying to write an expression that fades in and out based on the markers in the layer,

    but falling short of it, any help would be greatly appreciated.

    fadeDur = .5;

    n = 0;

    if (marker.key > 0){

    n = marker.key(time).index;

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

    }

    if (n=1){

    ease(time,n,n+fadeDur,0,value);

    }else

    if (n=2){

    ease(time,n-fadeDur,n,value,0);

    }else{

    value;

    }

  • Dan Ebberts

    September 28, 2022 at 6:00 pm

    This should work:

    fadeDur = .5;
    m = marker;
    n = 0;
    val = value;
    if (m.numKeys == 1){
    t1 = m.key(1).time;
    val = ease(time,t1,t1+fadeDur,0,value);
    }else if (m.numKeys > 1){
    t1 = m.key(1).time;
    t2 = m.key(2).time;
    if (time < t1 + fadeDur){
    val = ease(time,t1,t1+fadeDur,0,value);
    }else{
    val = ease(time,t2-fadeDur,t2,value,0);
    }
    }
  • David Cabestany

    September 28, 2022 at 9:02 pm

    Yes, this works perfectly as usual. Thanks a lot Dan.

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