Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position property expression for animated text.

  • Position property expression for animated text.

    Posted by Liviu Ispasoiu on May 23, 2019 at 7:41 pm

    Hi, I´m struggling with an expression for a text animation and I need some help.
    I created a mask where the size is automatically given by the length of the text. I used a range selector to animate the position of the characters and in the first phase, I want it to be automatically positioned to the left for a distance equal to the length of the text /mask, symmetrical in some way. For any text adjustment, it must work symmetrically against the mask “position”. Hope it makes sense. Any ideas?

    this is the expression I used
    Rectangle Path-> Size
    var titleLayer = thisComp.layer("Lorem ipsum dolor");
    var boxWidth = titleLayer.sourceRectAtTime(0,true).width;
    var boxHeight = titleLayer.sourceRectAtTime(0,time).height;
    [boxWidth, boxHeight]

    Rectangle Path – >Position
    var titleLayer = thisComp.layer("Lorem ipsum dolor");
    var boxWidth = titleLayer.sourceRectAtTime(0,true).width/2;
    var boxHeight = titleLayer.sourceRectAtTime(0,true).height/2;
    var boxX = titleLayer.sourceRectAtTime(0,true).left;
    var boxY = titleLayer.sourceRectAtTime(0,true).top;
    [boxWidth + boxX, boxHeight + boxY]

    Transform Rectangle -> Anchor Point
    (linked to the position property of the characters in Range Selector Animator)
    thisComp.layer(“Lorem ipsum dolor”).text.animator("Animator 1").property.position;

    Position in Range Selector Animation
    (???) here I got stuck

    Thank you!

    Liviu Ispasoiu replied 7 years, 2 months ago 1 Member · 1 Reply
  • 1 Reply
  • Liviu Ispasoiu

    May 25, 2019 at 6:55 pm

    Actually, I solved it. For the position property in range selector animation I used:
    var boxWidth = thisLayer.sourceRectAtTime(time).width;
    [-boxWidth,0]

    and no need to link the Anchor Point to the position property of the characters in Range Selector Animator.
    The only thing I found there is a small offset position of characters like A, V.. vs. B, L, P …. but that’s another story. Anyway, thank you!

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