Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding expressions to text animator

  • Adding expressions to text animator

    Posted by Nikolay Arkhipov on December 15, 2019 at 2:08 pm

    Please, help me figure out what’s wrong…
    I need to animate text position using text animator. The idea is to make the text move from the left side of the rectangle to the center. So, if I define the position of this text manually (type a number), everything works fine. But, I need the position to be dependent on the rectangle size, so I use sourceRectAtTime expression, and it really gives me the very same value, BUT the text starts behave in a very strange way… and I can’t understand why. Please, have a look at the screenshots. The 1st one is where I put the value manually (it shows -625 instead of -625.5, I have just mistaken in a number); and the 2nd screen is what happens when I define this value by an expression.

    Screenshot 1

    Screenshot 2

    Nikolay Arkhipov replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 15, 2019 at 6:05 pm

    Try this:

    L = thisComp.layer(“Box”);
    r = L.sourceRectAtTime();
    p = L.toComp([r.left + r.width/2,0]) – position;
    [p[0],value[1]]

    Dan

  • Nikolay Arkhipov

    December 15, 2019 at 9:52 pm

    Thanks for your reply, however it doesn’t work…
    I just reread the post, and maybe I haven’t explained the interaction between layers correctly. So, there is the Text layer. Then there is a shape layer (Box), and it keeps the size of the text using sourceRectAtTime expression. Finally I’m going to apply an Alpha Matte and animate text revealing, that will go from the left side of the Box to its center, and become fully visible.

    I tried to change thisComp.layer(“Box”) to thisLayer, and even to thisComp.layer(“Text”) / or SAMPLE TEXT as it is in the project), but it didn’t work either… The contour moves, but the particular text stays still…

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