# Functions

![RigtRect button, anchor point position selector & help button](https://4127023610-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgrwpdIy2NXuWjh4qNa%2F-M0c0599gQMrLGZiapxY%2F-M0cJWXDkgQ38vDm-DBI%2Frigtrect_panel.png?alt=media\&token=9ab671db-f9ee-481b-9154-9162a2e23059)

The script depends on the numbers of selected layers:

#### No layer selected:

The script will create a fresh RigtRect setup in the selected composition. \
[More info →](https://docs.dezignphreak.com/rigtrect/functions/rigtrect)

#### 1 layer selected:

The selected layer will be rigged as RigtSource layer. [More info →](https://docs.dezignphreak.com/rigtrect/functions/rigtsource)

#### 1 layer selected + ALT click:

The selected layer will be rigged as RigtFill (constrain proportions while scaling) layer. [More info →](https://docs.dezignphreak.com/rigtrect/functions/rigtfill)

#### 1 layer selected + SHIFT click:

Fix a broken rig of the selected RigtRect or RigtSource layer. [More info →](https://docs.dezignphreak.com/rigtrect/functions/repair-a-broken-rig)

#### 2 layers selected:

The script will create a new RigtRect between the two selected layers.

{% hint style="info" %}
These layers can be any layers that have a position property.
{% endhint %}

#### 3 layers selected:

If the selection contains a RigtRect or RigtSource, the script tries to relink the rig to the other two layers.

{% hint style="info" %}
You can always change the handle layers in the RigtRect / RigtSource effect settings manually, but the 3 layers selection method is way more convinient.
{% endhint %}
