Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How can I randomize a linear expression?

  • How can I randomize a linear expression?

    Posted by David Cabestany on October 19, 2017 at 10:18 pm

    How can I make this expression below start its thing after the 4 second mark but with a few random frames of difference on each layer?
    I’m using the index to add some variation, but as the index number grows the output decreases and it does not look ok.

    m=thisComp.layer("NULL CONTROL 2").effect("mult")("Slider");
    t=time;
    if
    (t<4)
    {
    100}
    else
    linear(t,4/(index/m),5,100,0)
    ;

    David Cabestany replied 8 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 19, 2017 at 10:25 pm

    Something like this maybe?

    seedRandom(index,true);
    tStart = 4 + random(.5);
    dur = random(.9,1.1);
    linear(time,tStart,tStart+dur,100,0)

    Dan

  • David Cabestany

    October 19, 2017 at 11:21 pm

    Exactly that and much cleaner code. Thanks a lot Dan.

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