Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate text on per letter using a custom flicker expression

  • Animate text on per letter using a custom flicker expression

    Posted by Tom Holmes on July 10, 2017 at 6:34 am

    I have the following expression which animates a layers opacity on in a flickering fashion:

    if (time < inPoint || time > outPoint){
    f = 0;
    }else if (time < (inPoint+outPoint)/2){
    f = timeToFrames(time – inPoint);
    }else{
    f = timeToFrames(outPoint – time);
    }
    switch(f){
    case 0:
    case 2:
    case 4:
    case 6:
    0;
    break;
    case 1:
    25;
    break;
    case 3:
    50;
    break;
    case 5:
    75;
    break;
    case 7:
    100;
    break;
    default:
    100;
    break;
    }

    Is there a way I can adapt and use this with a text layer’s animate and expression selector so the letters animate on separately (either randomly or in sequence) with this same animation.

    Thank you! ☺

    Tom

    Tom Holmes replied 8 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    July 10, 2017 at 3:51 pm

    Add an Opacity Animator, set its value to 0, and an Expression Selector and use this for Amount:


    totalDur = 1.0;
    myStart = inPoint + (textIndex-1)*totalDur/textTotal
    myEnd = outPoint - (textIndex-1)*totalDur/textTotal;
    if (time < myStart || time > myEnd){
    f = 0;
    }else if (time < (myStart+myEnd)/2){
    f = timeToFrames(time - myStart);
    }else{
    f = timeToFrames(myEnd - time);
    }
    switch(f){
    case 0:
    case 2:
    case 4:
    case 6:
    100;
    break;
    case 1:
    75;
    break;
    case 3:
    50;
    break;
    case 5:
    25;
    break;
    case 7:
    0;
    break;
    default:
    0;
    break;
    }

    Dan

  • Tom Holmes

    July 10, 2017 at 5:14 pm

    Thank you so much Dan! You’re such a huge help.

    How could make the letters appear in a random order instead of in sequence?

    Thanks

    Tom

  • Dan Ebberts

    July 10, 2017 at 8:09 pm

    Like this maybe:

    totalDur = 1.0;
    seedRandom(textIndex,true);
    myStart = inPoint + random(totalDur - framesToTime(8));
    myEnd = outPoint - random(framesToTime(8),totalDur);
    if (time < myStart || time > myEnd){
    f = 0;
    }else if (time < (myStart+myEnd)/2){
    f = timeToFrames(time - myStart);
    }else{
    f = timeToFrames(myEnd - time);
    }
    switch(f){
    case 0:
    case 2:
    case 4:
    case 6:
    100;
    break;
    case 1:
    75;
    break;
    case 3:
    50;
    break;
    case 5:
    25;
    break;
    case 7:
    0;
    break;
    default:
    0;
    break;
    }

    Dan

  • Tom Holmes

    July 10, 2017 at 8:24 pm

    Perfect, you’ve done it again.

    Thank you so much!

    Tom

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