> For the complete documentation index, see [llms.txt](https://plugin-everything.gitbook.io/textbox-3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plugin-everything.gitbook.io/textbox-3/expression-controls.md). Agents can also search and read this documentation through its [MCP server](https://plugin-everything.gitbook.io/textbox-3/~gitbook/mcp).

# Expression Controls

Open `Expression Controls` near the bottom of the effect to keyframe or link the shape, fill, and stroke modes. These After Effects menus control the same settings as the icon selectors in `Effect Controls`.

| Control              | What it selects                                                                                     |
| -------------------- | --------------------------------------------------------------------------------------------------- |
| `Shape Mode Control` | The geometry of the box. [Shape Mode](https://plugin-everything.gitbook.io/textbox-3/shape-mode.md) |
| `Fill Mode`          | The solid or gradient fill. [Gradient](https://plugin-everything.gitbook.io/textbox-3/gradient.md)  |
| `Stroke Mode`        | How the outline is drawn. [Stroke](https://plugin-everything.gitbook.io/textbox-3/stroke.md)        |

## Keyframe a mode change

1. Open `Expression Controls` for TextBox 3 and move to the starting frame
2. Choose the initial menu item and click its stopwatch
3. Move to a later frame and choose the next menu item

The mode switches at the keyframe. To hide a fill change during a fade, animate `Fill Opacity` to 0%, switch `Fill Mode`, then fade the fill back in.

## Drive a mode with an expression

To add an expression to a mode menu, **Option-click** its stopwatch on macOS or **Alt-click** it on Windows. The expression can return a number from the table below or use the pick whip to follow the matching mode on another TextBox 3 instance. The icon selector shows the evaluated result while an expression is enabled. Turn off the expression to choose a mode with the icons again. [Adobe's guide to editing expressions](https://helpx.adobe.com/after-effects/desktop/work-with-expressions/edit-expressions/edit-expressions.html).

### Menu values

| Value | `Shape Mode Control` | `Fill Mode` | `Stroke Mode` |
| ----- | -------------------- | ----------- | ------------- |
| `1`   | `Auto`               | `Mono`      | `None`        |
| `2`   | `Superellipse`       | `Linear`    | `Normal`      |
| `3`   | `Polystar`           | `Radial`    | `Solo`        |
| `4`   | `Speech`             | `Conical`   | `Subtract`    |
| `5`   | `Custom`             | `4-Point`   | Unused        |

### Toggle an outline with a checkbox

Add After Effects' `Checkbox Control` to the same layer as TextBox 3 and rename the control effect `Show Outline`. Add this expression to `Expression Controls` > `Stroke Mode`.

```javascript
effect("Show Outline")("Checkbox") == 1 ? 2 : 1
```

The checkbox selects `Normal` when checked and `None` when unchecked. You can keyframe the checkbox or link more layers to it through their `Stroke Mode` expressions. [Adobe's guide to Expression Control effects](https://helpx.adobe.com/after-effects/desktop/work-with-expressions/expression-controls/expression-controls.html).
