Activity › Forums › Adobe After Effects › Getting a shape to move in relation to typed characters
-
Getting a shape to move in relation to typed characters
Posted by Kurtis Taylor on May 7, 2021 at 11:08 pmI 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?
Graham Quince replied 5 years, 3 months ago 4 Members · 3 Replies -
3 Replies
-
Chris Voelz
May 8, 2021 at 6:44 pmYou 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 pmAs 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 amAlternatively, 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.
Reply to this Discussion! Login or Sign Up