# aexlo — After Effects Plugin Runtime
New to the repository? Start with the [getting started guide](https://github.com/potistudio/aexlo/blob/master/docs/getting-started.md), then explore the [examples](https://github.com/potistudio/aexlo/blob/master/examples/README.md), GUI, and [verification playground](https://github.com/potistudio/aexlo/blob/master/playground/README.md).
> Load, run, and render After Effects plugins (.aex) outside of After Effects.
## What
**aexlo** is a Rust crate that emulates the After Effects plugin runtime.
It loads and renders `.aex` plugins by re-implementing the AE Plugin SDK —
the same interface After Effects itself exposes to plugins.
By default, host-dependent features (such as UI and application callbacks)
are answered by a headless host, giving you full control over what to override
and how to integrate plugins into your own application: implement `AppHost`
and install it with `Host::install` before loading plugins.
## Why
**Adobe After Effects** is the most widely used video editor in the world,
and there is a rich ecosystem of powerful plugins built for it.
However, all of these plugins are designed to run exclusively within After Effects.
**aexlo** emulates the After Effects plugin runtime, allowing AE plugins to run outside of After Effects entirely — much like Wine runs Windows applications on Linux.
## Who This Is For
- **Plugin developers** who want to test their plugins without spinning up a full After Effects instance.
- **Software developers** who want to make their software compatible with After Effects plugins.
- **Artists** who want to integrate After Effects plugins into their image processing workflows.
## Capabilities
- Load and render After Effects plugins outside of After Effects.
- Selectively override or re-implement SDK commands, suites, and callbacks
to fit your specific workflow.
## Status
> [!WARNING]
> This project is **currently under heavy development**.
> The latest progress of this project can be seen on the [master branch](https://github.com/potistudio/aexlo/tree/master).
## Quick Start
### Requirements
- Rust 1.99.0 or later
- Windows x64 or macOS arm64
> [!NOTE]
> After Effects plugins target Windows and macOS only, so Linux is not currently supported.
### Use the library
```bash
cargo add aexlo
```
```rust,no_run
use aexlo::{Depth8, Host, Layer, ParamValue, Time};
fn main() -> aexlo::Result<()> {
// On Windows pass the `.aex` file, on macOS the `.plugin` bundle.
let mut fx = Host::get().load("MyEffect.aex")?;
println!("{}", fx.about()?);
fx.set_input_layer(Layer::<Depth8>::black(1920, 1080));
fx.set_param(1, ParamValue::Float(0.5))?;
fx.set_time(Time::frame(0, 30));
fx.render_frame()?;
let output: Layer<Depth8> = fx.read_output()?;
Ok(())
}
```
A plugin is native code that runs inside your process; see the crate docs on
[docs.rs](https://docs.rs/aexlo) for the trust, process and threading model.
### Build from the repository
```bash
cargo build
```
## Toolkit
`aexlo.toml` describes "render this plugin under these conditions" once, as
presets; the `aexlo` CLI then tests, benchmarks and previews them. The full
specification is [docs/toolkit.md](https://github.com/potistudio/aexlo/blob/master/docs/toolkit.md).
The CLI and its toolkit crates are not published on crates.io; install the CLI
from the repository:
```bash
cargo install --git https://github.com/potistudio/aexlo aexlo-cli
```
```toml
[plugin]
artifact = { macos = "build/MyGlow.plugin", windows = "build/MyGlow.aex" }
[defaults]
depth = [8, 16, 32]
[[preset]]
name = "dot_glow"
input = { generate = "dot", at = [320, 240], radius = 2 }
size = [640, 480]
params = { Radius = 100.0, Mode = "Screen" }
```
```bash
aexlo presets # the variants the presets expand to
aexlo test --bless # write goldens; later `aexlo test` compares
aexlo test --strict # + guard bands, leak and checkout tracking
aexlo test --fuzz 100 # random parameters, failures as presets
aexlo bench --save-baseline main # later: aexlo bench --baseline main
aexlo render --preset dot_glow -o dot_glow.png
aexlo check # what CI runs (.github/workflows/aexlo-check.yml)
```
`aexlo help` lists every command, and `aexlo help <command>` (or
`aexlo <command> --help`) shows its options.
Every variant runs in a worker process, so a crashing plugin fails one run,
not the suite. Rust plugins add `aexlo-test` as a dev-dependency for
in-process `#[aexlo_test::test]`s with frame assertions.
To see what a plugin declares without rendering it:
```bash
aexlo info MyGlow # PiPL, ABOUT text, flags and parameters
aexlo info MyGlow --pipl # the PiPL alone, without loading the plugin
```
To see what a plugin does, drive it from a prompt in a terminal UI:
```bash
aexlo inspect build/MyGlow.plugin # TUI; `:help` lists the commands
aexlo inspect MyGlow --exec "render; set Radius 50; render smart"
```
It traces every command and the host suite functions the plugin calls back,
totals them per function, and shows the parameters, the `PF_InData` /
`PF_OutData` state, the handles and worlds the plugin holds as a hex dump
(highlighting what the last command changed) and the output frame. Focus a
trace line (Enter, or `:focus <text|#seq>`) for a diagnosis of it: the call's
arguments and result, the command it ran in, the memory it allocated or
names and whether that is still held, or, for a failed command, its error
and the last call before it. `--exec` prints the same analysis as text. Given a crate directory, `:reload` rebuilds
it and keeps the parameter values.
For agents and scripts, `--json` prints one JSON object per line
instead: `loaded`, then a `command` per command (its result, the `PF_Cmd_*`
it issued with their errors, and the `#seq` that `focus` takes), a `focus`
with the diagnosis in sections, and a final `report`. The plugin's own output
goes to stderr, so stdout stays parseable. `--script -` reads the commands
from stdin and answers each before reading the next, so one loaded plugin
can be driven over a pipe; `report` prints the analysis on demand, `clear`
forgets the trace so far and `quit` ends the session.
```bash
aexlo inspect MyGlow --json --exec "render; focus checkout"
aexlo inspect MyGlow --json --script - # one command per line on stdin
```
Every option, command and JSON field is described in
[docs/inspect.md](https://github.com/potistudio/aexlo/blob/master/docs/inspect.md).
To see how far aexlo can drive plugins you did not write, run them through
`aexlo compat`. It loads each one and runs it on every render path and depth,
with other inputs, sizes and times, and with each parameter set to other
values, one scenario per worker. It reports `ok`, `partial`, `n/a`, `error`,
`crash` or `timeout` per scenario, then lists the missing suites, stubs and
declined calls the plugins asked for, with the most widespread first. A saved
baseline shows which scenarios a change to aexlo made worse:
```bash
aexlo compat fixtures/plugins/macos --save-baseline compat.json
aexlo compat fixtures/plugins/macos --baseline compat.json # exit 1 if any got worse
```
See [docs/compat.md](https://github.com/potistudio/aexlo/blob/master/docs/compat.md).
## Implementation Progress
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣀ 89% (32/36)
> ○ fully implemented / △ only partially implemented / × not implemented
| ○ ANSI | ○ AE App | ○ AE Adv App | ○ Cache On Load |
| ○ Batch Sampling | ○ AngleParam | ○ AE Adv Item | △ Channel |
| ○ Color | ○ ColorParam | ○ AE Adv Time | ○ GPU Device |
| ○ Color16 | △ Effect Custom UI Overlay Theme | | ○ Plugin Helper |
| ○ ColorFloat | △ Effect Custom UI | | ○ Plugin Helper 2 |
| ○ Fill Matte | ○ Effect UI | | |
| ○ Handle | ○ Param Utils | | |
| ○ Iterate8 | ○ Path Data | | |
| ○ Iterate16 | ○ Path Query | | |
| ○ IterateFloat | ○ PointParam | | |
| ○ Pixel Data | × Effect Sequence Data | | |
| ○ Pixel Format | | | |
| ○ Sampling8 | | | |
| ○ Sampling16 | | | |
| ○ SamplingFloat | | | |
| ○ World | | | |
| ○ World Transform | | | |
△ Effect Custom UI / Overlay Theme: theme values are served, and Drawbot draws
during `PF_Event_DRAW`. The CLI never sends `PF_Cmd_EVENT`; an embedder does.
△ Channel: layers are plain 2D images and report no auxiliary channels.
### AEGP
⣿⣿⣶⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀ 14% (5/36)
| △ Layer | △ Stream | ○ World | △ Color Settings |
| △ Comp | △ Dynamic Stream | ○ Memory | △ Register |
| △ Item | △ Keyframe | ○ Iterate | △ Utility |
| △ Light | ○ Persistent Data | △ Render | × Camera |
| △ Effect | △ Mask | △ Render Options | × QueryXform |
| △ PF Interface | △ Mask Outline | △ Layer Render Options | × Math |
| × Proj | × Text Document | × Composite | × Compute Cache |
| × Footage | ○ Text Layer | × Canvas | × Hash |
| × Collection | | × Sound Data | × Render Async Manager |
| × Marker | | | |
△ Layer / Comp / Item / Light / Effect / PF Interface / Stream / Dynamic Stream / Keyframe: the project is aexlo's fixed one-layer comp, with no keyframes.
△ Mask / Mask Outline: read the masks an embedder puts on the layer with `set_mask_paths`; they cannot be changed.
△ Render / Render Options / Layer Render Options: checkout returns the effect's own input.
△ Color Settings: the working space is sRGB, with no colour management.
△ Register: idle hooks are recorded and never called.
△ Utility: there is no script engine (`AEGP_IsScriptingAvailable` says so and `AEGP_ExecuteScript` does nothing), no undo history and no palette UI. `AEGP_GetPluginPlatformRef` gives no bundle on macOS.
### Drawbot
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ 100% (6/6)
| ○ Pen | ○ Image | | |
Text uses a system sans-serif. `DrawString` draws nothing when none is installed.
## License
This project is licensed under the [MIT License](https://github.com/potistudio/aexlo/blob/master/LICENSE).