Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animated text locked to a specific position

  • Animated text locked to a specific position

    Posted by Jo Craft on August 11, 2020 at 10:25 pm

    Hi all,

    I have been searching everywhere for a solution to what seems to be a simple problem but no luck so far.

    I have a multiple-lines block of text (over 500 lines) that I am simply animating by having words appear one after the other. I need an expression so that every time a new line of text appears, the whole block moves up so that new line is always at the specific X and Y. I am trying to recreate lines of codes appearing in a terminal basically. Every new line, layer moves 18px up.

    Being lines of codes some lines are 3 characters and some are like 50 so it’s not as simple as keyframing the position to match the animation unfortunately. I have tried with sourceRectatTime but I am either missing something or not really understanding how to properly use it.

    It seems super simple, but I haven’t been able to figure it out to save my life. If anyone has a trick for that, it would awesome!

    Thanks

    Jo Craft replied 5 years, 9 months ago 4 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    August 11, 2020 at 11:27 pm

    Maybe a Position expression like this:


    pxPerLine = 18;
    txt = text.sourceText;
    n = txt.split("\r").length-1;
    value - [0,n*pxPerLine]

    Dan

  • Jo Craft

    August 11, 2020 at 11:52 pm

    Hi Dan,

    Thanks for looking into it. No luck, the text layer is still static and doesn’t move up when new lines animate in. Here is a screengrab. Let me know if you think of anything else, thanks!

  • Dan Ebberts

    August 12, 2020 at 12:14 am

    Ah, OK. You’re using an opacity animator. For some reason I thought you were animating the text itself, but with the animator, the text itself never changes, so sourceRectAtTime() and counting the lines of text won’t work. It seems like somebody hacked together a solution for this, but I don’t recall what it is.

    Dan

  • Jo Craft

    August 12, 2020 at 1:47 am

    Thanks for clarifying Dan!

    I’ll look into alt ways of animating the text maybe with an expression if that makes any difference.

  • Tomas Bumbulevičius

    August 12, 2020 at 9:14 am

    Hey Jo, in addition to opacity, include scale into Text Animation. Set it to zero – and magic will happen (:

    I been confused with this myself in the past too, until I noticed that adding ‘Scale’ does the trick!

    Find out more:
    Motion Graphics Design & After Effects Tutorials
    On YT
    On VH

  • Nawaz Alamgir

    August 12, 2020 at 2:41 pm

    Apply a scale text animator, set it to 0, keyframe the range and add this to the layer position

    pLine=sourceRectAtTime(time).height;
    scaler=transform.scale[1]/100;
    value-[0,pLine*scaler]

    should work

  • Jo Craft

    August 12, 2020 at 11:58 pm

    It does!
    Thank you all so much for helping out!

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