Copy link to clipboard
Copied
Hello! I need to create an animated lower third and export ir as a mogrt.
I have a box with three rounded corners and two lines of text inside it, as shown in the video attachment.
The box is made of one triangle, two rounded rectangles and a squared rectangle in the middle, as shown in the picture below.
I used the following expression on the anchor point of the rectangles to have them scale from left to right:
xSize = content(1).content(1).size[0];
[-xSize/2,value[1]]
However, I still need to keyframe the size. I wonder if it's possible to make the size of the box change as the text layer is edited, but without changing the rounded corners radius... I've seen tuorials for automated text boxes but they are always with squared rectangles.
In my mind, I need some expression to parent the size of the rectangles to a box with the text inside it, but I can't think of it
Thank you!
Copy link to clipboard
Copied
Your approach is flawed. Don't animate scale, animate the size of the rectangle and it will not affect the roundness.
You can also either tie the rectangle position property to the size or the Rectangle/transform/anchor point by half of the width.
I am replying on a mobile device so I'm not going to give you the expression but if someone else doesn't jump in, I'll post more later.
If you want it real easy though, here's a link to my magic text box preset. Just double click it to create a new shape layer and then drag it hello the text layer.
The animation reset I'll show you how to set up we're background layer so it always stays right under the text. A couple more expressions and you can animate with of the background.
I'm preparing an in-depth tutorial series on are automating text layers that will cover everything you're looking for and more.
Copy link to clipboard
Copied
Hey! I'm sorry, I wrote that wrong. I'm not animating scale, I'm animating size as you said. I'll correct that.
But the problem I'm having is to link the size to the text layer, while maintaining the padding from the text to the corners.
I tried your preset but couldn't figure out how to properly use it, I'll wait for your guide! Thanks for the reply!
Copy link to clipboard
Copied
If I'm reading your question correctly, you're in need of the services of sourceRectAtTime() and linear.
sourceRectAtTime() measures the bounding box of a given layer (your text layer, in this case), and can use that height/width to do .... something else!
Here are a few excellent tutorials on how to use this function.
https://www.youtube.com/watch?v=CVliDoNgoCg
https://www.youtube.com/watch?v=In4miXUdxko
For actually animating it on, linear comes into play.
Linear is the magic sauce that lets you translate one property into another.
https://www.youtube.com/watch?v=2h9ZfUHVG6Q
I typically use a slider (expression control). Animate that from say, 0-100 as the thing that controls your "animate on" move. Using linear, that 0 - 100 becomes 0 - (current text width) by using the variable that sourceRect creates.
Let us know if you need more guidance! This should be all the pieces necessary, and it seems like you may already be expression-savvy enough to get the rest of the way. Good luck!
Copy link to clipboard
Copied
I will have a new tutorial out soon. The introduction to the series covers what you need to turn your project into a usable MOGRT. I'll post a link as soon as it is up.
I would use two shapes to create the main shape and tie them together with simple expressions. If you have a single rounded rectangle you can use this expression to tie the position of the lower-left corner to the bottom of the rounded rectangle and then just animate the size of the rounded rectangle to get them both to change.
// size for bottom left Rectangle
size = content("Round Corners").content("Rectangle Path 1").size / 2;
// bottom left position
src=content("Btm Left").content("Rectangle Path 1").size / 2;
[- src[0], src[1]]
Use that for the basis of your shape and then combine the expressions in my preset to drive everything. Throw in a slider for horizontal and vertical size animation for the whole thing or combine a single slider for height and width and you have it.
I will let you know when the tutorial is ready. It will be part one of a ten tutorial training series.