Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Controling time between keyframes

  • Controling time between keyframes

    Posted by Nihad Spahic on March 17, 2022 at 3:28 pm

    Hello everyone, I wonder if it’s possible to control the time between keyframes or to achieve the same effects without keyframes.

    I have a camera and I am trying to control the x position, the situation is, I have two keyframes, and the expression is connected to sliders where I control the first and the second value of keyframes. Is it possible to control the time between keyframes with slider?

    This is expression:

    var a = thisComp.layer(“Camera Settings”).effect(“Camera In Animation X”)(1);

    var b = thisComp.layer(“Camera Settings”).effect(“Camera Out Animation X”)(1);

    if (numKeys > 1){

    t1 = key(1).time;

    t2 = key(2).time;

    v1 = [a];

    v2 = [b];

    ease(time, t1, t2, v1, v2);

    } else {

    value

    }

    Nihad Spahic replied 4 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 17, 2022 at 5:40 pm

    I guess you wouldn’t really need the keyframes if they aren’t providing timing or value info, so this should work:

    x1 = thisComp.layer("Camera Settings").effect("Camera In Animation X")(1);

    x2 = thisComp.layer("Camera Settings").effect("Camera Out Animation X")(1);

    t1 = thisComp.layer("Camera Settings").effect("Camera In Animation Time")(1);

    t2 = thisComp.layer("Camera Settings").effect("Camera Out Animation Time")(1);

    ease(time, t1, t2, x1, x2);

  • Nihad Spahic

    March 17, 2022 at 6:37 pm

    Thanks Dan! This is exactly what I need.

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