# Functions

![RigtRect button, anchor point position selector & help button](/files/-M0cJWXDkgQ38vDm-DBI)

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 →](/rigtrect/functions/rigtrect.md)

#### 1 layer selected:

The selected layer will be rigged as RigtSource layer. [More info →](/rigtrect/functions/rigtsource.md)

#### 1 layer selected + ALT click:

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

#### 1 layer selected + SHIFT click:

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

#### 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dezignphreak.com/rigtrect/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
