Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Auto center text layer anchor point while using an Animator with Flow code

  • Auto center text layer anchor point while using an Animator with Flow code

    Posted by Dagur Maunason on February 15, 2022 at 10:52 pm

    Hello!

    I’m trying to have a text field automatically center both horizontally and vertically while using an Animator with some code from Flow driving the animation. It’s mostly working as needed, until I change the Y offset in the animator above 52, then the whole text field make a large jump vertically at two different times during playback.

    I cannot for the life of me figure out what makes this happen, though I have noted that if I increase the font size that fixes it. I fear that it’s some kinda clash between the expressions, but perhaps I have just written it poorly and there is a simple solution. Does anyone have any ideas on how to fix this?

    Many many thanks in advance!!

    Dagur Maunason replied 4 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    February 16, 2022 at 6:41 am

    Hi Dagur.

    Try changing the 4th row to this

    var rowCount = Math.round(targetObj.sourceRectAtTime(0,false).height/txtSize);

    Andrei

  • Dagur Maunason

    February 16, 2022 at 10:41 pm

    I thought I tried that but apparently not properly if so.. All good now, and I could even remove row counting etc since sourcerect is now read before animation as intended. Thanks a ton Andrei!!

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