Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control x position with text width when source text is linked to another layer.

  • Control x position with text width when source text is linked to another layer.

    Posted by Luis Abaladas on June 9, 2020 at 9:55 am

    Hi guys!

    I have a Main Text Layer, controlling the text from another Text Layer (with different text styles from the main text layer).
    I do have a 3rd Layer that needs to be affected by the position of the Text Layer width.

    In my head that would be something very straight forward to do. I should just use something like
    thisComp.layer("Text Layer").transform.xPosition + thisComp.layer("Text Layer").sourceRectAtTime().width;

    Unfortunately, the expression is reading the width of the Main Text Layer instead of the Text Layer .
    I’m also having the text-align to the Right, so the 3rd Layer should be moving to the left direction but I guess that’s just using a – instead a +.

    Thanks in advance!

    Luis Abaladas replied 5 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Robert Müller

    June 9, 2020 at 10:57 am

    Hm, this sounds about right to me. Can you post a screenshot of your setup, like how you have linked the different layers?

  • Luis Abaladas

    June 9, 2020 at 1:19 pm

    Yup, it was right… just me being a potato.
    I just realized that the text layer had a scale.

    Just multiplied the scale value to the .sourceRectAtTime().width and it works just fine.

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