Profile PictureThomas Alberti

Path Expression - Shape

1 rating

Path Expression - Shape is an After Effects (2019+, requires JavaScript as the selected expression engine in the project settings) preset that creates a fully featured parametric rectangle path. Rounding is included, so it also draws circles and ellipses. This preset packages the core path expression on a mask path with a corresponding effect control.

Step-by-step installation instructions included in the README.

This preset packages the core path expression on a mask path with a corresponding effect control. Controllable properties include position, scale, rotation, anchor point, height, width, and roundness, as well as input/output of position and orientation along path.

The core expression is a function that draws and transforms a shape or any set of points. It is designed to be as feature par as possible to native shape layers, with the added flexibility of being applied to any path property. The code is available here: Draw Shape Expression.js


No layers selected - Creates a new solid (dimensions equal to the active composition) with a mask named “Mask: Path Expression - Shape” and the expression in the mask path property. Adds the effect control “Path Expression - Shape” to control the shape parameters.

Any layer selected - Creates the mask and expression on the selected layer. Adds effect controls. Any previously existing masks are preserved. Usual mask modes apply.

Mask or mask path property selected - Adds the expression to the selected mask path property. Adds effect controls. Renames mask to “Mask: Path Expression - Shape.”

Position/Orientation IO - Animate the percent input value to drive the position and orientation output values.To link other properties to the output values, pickwhip the property you wish to link to the corresponding output value. In the expression editor, place that pickwhipped value into fromComp() like this, without the angle brackets:

fromComp(‹your position or rotation property here›)

By default the output controls assume mask paths. For shape layers, the targetPath variable needs to be edited to reference your desired shape layer path.

If you are not using this feature, disabling the expressions on the position and orientation output properties may help performance.


The expression and corresponding effect controls can be pasted onto any path property and layer. For multiple path expressions and effect controls on the same layer, manual edits to the expression are needed to link corresponding expressions and effect controls. One effect control can drive multiple path expressions just by duplicating the mask or shape.

The expression draws a 100px × 100px square at the origin of its layer (the top left corner). When the expression is disabled, the default path points of the mask preset form a 1920px × 1080px rectangle.


I enjoyed making this and learning linear algebra, which I had been meaning to do for a while. Linear transformations and matrix multiplication are cool. I wrote more in a blog post.

Add to cart

Path Expression - Shape.ffx, README

Copy product URL


(1 rating)
5 stars
4 stars
3 stars
2 stars
1 star

Path Expression - Shape

1 rating
Add to cart