Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions 2 text layers adapting to the x Size of a shape layer

  • 2 text layers adapting to the x Size of a shape layer

  • Sandro Maia

    October 7, 2022 at 12:59 am

    Hi. I have this shape layer with a rectangle path inside and i used an expression to separate the size property “x” and “y” because i needed to animate the shape from a circle to a rectangle depending on the size of the text (I managed to figure out this part). But i can’t seem to make the shape adapt to both texts depending on the size of both of them. If i use something simple like:

    (thisComp.layer("Name").sourceRectAtTime().width + (thisComp.layer("Job tite").sourceRectAtTime().width))

    It won’t work because it’s calculating both values at the same time.

    Is it possible to have this work on the “x” size property of the shape, keeping in mind that “Name” layer could be bigger than “Job Title” and vice versa.

  • Dan Ebberts

    October 7, 2022 at 3:37 am

    Maybe something like this:

    w1 = thisComp.layer("Name").sourceRectAtTime().width;
    w2 =thisComp.layer("Job tite").sourceRectAtTime().width;
    Math.max(w1,w2)
  • Sandro Maia

    October 7, 2022 at 3:00 pm

    Worked perfectly Dan! You’re a life saviour! Thank you!

Viewing 1 - 3 of 3 posts

Log in to reply.

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