Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "Crate map, layering, the time model and the data flow."

# Architecture

This document describes the 2.0 crate map, the layering rules, the time model and
This document describes the AniMathIO 2 crate map, the layering rules, the time model and
the render/audio/export data flow. The authority for these rules is
[issue #156](https://github.com/AniMathIO/AniMathIO/issues/156).

Expand Down Expand Up @@ -102,7 +102,10 @@ under `editor/`: `menus`, `workspace`, `viewer`, `transport`, `timeline_view`,
`fields`, `audio_effects` (inspector audio-effect cards), `animations` (the inspector
Animations section and the Effects-tab preset library), `video_effects` (inspector video-effect cards), `inspector_view`, `media_pool`, `math` (Math tab, typed object dialog and inspector), `titles` (Titles tab), `dialogs`, `export_panel`
(export queue popover), `start_screen`, `templates`, `clip_ops`, `commands`, `project_io`,
`control_bridge`, `playback_glue`, `timeline_thumbnails` and `actions`. Shared drawing/resource helpers live in
`control_bridge`, `playback_glue`, `timeline_thumbnails`, `actions` and `update_check`
(at most one GitHub releases lookup per 24 h, a dismissable newer-release notice,
opt-out in Preferences or with `ANIMATHIO_NO_UPDATE_CHECK=1`, silent on failure).
Shared drawing/resource helpers live in
`support`; `color_edit` owns the live-preview transaction (colour pickers, sliders,
number scrubbing and the viewer's transform gizmo all preview through it, so one
gesture is one history entry). The gizmo maths in `viewer` shares the renderer's
Expand Down Expand Up @@ -180,9 +183,18 @@ once in `History`. Other commands and control calls finish a pending drag first,
so a colour change undoes in one step without swallowing adjacent edits. Asset
parameter selectors display names but commit asset identities (or `null` for None).

The undo stack is depth-capped (`History::with_limit`, default 500 entries);
the oldest entries are dropped. This bounds entry count, not bytes; dirty
state is tracked independently of whether undo is available.

Plain-JSON saves validate referenced asset bytes, atomically replace each
content-addressed sidecar, then publish the manifest. Failed sidecar writes
preserve the old manifest; already written unused assets may remain. Unix saves
also try to sync the containing directory after replacement (best effort).

## Time model (integer ticks)

AniMathIO 2.0 uses **integer ticks** at a fixed rate, with **rational frame rates**
AniMathIO 2 uses **integer ticks** at a fixed rate, with **rational frame rates**
on top. The rate is 705,600,000 ticks per second — the *flicks* constant, chosen so
frame and audio-sample boundaries are always exact:

Expand Down Expand Up @@ -212,7 +224,7 @@ boundary.

Each rule exists because of a specific v1 failure, and each is enforced by a test.

| v1 failure | 2.0 rule | Enforced by |
| v1 failure | AniMathIO 2 rule | Enforced by |
| --- | --- | --- |
| Live Konva nodes, `<video>`/`<audio>` elements and `AudioContext` source nodes stored next to project data; leaked contexts and silent preview after export. | **The project is plain data.** Decoders, GPU textures and audio streams live in an engine-owned resource pool keyed by asset hash. Removing a clip never has to release anything. | `core` has no IO/GPU deps; after deleting every clip and running GC the pool is empty. |
| Animations in a separate anime.js timeline seeked in parallel with the store. | **Animated values are always computed from (project, t)** and never kept in a second stateful object. Keyframes are data. | Property test: rendering at `t` is independent of which times were rendered or seeked before. |
Expand Down Expand Up @@ -880,3 +892,30 @@ backends paint it before clips; preview, PNG rendering and video export share th
policy. New default projects remain transparent; templates retain their configured
backgrounds. Math input nesting is limited to 64 levels and native typesetting
workers use an explicit 64 MiB stack.

## Bundled effects and presets

Text, shapes and the eight clip effects (grayscale, sepia, invert, saturate, brightness,
contrast, blur, opacity) use the bundled WASM components end to end, including CLI renders
and exports. Build them with `scripts/build-plugins.sh`; schema-1 and schema-2 projects
migrate automatically to plugin clips and plugin effects when loaded.

Animation presets are plugins too: `org.animathio.animations` offers fade, slide, zoom,
pop, spin, bounce, wipe and typewriter in/out presets plus breathe, shake, spin, hop and
flash emphasis. Pick them in the inspector's **Animations** section (In / Out / Emphasis,
with a duration stepper) or the Effects library, through the `apply_animation_preset` MCP
tool or `animathio-cli animations apply`. A preset becomes ordinary keyframes in one undo
step, so projects render and export without the plugin.

Audio effects are plugins too: `org.animathio.audio-basic` provides gain/trim, a 3-band EQ,
compressor, noise gate, high-pass filter, a voice-cleanup preset (high-pass + gentle gate +
de-esser) and `denoise` (spectral gating that learns the noise from the quietest frames). Clips and tracks carry ordered, undoable audio-effect chains that run in the shared
mixer, so preview and export sound identical; edit them in the inspector's Audio section, the
Effects library or the `list_audio_effects` / `add_audio_effect` MCP tools. Open a track header’s
**Audio effects** context-menu entry to edit its chain with the same controls. Clip audio-effect
parameters have keyframe controls, and parameter drags update playback live (throttled snapshots for the mix worker, never the
device callback). Video effects in the inspector have a bypass switch like audio effects.

Pixel effects accept project-sized frames up to 32 Mpx, with a 200 ms preview backstop and
the existing export budget. The host bounds guest metadata to 64 effects, 32 parameters
and 256-byte display strings.
9 changes: 6 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ animathio-cli render-seq sample.amio --from 30 --to 31 --width 1920 --height 108

## `export`

> Export fails (non-zero exit, no output file) when a plugin clip in the range cannot be rendered: `clip N (plugin 'id') cannot be exported: ...`. Build the plugins first (`scripts/build-plugins.sh`) or set `ANIMATHIO_PLUGIN_DIR`; `render` and `render-seq` still draw placeholders and print `warning:` lines for plugins that did not load.
> Export fails (non-zero exit, no output file) when a plugin clip in the range cannot be rendered: `clip N (plugin 'id') cannot be exported: ...`. Build the plugins first (`scripts/build-plugins.sh`) or set `ANIMATHIO_PLUGIN_DIR`; `render` and `render-seq` still draw placeholders and print `warning:` lines for plugins that did not load. An export whose output is the input project file itself is refused with `the output path is the open project file; choose a different file name` — the same rule covers the `--chapters` sidecar, so a render can never destroy the project.

Export an offline H.264 + AAC MP4. Export steps the preview renderer frame by
frame and encodes with the FilmCraft backend; it is never a recording of
Expand Down Expand Up @@ -234,7 +234,7 @@ animathio-cli import-media interview.mp4 -o interview.amio

## `import-v1`

Convert a v1 (Electron/TypeScript) `.animathio` project to a 2.0 `.amio` archive.
Convert a v1 (Electron/TypeScript) `.animathio` project to an AniMathIO 2 `.amio` archive.
Non-fatal warnings are printed to stderr. See
[`docs/migrating-from-v1.md`](./migrating-from-v1) for what maps.

Expand All @@ -259,7 +259,7 @@ animathio-cli import-v1 project.animathio -o imported.amio

## `import-manim`

Convert a Manim Community scene script (`.py`) to a 2.0 `.amio` archive.
Convert a Manim Community scene script (`.py`) to an AniMathIO 2 `.amio` archive.

<!-- help:import-manim -->
```text
Expand Down Expand Up @@ -931,3 +931,6 @@ Options:
Print help
```
<!-- /help:scenes -->

PNG outputs from render and render-seq also refuse to overwrite the input project,
including aliases through symlinks and hard links.
2 changes: 1 addition & 1 deletion docs/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: The editor
sidebar_label: The editor
sidebar_position: 3
description: "A tour of the AniMathIO 2.0 editor: library, viewer, inspector, timeline and export."
description: "A tour of the AniMathIO 2 editor: library, viewer, inspector, timeline and export."
---

# The editor
Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ title: Getting started
sidebar_label: Getting started
sidebar_position: 1
slug: /
description: "What AniMathIO 2.0 is, how to install it and how to make your first video."
description: "What AniMathIO 2 is, how to install it and how to make your first video."
---

# Getting started with AniMathIO 2.0
# Getting started with AniMathIO 2

AniMathIO 2.0 is a native editor for math animation videos, rewritten from scratch in Rust. The core is a
AniMathIO 2 is a native editor for math animation videos, rewritten from scratch in Rust. The core is a
small, reliable video editor: media clips, a multi-track timeline, transforms and keyframes, audio, preview
and export. Everything math-specific (text, LaTeX, graphs, shapes, effects, importers) is a sandboxed
WebAssembly plugin.

![The AniMathIO 2.0 editor](/img/v2/editor-main.webp)
![The AniMathIO 2 editor](/img/v2/editor-main.webp)

:::note Coming from 1.x?
The 1.x documentation is still online as [v1 (legacy)](/docs/v1/getting-started). Projects import with
Expand All @@ -33,7 +33,7 @@ The 1.x documentation is still online as [v1 (legacy)](/docs/v1/getting-started)
[Captions and automation](./captions-and-automation).
- **Scriptable.** Every edit is a serializable, invertible command, available from the editor, the command
line ([CLI](./cli)) and MCP clients ([Control protocol and MCP](./mcp)).
- **A new project format.** 2.0 saves `.amio` archives. 1.x `.animathio` projects import one way.
- **A new project format.** AniMathIO 2 saves `.amio` archives. 1.x `.animathio` projects import one way.

## Install

Expand Down
6 changes: 3 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Install
sidebar_label: Install
sidebar_position: 2
description: "Installers for AniMathIO 2.0 on Windows, macOS and Linux, and how to verify them."
description: "Installers for AniMathIO 2 on Windows, macOS and Linux, and how to verify them."
---

# Install AniMathIO 2.0
# Install AniMathIO 2

Download the installer from the [latest release page](https://github.com/AniMathIO/AniMathIO/releases/latest) (currently 2.1.0).
Every installer ships the desktop editor (`animathio`), the headless tool (`animathio-cli`) and the first-party
Expand Down Expand Up @@ -66,7 +66,7 @@ Debug binaries find `target/plugins` on their own.

## Coming from 1.x

2.0 uses a different project format (`.amio`). Convert a 1.x project with
AniMathIO 2 uses a different project format (`.amio`). Convert a 1.x project with
`animathio-cli import-v1 project.animathio -o imported.amio`, or use **Import v1** on the start screen. See
[Migrating from 1.x](./migrating-from-v1). The 1.x installers and documentation remain available as
[v1 (legacy)](/docs/v1/getting-started).
2 changes: 1 addition & 1 deletion docs/keyboard-shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: "The Premiere Pro style default keymap."

# Keyboard shortcuts

AniMathIO 2.0 defaults to Adobe Premiere Pro's Windows/Linux shortcuts, with
AniMathIO 2 defaults to Adobe Premiere Pro's Windows/Linux shortcuts, with
Ctrl mapped to Cmd (`secondary`) on macOS, following [Adobe's official default
list](https://helpx.adobe.com/premiere-pro/using/keyboard-shortcuts.html).
Help → Keyboard shortcuts (Ctrl+Alt+K) opens a searchable dialog over the same
Expand Down
Loading
Loading