Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions time variations between 2 keyframes

  • time variations between 2 keyframes

    Posted by Peter Zeet on August 11, 2013 at 5:01 pm

    Hi!
    I have this setup:
    a: a null called “control” with a slider called “grow”
    b: 800 shape layers with trim
    So I’m sure it’s possible, but I couldn’t find out how:
    I have 2 keyframes in the slider (from 5 to 80). And the end trim value of the 800 layers linked to the “grow” slider inside the null.
    I wonder if one of these 2 options could be done:
    a) all layers start at the first keyframe and end at the 2nd keyframe but in the middle the speed of each layer is not the same (like editing the easeIn and Out curves randomly)
    b) all layers start at the same time but reach their end value some frames after and before the 2nd keyframe

    Right now I have the 800 layers with their own end trim values animated with no main controller, but automate this would be really great… (as side note, there are a lot of other layers between them, so “following the leader” with index-1 is not possible (or maybe yes?)

    thanks!

    Peter Zeet replied 12 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 11, 2013 at 5:51 pm

    Something like this might work:


    range = 1; // plus or minus 1 second
    s = thisComp.layer("control").effect("grow")("Slider");
    if (s.numKeys > 1){
    seedRandom(index,true);
    d = random(-range,range);
    ease(time,s.key(1).time,s.key(2).time+d,s.key(1).value,s.key(2).value);
    }else
    value

    Adjust range to get the timing you want.

    Dan

  • Peter Zeet

    August 11, 2013 at 7:15 pm

    awesome! thanks!

    uhm…is it possible to get the range in frames instead of seconds?

  • Dan Ebberts

    August 11, 2013 at 7:51 pm

    Like this:


    range = 10; // plus or minus 10 frames
    s = thisComp.layer("control").effect("grow")("Slider");
    if (s.numKeys > 1){
    seedRandom(index,true);
    d = framesToTime(random(-range,range));
    ease(time,s.key(1).time,s.key(2).time+d,s.key(1).value,s.key(2).value);
    }else
    value

    Dan

  • Peter Zeet

    August 11, 2013 at 7:56 pm

    über awesome, thanks!

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