Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Getting a shape to move in relation to typed characters

  • Getting a shape to move in relation to typed characters

     Graham Quince updated 1 month ago 4 Members · 4 Posts
  • Kurtis Taylor

    May 7, 2021 at 11:08 pm

    I am making a lower third title and I need a shape to move with the length of the name. I’ve got something to work using slider controls but it still requires manual manipulation on one layer. How do I get a shape to move in relation to typed characters?

  • Chris Voelz

    May 8, 2021 at 6:44 pm

    You can use SourceRectAtTime to calculate the size of the text box. Once you get that you will be able manipulate the shape to move with the length of the text.

  • Kevin Camp

    May 10, 2021 at 3:58 pm

    As Chris points our, sourceRectAtTime() is the way to go. Here is how I normally do it.

    First I parent the shape layer to the text layer and then set the shape layer’s position to 0,0.

    Then in the shape layer’s path size try this expression:

    rect = parent.sourceRectAtTime() ;
    pad = 20 ; //set this as needed to create pad around the text
    x = rect.width + pad ;
    y = rect.height + pad ;
    [ x, y ]

    And in the path position (this is the contents>shape>path>position, not the transform>position you zeroed earlier) try this expression:

    rect = parent.sourceRectAtTime() ;
    x = rect.width / 2 + rect.left ;
    y = rect.top / 2 ;
    [ x, y ]

    You may find that you want the hight to be fixed, particularly if you are using lowercase or have punctuation that extends bellow the baseline (like most commas). If that is the case, set the y-value in the first expression to a fixed value, like y=60+pad, for example.

  • Graham Quince

    May 15, 2021 at 9:31 am

    Alternatively, there’s another approach, where you apply effects to the text layer to draw your text box’s background:

    https://www.youtube.com/watch?v=hjxGLOWrmD4

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Viewing 1 - 4 of 4 posts

Log in to reply.

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