Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions If Else Easy Ease

  • Dan Ebberts

    January 20, 2012 at 5:44 pm

    What are you easing from and to, and over what range? You could do something like this, but I doubt it’s what you’re after:

    r = transform.xRotation;
    ease(r,80,90,value,0)

    Dan

  • Barry Suydam

    January 20, 2012 at 6:21 pm

    thank you for responding i really appreciate your help.

    I have layers revealing like a flap using one of your inertial bounce expressions. I keep them at 0 opacity until they reach 90 degrees at which time the become 100 opacity and the bounce(flap) and rest at 0 degrees based on a decay parameter. They go from off to on I was hoping they could ease from 0 opacity to 100 opacity over 5 frames or so…so they didn’t just pop on screen and continue to be 100 for the remaining duration of the layer in the timeline

  • Dan Ebberts

    January 20, 2012 at 7:12 pm

    Is there a rotation keyframe at 90 degrees? You need something to trigger the ease expression, otherwise you have to create a loop that goes back in time to find the transition to 90 degrees?

    Dan

  • Barry Suydam

    January 20, 2012 at 7:58 pm

    x rotation is keyframed starting at 180 over 30 frames it goes to 0 with the following expression tied to it:

    amp = .3;
    freq = 1.0;
    decay = 2.0;
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time){
    n–;
    }}
    if (n == 0){ t = 0;
    }else{
    t = time – key(n).time;
    }
    if (n > 0){
    v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{value}

    Opacity has the following expression tied to it:

    if (transform.xRotation > 90) {
    0
    } else {
    value };

    I sincerely thank you for taking the time to work with me on this.

  • Dan Ebberts

    January 20, 2012 at 8:18 pm

    Assuming the x rotation reaches 90 degrees half way between the first two keyframes, this should work:

    fadeFrames = 5;
    rX = transform.xRotation;
    t = (rX.key(1).time + rX.key(2).time)/2;
    if (time >= t)
    ease(time,t,t+framesToTime(fadeFrames),0,100)
    else
    0

    Dan

  • Barry Suydam

    January 20, 2012 at 8:38 pm

    Perfection! Thank you…so much! Works perfect just changed the keyframes to 3. AWESOME!

  • Scott Green

    May 9, 2012 at 3:40 pm

    Hi, I’m just reading up about expressions and learning the basics and came across this post while searching for a way to ease a rotation effect I’ve got attached to a null that controls a camera.

    This expression affects the rotation which stops at 180 degress:

    t=time*5 +10;
    if(t<180){[t];
    }else{[180];
    }

    How can I ease this effect so that the camera doesn’t stop so sudden?

    Thanks.

    Creative Multimedia Design Manchester | S©tt Green | Splurj

  • Dan Ebberts

    May 9, 2012 at 4:31 pm

    One way:

    easeOut(time,0,34,10,180)

    Dan

  • Scott Green

    May 9, 2012 at 6:11 pm

    Thanks Dan,

    can you tell me what each of the numbers represent please, I haven’t got that far yet 🙂

    (time,0,34,10,180)

    Creative Multimedia Design Manchester | S©tt Green | Splurj

  • Dan Ebberts

    May 9, 2012 at 6:18 pm

    The expression just says “as time varies from zero to 34 seconds, vary the output from 10 to 180 degrees”. I chose 34 seconds because that’s the time it takes your original expression to get to 180.

    Dan

Page 1 of 2

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