Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Set multiple value's on multiple times without keyframes

  • Set multiple value's on multiple times without keyframes

    Posted by Yvonne Van de kop on February 23, 2022 at 8:56 am

    Hi there,

    Sometimes I need to make animations without using keyframes and it always works fine with the linear expression if I need only 2 value’s at 2 times. Hope that makes sense…


    In this case it’s specifically about Time Remap. The idea is really simple but I just can’t get it right. The result must be like this:

    At frame 0 > Time Remap at 0

    Second frame controlled by slider > Time Remap at 181

    At frame 250 > Time Remap at 200

    The first value and the last value I can set with keyframes but I’ve no idea how to add the middle value at a time controlled by a slider.

    Anyone?

    Yvonne Van de kop replied 4 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Tomas Bumbulevičius

    February 23, 2022 at 9:30 am

    Hey Yvonne, its as simple as making if/else statement in timeremap.

    Pseudo code as follows:

    if (frame > 0) {
    //do your interpolation
    } else if (frame > 250) {
    //do your interpolation
    } else {
    //set default values when condition is not met or is in between, if needed
    }

  • Yvonne Van de kop

    February 23, 2022 at 2:36 pm

    Solved it like this now. Don’t know why I didn’t think about the if/else statement haha

    var Dur = comp("00 MASTER CONTROL").layer("MASTER CONTROL").effect("Duration endpage")("Slider");

    var AS = framesToTime(0);

    var AE = framesToTime(181);

    var AC = framesToTime(200);

    var OP1 = linear(time, 0, Dur, AS, AE);

    var OP2 = linear(time, Dur, 10, AE, AC);


    if (time < Dur) {

    OP1

    } else {

    OP2

    }

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