Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression for controlling bullets of text?

  • Expression for controlling bullets of text?

    Posted by Alex Dejesus on May 1, 2012 at 7:19 am

    I need narrative bullets to appear in a text box, anywhere from one to three such lines to stay on screen, then wipe off before the next set appears. I have already done it the long way, with numerous keyframes for opacity and position. I can also create a separate layer for each line, but there must be a more practical way. I am thinking to reposition the entire text block so that the appropriate lines are revealed and then go away. How can I do this with an expression?

    Alex DeJesus

    Alex Dejesus replied 14 years ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    May 1, 2012 at 3:47 pm

    something like this might help you.

    it will base the opacity transition timing on the in and out points of the layer, you just need to set the duration of the fade and the minimum and maximum opacity values.

    FadeTime = 1; // value in seconds
    MinOpacity = 0;
    MaxOpacity = 100;

    if (time >= inPoint) linear(time, inPoint, inPoint + FadeTime, MinOpacity, MaxOpacity);
    if (time > outPoint - FadeTime) linear(time, outPoint - FadeTime, outPoint, MaxOpacity, MinOpacity);

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    May 1, 2012 at 3:59 pm

    There are probably a number of to approach it–it’s hard to know which way will best meet your needs.

    One way would be to use a source text expression to select three lines of text depending on elapsed time since the text layer’s in point. That would look like this:


    dur = 5;
    mySplit = value.split("r");
    seg = Math.floor((time-inPoint)/dur);
    mySplit = value.split("r");
    str = "";
    for(i = seg*3; i < seg*3+3; i++){ if (i < mySplit.length){ if (i != seg*3) str += "r"; str += mySplit[i]; } } str

    You'd probably also want expressions controlling the range selectors for your animations as well. These would also be driven by the time elapsed since the start of the latest group of lines. Those would have code like this in them:

    dur = 5;
    t = (time-inPoint)%dur;

    and would probably use linear() to drive the animation based on "t". Hard to say exactly.

    Dan

  • Alex Dejesus

    May 1, 2012 at 6:27 pm

    wow, interesting. I’ll try it. Thanks!

    Alex DeJesus

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