You will want to use a shape layer and animate the size of the rectangle instead of using scale. Scale effects all properties, the size of a shape layer does not change the width of the stroke.
Yes, but is there away to do that so that the square only elongates from one side? By going and resizing, both sides of the square elongates together. I'm trying animate a square such that one side of the square stretches out into a rectangle. Thank you!
I don't know of way to do it with a shape but you could use solid with a mask and a stroke effect than just animate the mask path. I've heard a few pro's say that they prefer to work with masked solids rather than shapes whenever they can as you just have alot more control..
I sorta figured it out. You can't do it using the square/rectangle tool, you have to draw a square free hand with the pen tool. Then you go to Shape/Path/ (set a key frame), then select the side of the square and you can drag it out without distorting the stroke of the shape. The thing is, drawing a perfect square or rectangle by hand using the pen tool is a lot harder than it should be. I can't get it to snap to the grid lines (if that's even possible) so that I draw straight lines. Any suggestions?
You can do it that way...just enable snapping with the little icon to right of all the cursor icons. Or you could do it with the mask like I said because you can draw out a perect square mask with the shift key just like with a shape. Just create a solid the color you want the fill then with the layer slected draw out the square mask. Then apply the stroke effect from the effects panel...just type it into the search field to find it. Finally key the mask path property to drag out the side of the mask just like you did with the hand drawn shape.
If you're really unfamiliar with using masks maybe search for a tutorial on Youtube or in the AE help.
Sorry...to snap to grid you enable "Snap To Grid" in the View Menu. Alot of times the first point you draw will not snap so you need to back and snap it to the grid after the shape is drawn
Thanks for your help Gutter-Fish. I'm looking up some youtube tutorials now on masks, i know a little about them, but I guess not enough hahaha
Here is a step-by-step:
That is all there is to it. This is a very basic AE skill you should have in your toolbox.
- Make sure no layers are selected
- Double-click the rectangle shaped tool to create a new rectangle the size of your composition
- Select the new shape layer
- Press the U key twice to reveal all the modified properties of the shape layer including Zoe rectangle size
- Click the little infinity shaped icon to unlock the X and Y values for the rectangle
- Type in the new values for your rectangle like 500 x 900
- Activate the stopwatch to set your first keyframe
- Move down the timeline to a new position and change the 900 to 500
Rick i don't see anything in you instructions that would achieve what they're trying to do (I don't think.).
Adjusting the the size property, as far as know scales the rectangle from the center (even when the anchor point is somewhere else).
They want one side of the rectangle to remain stationary while the other side stretches out.
The only way to achieve this without effecting the stroke (as far as I know) is by animating the path itself.
So as far as I can see the only options are to create the shape with the pen tool as they already figured out.
Or to use a mask with a stroke effect.
But maybe I am missing something in your instructions?
If you want to move from a corner or an edge then you also animate the anchor point. This can easily be done with an expression added to the Rectangle Anchor Point property (not the layer Anchor Point). To lock the top left corner of the rectangle in position as you change the size the expression is:
- content("Rectangle 1").content("Rectangle Path 1").size/2
If you don't want to mess with the expression then as you animate the size of the rectangle just animate half the size value for the Rectangle Anchor Point. I use this technique all the time to create animated bar graphs and charts. A more sophisticated way to write the expression allow you do tie any corner of the rectangle to the anchor point. For bottom left it looks like this:
p = content("Rectangle 1").content("Rectangle Path 1").size/2;
We have simply defined the array and used the - sign to move the x value to the left side while the y value moves to the bottom. This makes numerically accurate animations very easy to do.
If you want to do this kind of animation quickly by eye you could also right click on Rectangle 1 (assuming it's the first rectangle in the shape layer) and convert the rectangle to a bezier path then simply use the pen tool or the transform path tool to do your animations. A shape layer will always give you more options and freedom than a mask on a solid with the stroke effect.
Here's a little video I just threw together:
Very informative video Rick! And I have a feeling others will benefit from it too, thanks so much for doing this!