ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Luis Abaladas
Control x position with text width when source text is linked to another layer.
on Jun 9, 2020 at 9:55:50 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!


Return to posts index

Robert Müller
Re: Control x position with text width when source text is linked to another layer.
on Jun 9, 2020 at 10:57:08 am

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


Return to posts index

Luis Abaladas
Re: Control x position with text width when source text is linked to another layer.
on Jun 9, 2020 at 1:19:45 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]