Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Add random appearing order in this text expression?

  • Add random appearing order in this text expression?

    Posted by Isabel García on April 20, 2021 at 3:17 pm

    Hi, I’m totally noob on AE expressions and barely understand how they work. I usually copypaste them, but now I want to learn how to add some randomness to this amount expression:

    freq = 1.5;

    decay = 8;

    duration = 0.18;

    retard = textIndex*thisComp.frameDuration*1;

    t = time – (inPoint + retard);

    startVal = [100,100,100];

    endVal = [0,0,0];

    if (t < duration){

    linear(t,0,duration,startVal,endVal);

    }else{

    amp = (endVal – startVal)/duration;

    w = freq*Math.PI*2;

    endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);

    }

    Please, I’ll appreciate your help!

    Isabel García replied 5 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    April 21, 2021 at 12:45 pm

    Depends on what you want to randomize, but you’ll want to have a persistent random value for each character, like this:

    seedRandom(textIndex,true);
    freq = 1.5;
    decay = 8;
    duration = 0.18 + random(0.8);
    retard = textIndex*thisComp.frameDuration*1;
    t = time - (inPoint + retard);
    startVal = [100,100,100];
    endVal = [0,0,0];
    if (t < duration){
    linear(t,0,duration,startVal,endVal);
    }else{
    amp = (endVal - startVal)/duration;
    w = freq*Math.PI*2;
    endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);
    }
  • Isabel García

    April 21, 2021 at 5:10 pm

    OMG It totally works! Thank you so much!

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