Hi, I need to create a MOGRT for a client with text that changes shape within this trapezoid outline.
Considering that the text can stretch in length, I can't figure out how to make the shape (trapezoid) stretch only in the middle part and not distort the angles.
Also, I'll need to add more trapezoids near to this one, which should start where this shape ends. So, when this one extends, these should stay the same distance apart. Thank you.
Copy link to clipboard
You can create the box using the Auto Resizing Background Shape iExpression.
You can turn the simple box into a trapezoid by using the shear parameter
Note that to create the mogrt you need a license of iExpressions, but the mogrt itself (and the Ae Project) then works also on machines where iExpressions is not installed.
Alterntively, you can also use our extension Pins & Boxes - in particular if the shape needs to be behind multiple objects:
1. create 4 pins at the corners of the text
2. create a trapezoid path and use the "Nulls From Paths.jsx" script that is included in Ae to create 4 null layers at the 4 vertices of the path (choose the option that the path follows the nulls, such that moving the nulls moves the path vertices).
3. parent the 4 nulls to the 4 pins - now the path resizes with the text.
If you need rounded corners, you can use the Connect Multiple Layers iExpression instead of the Nulls From Path. It can also create paths whose corners are connected to null layers, but with an additional roundedness parameter.
Copy link to clipboard
The basics can be solved with a couple of expressions if you use a shape layer rectangle and use Skew to generate the trapezoid.
I've uploaded a sample comp with the expressions. If I get time later today I'll add the paragraph justification code. You can then same the shape layer as an animation preset to create multiple copies with a single click. The shape layer always needs to be just below the text.
You can add sourceRectAtTime().left to the mix to compensate for Left, Right, and Center justified text.
Here is the modified code that takes care of the text justification:
//Transform Rectangle 1 /position txt = thisComp.layer(index - 1); box = txt.sourceRectAtTime(); x = box.width/2; y = box.height/2; t = box.top; l = box.left; [x + l, y + t]
Add this expression to the Transform Rectangle 1/Position property and remove the expression in the sample project from the Rectangle 1/Position property.