Anyone know how to scale rounded rectangles imported from Illustrator?
Copy link to clipboard
Copied
I currently work as a motion designer and work directly with a graphic designer. Our workflow consists of him creating the design in Illustrator and then I animate in AE. The most efficient way for me to import objects and shapes is by using the Overlord plugin. So when I try to scale the the rounded rectangles that we use in our design, it gets distorted. I've tried looking online for tutorials and other forum posts but it all leads me to using expressions for shapes that were created within AE and not shapes/paths imported from Illustrator. Anyone have any tips or advice on how to scale shapes imported from Illustrator without any distortion? Thanks in advance!
Copy link to clipboard
Copied
Do you mean scale without the radius of the rounded corners changing? If that is the problem, then converting Vecdtor Laers to Shapes won't help. You will have to use the shapes as a template and then create parametric shapes like Rectangles, set the Rectangle/Roundness value to match the original radius, then animate the Rectangle/Size property to increase or decrease the size without changing the radius.
If you need to keep the radius from distorting as you change the size of the layer by resizing the layer in X or Y only, then the same workflow applies. The shape needs to be parametric.
The only other option I can think of is to select the original path, then go to the menu and get the Create Nulls From Paths Extended script. If you select Points Follow Nulls and check the Handle Controls, you can add nulls for every point, and nulls for the bezier handles. You can Add a new Null to the comp and position it in the middle of the shape, Parent all of the Point nulls (they will all have parents) to the Center Null, then add expressions to each of the Bezier Handle nulls that maintain their distance from their center point. It will be a mess, and I'd have to fiddle with the expressions for all the bezier handle nulls to figure out how to maintain their relative position from each point.
If none of those suggestions help, please post a screenshot showing the modified properties and the Path of one of the problem layers. That's the only way I can think of to help you.
Copy link to clipboard
Copied
I took another few minutes this evening to consider the Points Follow Nulls approach to what I think is your desired workflow.
If you have a rectangle path with rounded corners and you use the standard Create Nulls From Paths/Points Follow Nulls script to create nulls for every point, you can add a couple of Slider Controls or a Point Control. to a Null (Control) layer and then add some simple expressions to the null pairs at each corner. The pair of nulls in the top right corner takes the values from the expression controls and adds them to the original values using a simple Value + Effect Control expression. The top left pair of nulls needs to subtract the X Effect Control value from the original position value and add the Y. The bottom left pair adds the X and subtracts the Y from the Control, and you guessed it, the bottom right subtracts both X and Y from the pair of nulls.
Then if you parent all of the Point nulls to the Control Null (layer-So you can see it in the demo) and lock the Control layers scale to 100% with an expression, you can scale the rectangle with the sliders or point control, and move and rotate it by animating the Control layers position and rotation.
The comp looks something like this:
This should work for any path that has control points. You just have to figure out whether the control handles for the pats are right or left, above or below the center of the shape, and apply the appropriate math to the Expression Control value.
I have uploaded a project file.