Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Moving the last keyframe in time using expressiosn

  • Moving the last keyframe in time using expressiosn

    Posted by Ivan de Wolf on July 19, 2022 at 1:49 pm

    Hello!

    I have a pair of keyframes for animating a parameter. I would like to move the second keyframe across time, so that the animation can be shortened or lengthened using a simple slider control. I found some solutions online, but they don’t fully seem to work with isolating the time movement of just one keyframe.

    Any ideas??

    Ivan de Wolf replied 3 years, 10 months ago 4 Members · 4 Replies
  • 4 Replies
  • Adam Greenberg

    July 19, 2022 at 1:55 pm

    this has been discussed before, here is a link until someone potentially rings in with a more concise answer,

    https://community.adobe.com/t5/after-effects-discussions/link-a-keyframe-to-slider-control-without-affecting-other-keyframes/td-p/9887407

  • Dan Ebberts

    July 19, 2022 at 2:00 pm

    You can’t really move keyframes with expressions, but you can simulate it with something like this (assumes there are only 2 keyframes):

    t1 = key(1).time;
    t2 = key(2).time;
    tNew = effect("Slider Control")("Slider");
    t = linear(time,t1,tNew,t1,t2);
    valueAtTime(t)
  • Filip Vandueren

    July 19, 2022 at 2:10 pm

    If you want to keep the easing you already have set up between your keyframes and don’t want it to default to the linear() or ease() functions:

    (this example has 3 keyframes, and a slider controls how long the animation should last after key#2, disregarding the actual timing of keyframe#3

    time_2 = key(2).time;
    time_3 = time_2 + Math.max(0,effect("Slider Control")("Slider").value);
    if (time < time_2) {
    value;
    } else {
    t=linear(time,time_2, time_3, time_2, key(3).time);
    valueAtTime(t);
    }
  • Ivan de Wolf

    July 20, 2022 at 12:21 pm

    WOW thank you everyone for the fast response! It works perfectly! <3

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