Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate text alignment using sourceRectAtTime or dynamically repositioning the anchor point

  • Animate text alignment using sourceRectAtTime or dynamically repositioning the anchor point

    Posted by John Burgess on August 15, 2020 at 12:57 pm

    Trying to animate text alignment like the example I have 50+ versions so don’t want to manually have to reposition each line of text. Ideally needs to automatically align regardless of line length.

    This doesn’t seem possible using the alignment tool due to it only using hold keyframes. But is there a way to keyframe or animate between dynamically positioned anchors point using sourceRectAtTime.?

    The below will automatically position the anchor point center, left and right but is it possible to interpolate between these values and avoid the issue of the position jumping.

    Many thanks.

    // [CENTER, BOTTOM]
    l = thisLayer.sourceRectAtTime();
    [l.left + l.width/2, l.top + l.height];

    // [LEFT, BOTTOM]
    l = thisLayer.sourceRectAtTime();
    [l.left, l.top + l.height];

    // [RIGHT, BOTTOM]
    l = thisLayer.sourceRectAtTime();
    [l.left + l.width, l.top + l.height];

    John Burgess replied 4 years ago 2 Members · 3 Replies
  • 3 Replies
  • Filip Vandueren

    August 15, 2020 at 4:37 pm

    Are all the lines on a separate layer ?

  • John Burgess

    August 15, 2020 at 4:40 pm

    Hi Filip, yes each line is a separate text layer.

  • John Burgess

    August 15, 2020 at 5:12 pm

    Update, i’ve managed to find a solution to this though not using expressions.

    Pins & Boxes by mamoworld has an anchor control that works based on a % of the layer. Keyframing the anchor points then parenting the layer to a null to drive position works.

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