Get Rect 2 Guide

Learn how to create smart rectangles, track mattes, and bounding boxes in After Effects with Get Rect 2.

Video Tutorial

How to install

Step 1 - Install script

Move the Get Rect 2.jsxbin file to the After Effects Scripts UI Panels folder.

After Effects (2023) > Scripts > Script UI Panels

Step 2 - Allow scripts

In After Effects, make sure “Allow Scripts to Write Files and Access Network” is on.

Preferences > Scripting & Expressions > “Allow Scripts to Write Files and Access Network”

Step 3 - Set expression engine to JavaScript

In After Effects, make sure your expression engine is set to JavaScript.

File > Project Settings > Expression Engine > Expressions > JavaScript

Step 4 - Open Get Rect 2

In After Effects, open the Get Rect 2 script.

Window > Get Rect 2.jsxbin

Step 5 - Activate license

Upon purchase of Get Rect 2, you will receive a license code.

You can retrieve your license code from your Gumroad account.

Step 6 - Dock Get Rect 2 panel

Now you can dock Get Rect 2 anywhere in your workspace. Get Rect 2 features a semi-responsive layout, to help it fit any workspace.

Creating Rectangles

create rectangle, track matte, or bounding box

With a layer, or multiple layers, selected, press the Create button to make a rectangle. You can toggle between rectangle, track matte, and bounding box using the icons next to the Create button. Each style will store their own preferences for the appearance settings.

Rectangle

A rectangle is a visible box that will surround the targeted layer(s). Hold shift + create button to make set the rectangle as a track matte for the targeted layer(s).

Track matte

A track matte is a hidden box that the targeted layer(s) will use as a track matte. Whenever the targeted layer(s) overlaps with parts of a track matte, that part of the targeted layer will be revealed, while everything else will remain hidden.

Bounding box

A box is a visible rectangle with squares on each corner and side of the rectangle. This is used to mimic the same types of bounding boxes used in design software such as Illustrator or After Effects.

Rect Appearance

When creating any rectangle, track matte, or bounding box, an effect will be added to the new shape layer called Rect Appearance. Here you can adjust most of the attributes or your rectangle – allowing you to tweak the appearance after it is created.

Rect Style

Rectangle style options

Fill

Toggle on the fill icon to include a fill when creating a new rectangle.

With the fill toggle on, you can set the default color of the fill using the color picker.

Stroke

Toggle on the stroke icon to include a stroke when creating a new rectangle.

Shift + click the stroke icon to switch between Miter Join, Round Join, and Bevel Join on the stroke corners.

With the stroke toggle on, you can set the default stroke color of the fill using the color picker.

Corner radius

Toggle on the corner radius icon to include rounded corners when creating a new rectangle.

Shift + click the corner radius icon to switch between Round Corners, Inverted Round Corners, and Bevel Corners.

With the corner radius toggle on, you can adjust the default radius of the corners.

Rect Source

Rectangle source options

Dynamic

Toggle on the dynamic icon to make the rectangle automatically adjust its size whenever the source changes. With the dynamic toggle turned off, the rectangle will conform to the size of the source based on the time the rectangle is created.

Custom Time

With the dynamic toggle turned on, you unlock the ability to enable custom time.

This will conform the rectangle to the size of the source at a specified time. Source Time is accessible in the Rect Appearance effect. By default this value will be set to the time the CTI is when the rectangle is created.

Multi-Source

Toggle on the Multi-Source icon to create one rectangle that will conform to all the layers selected.

With Multi-Source toggled off, each layer selected will have its own rectangle.

Use Font Height

Toggle on the Use Font Height icon to calculate the size of a text source layer based on its font, rather than its true bounding box. This is useful when creating text based boxes since it keeps the height of the rectangle consistent, while ignoring ascenders and descenders.

Include Rotation

With Include Rotation toggled on, the rectangle will factor in the source rotation while still remaining a level rectangle.

If this is toggled off, the rectangle will ignore any source rotation.

Rotate Path

With Include Rotation toggled on, you unlock the ability to enable Rotate Path.

This will rotate the actual path of the rectangle to match the rotation of the first source layer.

Rect Sides

Rectangle side options

Position

By default, all sides of a rectangle will be set to Auto. This means they will automatically conform to the given side of the source layer(s). You can set a value for any side (i.e. 0) in order to lock that side to a specific position.

To get a position back to Auto, you can delete the existing entry or type “Auto”.

Padding

This will set the amount of space between a given side of the rectangle and the same side of the source layer(s).

You can use the constraint toggles to keep the horizontal or vertical values consistent.

Animation

The animation toggles will automatically animate the rectangle wiping in from the selected direction (left, right, top, bottom).

You can turn on multiple animation toggles at the same time.

By default, each animation will add 2 keyframes to the beginning of the rectangle layer, lasting a half second.

Misc. Buttons

Miscellaneous Get Rect functions

Split Stroke

The Split Stroke button will separate the stroke from the selected shape layer, creating a new layer that is dynamically linked to the target layer, while containing only strokes – no fills. Conversely the stroke will be hidden on the original shape layer.

Note: this works on any shape layer – not just those created with Get Rect 2.

Trim Path

The Trim Path button will add a Trim Paths animation to the selected shape layer(s). By default this will be a half second animation beginning at the current time within the comp.

Hold shift + click Trim Path to reverse the direction.

Note: this works on any shape layer – not just those created with Get Rect 2.

Bake Rect Size

The Bake Rect Size button will convert a dynamic rectangle layer to a rectangle layer with the source shape set to what it is at the current time of the comp. The sides of the source(s) will be stored in a new effect called Rect Shape.

The Rect Appearance effect is not affected.

Bake Rect Path

The Bake Rect Path button removes any and all Get Rect effects and expressions. The new path will be equal to the value it is at the current time within the comp.

Note: this works on any shape layer – not just those created with Get Rect 2.

Bounding Box

When creating a bounding box, a special effect called Bounding Box will be applied to the new shape layer. Here you can adjust the appearance of a few attributes unique to bounding boxes.

Corner Point Size

This sets the size (in px) of the corner squares.

Mid Point Size

This sets the size (in px) of the side squares.

Point Corner Radius

This sets the roundness of each point (aka square) of the bounding box.

Match Point Stroke

When toggled on, the stroke width of each point (aka square) will match the stroke width of the rectangle.

Point Stroke Width

With Match Point Stroke toggled off, change this value to change the stroke width of the points (aka squares) independently from the main rectangle stroke.

Changelog

2.0.1

September 6, 2023
Fixed: UI bug that caused strange padding and made buttons disappear. 🤦‍♂️

2.0.0

August 23, 2023

Initial release