Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression problem NEED HELP PLease

  • Expression problem NEED HELP PLease

    Posted by Nikola Morin on November 23, 2020 at 7:20 pm

    Hi Everybody!
    I have this text layer and a shape layer at the right of the text layer. i want when the text change that my shape layer follow the text layer… For example if it’s i write “Hello Dear” the shape layer will be at 25 pixel of the end of the text layer…but if i write i love apple the shape layer will still be a 25 pixel of the text layer….. i’m struggling with that since a moment right now…

    Nikola Morin replied 2 years, 10 months ago 2 Members · 3 Replies
  • 3 Replies
  • Trent Armstrong

    November 23, 2020 at 9:49 pm

    Hi!

    What you’re looking for is the sourceRectAtTime() expression. You have the ability to check the width and height of a layer—including text layers.

    // Apply this expression to the position of the triangle layer

    txt = thisComp.layer(“THE TEXT”); // this is your text layer

    p = txt.transform.position;

    w = txt.sourceRectAtTime(0).width;

    h = txt.sourceRectAtTime(0).height * .5;

    padding = 25;

    p + [w, -h] + [padding, 0]

  • Nikola Morin

    November 24, 2020 at 4:18 pm

    Thank you very much!!!

  • Nikola Morin

    November 27, 2020 at 4:15 pm

    Hi Trent!!
    The expression that you gave me work totally fine….. but i think i don’t get the sourceRectAtTime thing completely….

    Now i want my text layer to play on the position on another text layer below….. and i just don’t know how to take the expression that you gave me and applied on this to work on the vertical position…… here a exemple of what i want to do….

    Thank you for your help man!!!

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