mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-29 17:43:57 +01:00
docs: ADR 0041 Selection tool on raw drawings; ADR 0031 remaining list, roadmap, changelog (M1)
This commit is contained in:
1 parent
ce7f4070f4
commit
ce4af03c01
6 files changed
+168
-9
No files matched your search
@@ -99,6 +99,7 @@ OR Apache-2.0) is noted in the table.
|
||||
| Brush outlines (the swept tip as a signed distance field: exact distance to the convex hull of two tips, L2 for round and L∞ for square tips, minimised in closed form; traced at level zero) | `crates/geom/src/brush.rs` | Standard sweep and distance-field constructions from the public computer-graphics literature; behaviour of Animate's Brush tool learned from Adobe's public help and observation | Own implementation (ADR 0033); no Adobe code or presets. |
|
||||
| Eraser (the swept tip as a fill in the planar merge whose regions are dropped; exact fill areas by Green's theorem with five-point Gauss–Legendre quadrature) and Eyedropper | `crates/engine/src/cmds_erase.rs`, `crates/engine/src/cmds_paint.rs` | Green's theorem and Gauss–Legendre quadrature (public mathematical results); behaviour of Animate's Eraser and Eyedropper learned from Adobe's public help and observation | Own implementation (ADR 0034); no Adobe code or presets. |
|
||||
| WebAssembly plug-in host (module validation, limits, fuel, resumable host calls) | `crates/plugins` | W3C WebAssembly Core Specification 1.0 / 2.0 (W3C Royalty-Free Patent Policy); the `wasmi` interpreter (MIT OR Apache-2.0) | Host model ported from PhotoCraft's filter plug-ins (same project family and licence) and extended with the AniCraft request ABI (ADR 0017). |
|
||||
| Selection tool on raw shapes: bending an edge (least-squares control-point move), following a bent edge in every shape that shares it, snapping, a marquee that cuts | `crates/geom/src/raw.rs`, `crates/geom/src/planar.rs`, `crates/engine/src/cmds_raw.rs` | Bernstein polynomials and least squares (public mathematical results); behaviour of Animate's Selection tool learned from issue #42, Adobe's public help and observation | Own implementation (ADR 0041); no Adobe code. |
|
||||
| De Casteljau subdivision, Ramer–Douglas–Peucker simplification | `crates/geom/src/edit.rs` | Public mathematical results (de Casteljau 1959; Ramer 1972; Douglas & Peucker 1973) | |
|
||||
| WAV (RIFF WAVE) reading and writing: PCM 8/16/24/32-bit, IEEE float, `WAVE_FORMAT_EXTENSIBLE` | `crates/audio/src/wav.rs` | Microsoft/IBM, *Multimedia Programming Interface and Data Specifications 1.0* (1991), and Microsoft's public `WAVE_FORMAT_EXTENSIBLE` description | Public file format descriptions. |
|
||||
| Resampling by cubic Hermite (Catmull-Rom) interpolation | `crates/audio/src/mix.rs` | E. Catmull and R. Rom, *A class of local interpolating splines* (1974); R. Keys, *Cubic convolution interpolation for digital image processing* (1981) | Public mathematical results. |
|
||||
|
||||
@@ -2,6 +2,29 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
* **The Selection tool on raw drawings** (ADR 0041, issue #42). With Object Drawing off, the
|
||||
Selection tool now edits raw strokes and fills the way Animate does:
|
||||
* Drag an unselected line or the edge of a fill to **bend** it. The segment becomes a curve
|
||||
through the point you drag, its ends stay put, and a fill under an outline (or next to it)
|
||||
bends with it. Straight lines stay straight until you drag them.
|
||||
* Drag an unselected **corner or end** to move it. Every raw shape that shares the point
|
||||
moves with it, so the drawing stays joined; where a line ends on an edge, the edge moves
|
||||
too.
|
||||
* Drag a fill to move only that fill, not its outline. Drag anything selected to move the
|
||||
selection.
|
||||
* A small corner or curve mark next to the pointer shows what a drag will do.
|
||||
* Dragged points and selections **snap** to corners, ends, lines and fill edges within 10
|
||||
screen pixels, at any zoom, with a ring where they snap. Arrow-key nudges join ends within
|
||||
0.2 px at their midpoint, and an end that comes within 0.2 px of a line goes onto it
|
||||
without changing the line.
|
||||
* The **marquee** selects the parts of raw fills and lines under it, cut at its edges, and
|
||||
objects wholly inside it; Shift adds more. If you click away without changing them, the
|
||||
drawing is whole again: selecting is never an undo step and leaves a saved file saved.
|
||||
* Each drag is one undo step, and what it changed merges again when you let go.
|
||||
|
||||
Headless: `path.bend_segment`, `raw.move_point`, `raw.select_rect`, `raw.merge`, `raw.hit`,
|
||||
and `snap`/`from` on `element.translate`; plug-ins may call them.
|
||||
|
||||
* **Sound effects, layer volume and sounds inside symbols** (ADR 0039, M5 second slice).
|
||||
* Properties › Sound has an **Effect**, as in Animate: Left channel, Right channel, Fade left
|
||||
to right, Fade right to left, Fade in and Fade out, shaped over the time the sound is
|
||||
|
||||
@@ -108,10 +108,12 @@ the program; nothing was copied.
|
||||
* Adjacent fills of different colours are separate paths, so antialiasing can show a faint seam
|
||||
where they meet, as in Animate.
|
||||
* Remaining parts of issue #42 (later slices, on this model):
|
||||
* bending a segment by dragging it with the Selection tool;
|
||||
* snapping dragged points to points and strokes within 10 screen pixels;
|
||||
* moving a point to move every shape that shares it (Subselection and arrows);
|
||||
* a marquee that selects parts of fills and strokes;
|
||||
* ~~bending a segment by dragging it with the Selection tool~~, ~~snapping dragged points
|
||||
to points and strokes within 10 screen pixels~~ (and keyboard moves within 0.2), ~~moving
|
||||
a point to move every shape that shares it~~ (with the Selection tool) and ~~a marquee
|
||||
that selects parts of fills and strokes~~: done in ADR 0041;
|
||||
* moving shared points with the Subselection tool and its arrows;
|
||||
* a marquee that selects across layers (ADR 0041 keeps a selection on one layer);
|
||||
* Subselection anchors and handles of connected raw shapes;
|
||||
* merging the Paint Bucket's fills and pasted raw shapes;
|
||||
* importing Animate's raw shapes (XFL) as raw shapes;
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
# ADR 0041: Selection tool on raw drawings
|
||||
|
||||
* Status: accepted (2026-11-10)
|
||||
* Relates to: ADR 0031 (merge drawing), ADR 0004 (destructive actions), ADR 0001 (undo
|
||||
snapshots), issue #42 (sections 1, 2 and 4)
|
||||
|
||||
## Context
|
||||
|
||||
Merge drawing's first slice (ADR 0031) made the shape tools draw raw strokes and fills, stored as
|
||||
one element per fill region and per stroke run. Clicking selected one of them, but the Selection
|
||||
tool still treated them as objects:
|
||||
|
||||
* dragging an unselected line moved it;
|
||||
* a corner could not be pulled;
|
||||
* nothing snapped;
|
||||
* a marquee selected whole shapes whose boxes it touched.
|
||||
|
||||
Issue #42, from an Animate user, describes the Animate behaviour:
|
||||
|
||||
* drag a segment away from its ends to curve it;
|
||||
* drag an endpoint or corner to move it;
|
||||
* drag a fill to move only that fill;
|
||||
* points snap to points, strokes and fill edges within 10 screen pixels when moved by the mouse,
|
||||
and within 0.2 document pixels when moved by the keyboard (anchors meet at their midpoint; a
|
||||
point snaps onto a line without changing it);
|
||||
* a marquee selects the parts of fills and strokes under it.
|
||||
|
||||
Behaviour was learned from the issue, Adobe's public help pages and watching the program; nothing
|
||||
was copied.
|
||||
|
||||
## Decision
|
||||
|
||||
1. **Shared geometry is edited in every copy.** ADR 0031's model stores a shared edge or corner
|
||||
once in each raw shape that has it. We keep that model and make each edit change all the
|
||||
copies alike, then merge the shapes again. Pure parts are in `anicraft_geom::raw`:
|
||||
* `follow` replaces every stretch of a path that runs along an edge (within `SNAP`) with the
|
||||
same stretch of the bent edge. It splits a longer segment at the edge's ends first.
|
||||
* `anchors_at` gives a path's anchors at a point. When only an edge passes there (another
|
||||
shape ends on it), it splits the edge, so the T-junction moves with the point.
|
||||
|
||||
*Rejected:* moving to a planar-map element (edges with fills on either side) now. It would
|
||||
make sharing automatic, but every command and exporter would have to address parts of an
|
||||
element (ADR 0031 rejected it for the same reason). The copies approach costs a geometric
|
||||
match per edit (measured below) and keeps every existing system working.
|
||||
|
||||
2. **Commands for each gesture** (headless, CLI, MCP, plug-ins: namespace `raw` added to the
|
||||
plug-in policy).
|
||||
* `path.bend_segment {x, y, dx, dy, id?, cmd?, t?, merge?}` bends a segment so its point at
|
||||
`t` moves exactly by `(dx, dy)`, ends fixed. This is the least-squares control-point move
|
||||
`Path::bend_segment` already used for motion paths. On a raw shape, every copy of the edge
|
||||
follows (the fill under an outline, a neighbouring fill). On an object, only it bends.
|
||||
* `raw.move_point {x, y, to_x, to_y, points?, snap?, merge?}` moves a corner or end with every
|
||||
raw shape that shares it. Handles move with their anchors, and straight segments stay
|
||||
straight.
|
||||
* `raw.select_rect {x0, y0, x1, y1, add?}` is the marquee (point 4).
|
||||
* `raw.merge {ids?}` merges shapes again in place, keeping their stacking.
|
||||
* `raw.hit {x, y}` says what a drag from a point takes.
|
||||
* `element.translate` takes `snap` and `from`.
|
||||
|
||||
A drag runs its command every frame with `merge: false`, passing on the segment
|
||||
(`id, cmd, t`) or the `points` the first frame returned. Release runs `raw.merge` on what
|
||||
changed. The whole drag is one gesture, so one undo step (ADR 0004: undoable, no
|
||||
confirmation). Scripts call a command once with the default `merge: true`.
|
||||
|
||||
3. **What a Selection-tool drag takes** (`Session::raw_grab`), in this order:
|
||||
* anything selected: the drag moves the selection;
|
||||
* an unselected raw corner or end within 6 screen pixels: it moves;
|
||||
* an unselected raw stroke, or a raw fill's edge, within 3 screen pixels: it bends;
|
||||
* the inside of a raw fill: it is selected alone and moved (the outline stays);
|
||||
* an object: it moves, as before.
|
||||
|
||||
A small corner or arc mark by the pointer shows which, like Animate's pointers.
|
||||
|
||||
4. **Snapping.**
|
||||
* **Mouse:** the target is the nearest anchor within 10 screen pixels, else the nearest point
|
||||
on a stroke or fill edge (`10 / zoom` document units, so it feels the same at any zoom).
|
||||
The shapes that move with the point are left out of the targets. A moving selection snaps
|
||||
its anchor nearest the pointer onto the shapes that do not move. A ring shows where it
|
||||
snapped.
|
||||
* **Keyboard:** nudges merge on drop as before. The planar merge now places a vertex at the
|
||||
midpoint of the distinct segment ends within `SNAP` (0.2), unless one of its points lies
|
||||
inside a segment, away from its ends. Then the vertex stays on that line and the line is
|
||||
not changed.
|
||||
|
||||
5. **The marquee cuts provisionally.** `planar::merge_cut` merges with a closed cutter whose
|
||||
edges divide fills and end stroke runs, but never show. Each piece says whether it is inside.
|
||||
Raw shapes partly under the rectangle are replaced by their pieces; the inside pieces are
|
||||
selected, with raw shapes and objects wholly inside.
|
||||
* In Animate a marquee is only a selection. So the cut records **no undo step** and leaves
|
||||
a saved document saved.
|
||||
* The session keeps the document from before the cut. Once the selection lets go of every
|
||||
inside piece with nothing else changed (a click elsewhere, a new marquee), the cut is
|
||||
taken back exactly. Saving, undo and redo also take it back first. Selected pieces map to
|
||||
the shapes they came from.
|
||||
* The first edit that uses the cut (a move, delete, recolour) records one step from before
|
||||
the cut, so undo goes straight back to the whole drawing.
|
||||
* Shift adds a marquee's parts to the selection; parts already selected stay selected when
|
||||
cut again.
|
||||
* The marquee only cuts on a keyframe's own frame: inside a tween, an edit would add a key.
|
||||
|
||||
*Rejected:* keeping cuts permanently (seams and ever more fragments after every marquee), and
|
||||
a lazy "region" selection that every command would have to understand.
|
||||
|
||||
6. **A selection lives on one layer.** The marquee uses the active layer when it has something
|
||||
under the rectangle, else the topmost visible, unlocked layer that does. Selecting across
|
||||
layers, as Animate does, needs a selection model of `(layer, element)` pairs through every
|
||||
command. It is left for a later change, and is a question for the lead.
|
||||
|
||||
## Consequences
|
||||
|
||||
* The Selection tool now bends, pulls corners, snaps and selects parts as #42 describes. Every
|
||||
gesture is a command and one undo step.
|
||||
* Measured on 1,320 raw shapes (12 × 12 outlined squares and 12 lines; optimised debug build,
|
||||
`raw_drag_timings`):
|
||||
|
||||
| Operation | Time |
|
||||
|---|---|
|
||||
| Hover test | 0.04 ms |
|
||||
| Bend frame | 0.14 ms |
|
||||
| Point frame with snapping | 0.22 ms |
|
||||
| Snapping selection move frame | 0.29 ms |
|
||||
| Merge on release | 0.22 ms |
|
||||
| Marquee cut and take-back | 1.8 ms |
|
||||
|
||||
* The midpoint rule changes where any two ends within 0.2 meet (before, the lower shape's point
|
||||
won). The move is at most 0.2, and merging again changes nothing (tested).
|
||||
* Not in this slice:
|
||||
* selecting across layers;
|
||||
* snapping while drawing with the shape tools;
|
||||
* a Snap to Objects switch;
|
||||
* Subselection anchors and handles of connected raw shapes (ADR 0042);
|
||||
* bending or moving points of raw shapes inside symbols;
|
||||
* the Free Transform tool's handles on raw parts.
|
||||
@@ -24,6 +24,5 @@ has to renumber because another PR merged first.
|
||||
|---|---|---|
|
||||
| 0037 | #38 (outside contribution) | Interface languages |
|
||||
| 0040 | branch `m8/localisation` (PR to come) | Localisation of the interface |
|
||||
| 0041 | branch `m1/raw-selection` (PR to come) | Selection tool on raw drawings (issue #42) |
|
||||
| 0042 | branch `m1/raw-subselection` (PR to come) | Subselection on raw drawings, merging everywhere (issue #42) |
|
||||
| 0043 | branch `m7/bones` (PR to come) | Bone tool and inverse kinematics |
|
||||
+5
-4
@@ -11,7 +11,7 @@ milestone ends with a green tree: build, tests, clippy, a `--screenshot` check a
|
||||
| Architecture | M0 skeleton in place: geom → doc → render → engine → cli → shell, layering enforced by `cargo test` (`src/architecture_tests.rs`: lower layers only, no UI crates below the shell, and the AGENTS.md map must match). |
|
||||
| Rendering | CPU oracle with analytic AA, non-zero/even-odd, solid + linear/radial gradients, round-join strokes. **Mask clipping**: the display list carries nested clips; a clip is the anti-aliased union of its mask fills (strokes and opacity ignored), intersected with any enclosing clip, computed once per render band; an empty mask hides everything under it. **Group alpha**: a symbol instance below full opacity is a group in the display list; each render band composites the group's run of ops into its own buffer (nested groups stack) and blends it once at the group's alpha, so overlaps don't show through; SVG export writes `<g opacity>`. **Blend modes** (Animate's 14, on movie clip and button instances): an instance with one is an isolated group that blends at its close with the W3C separable formulas on premultiplied colour (Alpha and Erase keep or clear the backdrop); SVG gets CSS `mix-blend-mode`, Lottie the layer `bm`. **Bitmaps**: `Paint::Bitmap` fills (once or tiled) with bilinear sampling in premultiplied space, colour effects per sample; PNG/JPEG import to stage (a rectangle of the image's size); stored in the document as PNG (base64 in `.anicraft`), decoded once on first use; SVG export embeds each image once as a pattern. **Filters**: a filtered group is drawn on its own (by the same renderer, recursively, so nested filters work) into a buffer over its artwork grown by the filters' reach, filtered (box-blur passes; shadow and glow from the blurred, offset opacity; **bevel and gradient bevel** from the difference of the blurred opacity offset towards and away from the light, **gradient glow** from the glow's intensity, both through a colour ramp whose rest stop is pinned transparent, inner/outer/full and knockout, ADR 0025; colour matrix), and composited back as one image in its group, so alpha and blend apply; clips from inside the symbol apply before filtering and the instance's own clip after. **GPU stage, first slice** (M3, ADR 0019; `--features gpu-stage`, off by default): Preferences › Stage › Renderer *GPU (preview)* draws the stage with wgpu compute from the oracle's own prepared fills (tile binning with per-row backdrops on the CPU, exact area coverage and src-over per pixel on the GPU): solid and gradient fills and strokes, non-zero and even-odd; masks, group opacity, blend modes, filters and bitmaps fall back to the CPU per tile, and the status bar says so. Parity with the oracle: max 1/255, mean < 0.0001/255 on the sample, stress and analytic scenes (tests skip without an adapter). 4K with 1,000 shapes: 8.8–9.0 ms vs the CPU's 17.4–17.8 ms. **Second slice** (ADR 0029): on the window's wgpu device the stage tiles are drawn straight into textures egui shows (no readback; a headless device with readback when the window is on OpenGL); **masks** (nested, united artwork), **group opacity** and **all 14 blend modes** on the GPU, same parity (max 1/255, mean ≤ 0.0011/255); 4K: 1,000 shapes in 2.1–2.4 ms, 10k shapes in 10.2 ms as stage tiles, masked scenes 7× the CPU. **Third slice** (ADR 0032): **bitmap fills** (textures uploaded once per image and cached under a 256 MB budget, sampled with the oracle's own bilinear filter, colour effect and repeat rules: byte-identical) and **all seven filters** (each filtered symbol drawn into a layer of its own and filtered by compute passes that run the oracle's resolved steps: max 1/255, mean ≤ 0.007/255) on the GPU; the shaders now build with Direct3D's FXC, so DX12 windows get the GPU stage too (parity suite green on Vulkan and DX12); software adapters are refused (the CPU is faster), the start-up self-test compares with the oracle. **The GPU is the default stage renderer**: the shell's `gpu-stage` feature is on by default, Preferences › Stage › Renderer defaults to *Graphics card (GPU)*, and the CPU draws whenever there is no usable card, a tile is past the GPU's limits (more than 16 images, filters nested deeper than 4) or anything fails. 4K: the filtered sample in 3.9 ms (CPU 31.5), 200 bitmap fills in 4.4 ms (CPU 37.2). Not yet: sharing a filtered layer across a frame's tiles, more than 16 images per tile, GPU binning (ADR 0029), buffer reuse across tiles, GPU exports, a GPU runner in CI; the CPU stays the oracle and the export path. |
|
||||
| Timeline | **Frame selection**: click, Shift-click or drag across frames and layers; F5/Shift+F5, F6/F7 and Shift+F6 (keys, buttons and right-click menu) act on the whole selection; drag selected keyframes left or right to move them, and up or down onto other layers (the source keeps empty frames, as in Animate) (with a drop outline; one undo step; keys they land on are replaced, and spans fill the frames left behind); removing or clearing selected frames that hold artwork asks first. **Cut/Copy/Paste Frames** (Ctrl+Alt+X/C/V, and plain Ctrl+X/C/V after clicking the timeline): own clipboard, copies cut exactly at the selection edges (mid-tween state kept), paste inserts like Animate, several layers paste onto the layers below (missing ones are created), fresh element ids, symbols travel with them. **Span length by dragging its end** (resize cursor, live outline with the length in frames and seconds; later frames move with it). Headless: `layers`/`count` on the frame commands, `timeline.move_keyframes`, `timeline.cut_frames/copy_frames/paste_frames`. Layers (show/lock/outline), keyframes, blank keyframes, insert/remove frames, classic tweens with 8 easing presets + curve preview, **shape tweens** (morph between any two shapes: segments made cubic, subpaths paired by size and grown from or shrunk to a point when counts differ, segment counts equalized by subdivision, windings matched and start points aligned; amber spans; classic ⇄ shape keeps the easing; **shape hints** (ADR 0023): Modify › Shape › Add Shape Hint (Ctrl+Shift+H) adds lettered markers `a`–`z` that the artist drags onto an edge on the first and last keyframe (rose until placed, amber placed on the first, mint on the last; right-click removes), the morph cuts both outlines at the hinted points and matches the pieces in order by length; `tween.add_hint/move_hint/remove_hint/clear_hints/hints`; not yet: View › Show Shape Hints, hints inside symbols edited in place), auto-key when editing inside a tween, frame labels, symbol nesting: graphics keep step with their timeline (loop, play once, single frame, first frame; set in Properties), movie clips loop their own timeline from when the instance appears (continuous across keyframes holding the same instance), buttons show their Up frame, onion skin (±2 frames), looping playback. **Mask layers**: right-click a layer › Mask turns it into a mask over the layer below (Masked adds more layers to it); masked layers are indented under a stencil icon; the mask applies on the stage and in every export alike, and while the mask layer is unlocked its edge shows in the layer colour so it can be picked and reshaped; masked-away parts cannot be picked; layers moved in under a mask join it, moved out leave it, and a mask moves with its whole group; masks inside symbols nest. Headless: `layer.toggle_mask`, `layer.set_type`. **Scenes** (ADR 0011): the movie is an ordered list of scenes, each its own timeline, edited one at a time (scene menu on the edit bar, Insert › Scene, Modify › Scene, Shift+PageUp/PageDown); add, duplicate (fresh ids), rename, reorder and remove (asks when the scene has artwork; undoable); PNG-sequence and GIF exports play every scene in order. **Layer folders**: nestable folders (depth ≤ 16) holding layers and masks through `Layer.parent`, one invariant (`Timeline::repair_masks`: a child sits below its parent inside the parent's unbroken run; broken links fall back to the nearest valid ancestor); hiding or locking a folder hides or locks its contents (rendering, picking, drawing); folders open and close on the timeline (view state); layers move in and out with Up/Down, a folder moves with its contents; deleting a folder deletes its contents (asks first). **Motion tweens** (ADR 0016): a span's object animated property by property (x, y, scale, rotation, skew, alpha, tint), each property its own curve of property keyframes with a per-segment ease (presets or a custom cubic Bézier, overshoot allowed); auto-key turns any edit of the object inside the span into property keys (every command, through the session), F6 keys every property, splits and copies keep the motion; sky-blue spans with property-key diamonds; **Motion Editor** tab beside the timeline: property list with values at the playhead, curve graph with draggable keys and Bézier handles, one undo step per drag. **Motion paths** (ADR 0030): a motion tween may carry a cubic path its object travels by arc length, timed by the X/Y curves (a straight path reproduces them exactly, overshoot included); shown on the stage in the motion colour with a dot per frame when the object or span is selected; Selection drags the path to bend it and its ends to move them, Subselection drags anchors and handles; moving the object reshapes the path; Orient to path and Straighten in Properties; splits cut the path. **Path points** (ADR 0038): with Subselection, double-click the path to add a point (shape and motion unchanged), Shift-clicLine truncated
|
||||
| Drawing | Selection (click, shift-add, marquee, drag-move, arrow nudge), **Free Transform (Q)**: scale from corner/edge handles (Shift proportional, Alt from centre), rotate outside corners (Shift snaps 15°), move; one undo step per drag. Rectangle (corner radius), oval, PolyStar, line (45° snap), hand, zoom. **Pen (P)**: click for corners, drag for smooth handles (Alt breaks them), close on the first point, Enter/Esc/last-point click finishes, Backspace takes back a point; one undo step per path. **Pencil (Shift+Y)**: Smooth (Schneider curve fitting with corner detection), Straighten and Ink modes, smoothing relative to the screen. **Subselection (A)**: anchors and handles on selected shapes, drag points/handles (anchors bring their handles; one undo step per drag), point marquee, double-click an edge to add a point, Delete removes points, right-click Make Smooth/Corner; closed shapes' start point and closing edge edit like any other. **Cut/Copy/Paste in Center/Paste in Place** (the clipboard carries symbols across documents). **Rotate 90° CW/CCW, Flip H/V. Align** left/centre/right/top/middle/bottom (Ctrl+Alt+1…6; a single element aligns to the stage) and distribute. Convert to symbol / break apart; arrange; duplicate. Headless: `draw.path`, `draw.freehand`, `path.move_points/add_point/delete_points/convert_point`. **Paint Bucket (K)**: click a fill to recolour it, or inside an outline (one shape or several) to fill the enclosed area; gap size None/Small/Medium/Large closes openings; the fill is traced and curve-fitted into a new shape placed under its lines; open areas say so instead of flooding. **Ink Bottle (S)**: gives the clicked shape the current stroke. Headless: `paint.bucket`, `paint.ink`. Tool options show first in Properties while a drawing tool is active. **Text (T)** (ADR 0012): click to type on the stage, click or double-click text to edit it; font (installed families, plus the embedded Inter), size, colour, bold, italic, alignment, letter/line spacing, wrap width; the last style is kept for new text; laid out by `anicraft-text` (`fontdb` discovery, `harfrust` shaping, `skrifa` outlines) and stored as outlines with the source, so rendering never needs the font; Break Apart makes a shape. **Variable-width strokes** (ADR 0018): a stroke's width varies along it through width points (position by arc length, a width on each side as a factor of the stroke width, smooth monotone interpolation); built-in profiles (Uniform, Taper both ends, Taper start, Taper end, Bulge, Pinch) in Properties › Width with a picture of each, and in the drawing tools' options for new strokes; the **Width tool (U)**: hover a stroke to see its width points, drag a handle to widen or narrow (Alt: one side), drag the dot to slide a point, drag anywhere on the stroke to add one, Delete removes; one undo step per drag; rendered by the oracle as trapezoids with outer round joins and cross-section caps, written by SVG and Lottie export as the same filled outlines; shape tweens blend profiles; `.anicraft` keeps them (older files open as uniform). Headless: `stroke.set_profile`, `stroke.set_width_point`, `stroke.delete_width_point`, `stroke.width_at`, `profile` on `element.set_stroke`, the drawing commands and `paint.ink`. Not yet: width data from or to Animate files, saved custom profiles, pressure. **Merge drawing** (ADR 0031, first slice): with Object Drawing (J) off, the editor's default, the shape tools, Pen and Pencil draw raw strokes and fills that cut and join the raw shapes they touch (a fill on top replaces what it covers or joins the same colour, lines cut each other and the fills they cross, a fill hides the lines under it, points within 0.2 px are one; exact Bézier pieces, `anicraft_geom::planar`); one element per fill region and stroke run, selected with Animate's dot pattern; double-click selects connected strokes, or a fill with its outline; a dragged or nudged raw shape merges where it lands; arrows move 1 screen pixel (Shift 10). Headless: `object` on the drawing commands (scripts draw objects by default), `draw.object_drawing`, `draw.drop`, `element.select_connected`. Not yet: bending segments by dragging, snapping, moving shared points together, partial marquee selection, merging bucket fills and pastes, XFL raw shapes, gradients and width profiles in the merge. **Brush (B)** (ADR 0033, first slice): paints filled shapes in the fill colour, the exact area the tip sweeps (a distance field traced and fitted with cubics); round or square tip with size, angle and roundness (oval and flat calligraphic tips), pen pressure from a tablet (10–100 % of the size; a mouse paints full size), smoothing relative to the screen, Paint Normal, Paint Fills and Paint Behind; a raw shape that merges with the drawing, or a drawing object with Object Drawing on; a click paints a dab; live preview while dragging; `[` and `]` change the size; one undo step per stroke. Headless: `draw.brush`. Not yet: Paint Selection and PLine truncated
|
||||
| Drawing | Selection (click, shift-add, marquee, drag-move, arrow nudge), **Free Transform (Q)**: scale from corner/edge handles (Shift proportional, Alt from centre), rotate outside corners (Shift snaps 15°), move; one undo step per drag. Rectangle (corner radius), oval, PolyStar, line (45° snap), hand, zoom. **Pen (P)**: click for corners, drag for smooth handles (Alt breaks them), close on the first point, Enter/Esc/last-point click finishes, Backspace takes back a point; one undo step per path. **Pencil (Shift+Y)**: Smooth (Schneider curve fitting with corner detection), Straighten and Ink modes, smoothing relative to the screen. **Subselection (A)**: anchors and handles on selected shapes, drag points/handles (anchors bring their handles; one undo step per drag), point marquee, double-click an edge to add a point, Delete removes points, right-click Make Smooth/Corner; closed shapes' start point and closing edge edit like any other. **Cut/Copy/Paste in Center/Paste in Place** (the clipboard carries symbols across documents). **Rotate 90° CW/CCW, Flip H/V. Align** left/centre/right/top/middle/bottom (Ctrl+Alt+1…6; a single element aligns to the stage) and distribute. Convert to symbol / break apart; arrange; duplicate. Headless: `draw.path`, `draw.freehand`, `path.move_points/add_point/delete_points/convert_point`. **Paint Bucket (K)**: click a fill to recolour it, or inside an outline (one shape or several) to fill the enclosed area; gap size None/Small/Medium/Large closes openings; the fill is traced and curve-fitted into a new shape placed under its lines; open areas say so instead of flooding. **Ink Bottle (S)**: gives the clicked shape the current stroke. Headless: `paint.bucket`, `paint.ink`. Tool options show first in Properties while a drawing tool is active. **Text (T)** (ADR 0012): click to type on the stage, click or double-click text to edit it; font (installed families, plus the embedded Inter), size, colour, bold, italic, alignment, letter/line spacing, wrap width; the last style is kept for new text; laid out by `anicraft-text` (`fontdb` discovery, `harfrust` shaping, `skrifa` outlines) and stored as outlines with the source, so rendering never needs the font; Break Apart makes a shape. **Variable-width strokes** (ADR 0018): a stroke's width varies along it through width points (position by arc length, a width on each side as a factor of the stroke width, smooth monotone interpolation); built-in profiles (Uniform, Taper both ends, Taper start, Taper end, Bulge, Pinch) in Properties › Width with a picture of each, and in the drawing tools' options for new strokes; the **Width tool (U)**: hover a stroke to see its width points, drag a handle to widen or narrow (Alt: one side), drag the dot to slide a point, drag anywhere on the stroke to add one, Delete removes; one undo step per drag; rendered by the oracle as trapezoids with outer round joins and cross-section caps, written by SVG and Lottie export as the same filled outlines; shape tweens blend profiles; `.anicraft` keeps them (older files open as uniform). Headless: `stroke.set_profile`, `stroke.set_width_point`, `stroke.delete_width_point`, `stroke.width_at`, `profile` on `element.set_stroke`, the drawing commands and `paint.ink`. Not yet: width data from or to Animate files, saved custom profiles, pressure. **Merge drawing** (ADR 0031, first slice): with Object Drawing (J) off, the editor's default, the shape tools, Pen and Pencil draw raw strokes and fills that cut and join the raw shapes they touch (a fill on top replaces what it covers or joins the same colour, lines cut each other and the fills they cross, a fill hides the lines under it, points within 0.2 px are one; exact Bézier pieces, `anicraft_geom::planar`); one element per fill region and stroke run, selected with Animate's dot pattern; double-click selects connected strokes, or a fill with its outline; a dragged or nudged raw shape merges where it lands; arrows move 1 screen pixel (Shift 10). Headless: `object` on the drawing commands (scripts draw objects by default), `draw.object_drawing`, `draw.drop`, `element.select_connected`. **Selection tool on raw shapes** (ADR 0041): drag an unselected segment or fill edge to bend it through the pointer (every shape sharing the edge bends with it), an unselected corner or end to move it with every raw shape that shares it, a fill to move only that fill; points and selections snap to points, strokes and fill edges within 10 screen px (snap ring), and arrow nudges join ends within 0.2 px at their midpoint or onto a line that stays put; a corner or curve mark by the pointer shows what a drag does; the marquee selects the parts of raw fills and strokes under it, cut at its edges (taken back if nothing uses them, no undo step), and objects wholly inside; each drag one undo step, merged on release. Headless: `path.bend_segment`, `raw.move_point`, `raw.select_rect`, `raw.merge`, `raw.hit`, `snap` on `element.translate`. Not yet:Line truncated
|
||||
| Plug-ins | **WebAssembly plug-ins** (ADR 0017, `docs/plugins.md`): sandboxed modules run by `wasmi` with no imports but the AniCraft ABI (`anicraft.call`/`anicraft.response`: JSON requests that run registry commands, read a compact document view or the active layer's elements, and log); fuel (10⁹ instructions), memory (256 MiB), wall-clock (5 s), request, size and log limits, a fresh instance per run; file, plug-in, undo and clipboard commands refused. `plugin.install/list/run/remove/reload`; a run is atomic and one undo step named after the plug-in. App: **Commands** menu (Plug-ins, Install, Manage, Reload), palette entries, a dialog generated from the manifest's parameters with a live preview; plug-ins load from `<settings>/plugins` or `ANICRAFT_PLUGINS`; CLI `--plugins`. Samples in Rust (Star Field, Jitter Selection, guest SDK) in `examples/plugins`. Frame scripts: see Interactivity. Not yet: exporter and easing kinds, background runs with cancel, a binary document view. |
|
||||
| Interactivity | **Frame actions, frame scripts and Test Movie, first slice** (ADR 0024): a typed timeline action IR (`anicraft-actions`: stop, play, go to a frame or label in a scene, next/previous frame and scene, trace, set x/y/alpha/visible/rotation/scale, instance-name target paths) on keyframes and on button and movie clip instances (click, press, release, over, out); a pure, deterministic, budgeted player in `anicraft-doc` (`step(doc, &state, &events)`; movie clip playheads, button Up/Over/Down states with Hit-frame hit tests, script-set properties) drawn by `evaluate_player`, while `evaluate` and exports stay script-free. **Actions panel** (F9: structured lists, targets/labels/scenes picked from the document; movie clip timelines too), instance name and events in Properties, an "a" on keyframes with actions. **Frame scripts** on the plug-in host (`kind: "frame-script"`, entry points, `player`/`action` ops, 20 M instructions per frame shared, no document access). **Test Movie** (Control › Test Movie, Ctrl+Enter): the player at the document frame rate in its own window with the pointer, restart/pause/step and an Output panel. Headless: `actions.set/clear/list`, `instance.set_name`, `control.test_movie` (timed pointer events, returns output and state). **HTML canvas export** (ADR 0028, `file.export_html`, File › Export › Export HTML Canvas…): one self-contained page (data, player and drawing code inline; images and sounds embedded) that plays in any browser with canvas 2D; every used timeline baked frame by frame (tweens of every kind exact, identical paths, paints and frames stored once), movie clips, buttons with Hit areas and every action run by `player.js`, a port of the Rust player checked against it step by step in Boa (state, output and display list); masks and fading/blending groups on offscreen layers; Web Audio for Event/Start/Stop/Stream sounds; filters, Subtract/Invert, bitmap tints and plug-in frame scripts reported. **Kept frame scripts** (ADR 0013 tier 1): scripts written in another language (an Animate document's ActionScript) kept verbatim on keyframes with their language, symbol linkage classes and the document class; the Actions panel's **Script** view (monospace editor with line numbers, language, live and undoable), the same "a" marker, Class rows in Properties; `script.set/clear/list/set_class`; nothing runs them (Test Movie says so once; the HTML export reports them). Not yet: running the ActionScript timeline subset (ADR 0013 tier 2), scripts on instances, filters and keyboard focus in the HTML page, sound actions, keyboard events, variables, persistent script state, masks in hit tests, a separate OS window. |
|
||||
| Headless | CLI: info, render, render-seq, **gif**, commands, exec, run, serve (JSON-lines). **MCP server** (`anicraft-cli mcp`, `docs/mcp.md`): stdio JSON-RPC, protocol 2025-06-18 (and 2025-03-26, 2024-11-05); five tools over the command registry (list, run, run a script, describe the document, render a frame as a PNG picture); confirmation tiers and undo apply as in the app. |
|
||||
@@ -81,11 +81,12 @@ Next, in order:
|
||||
0. **Raw drawing as in Animate (issue #42, a user's detailed report).** Merge drawing's first
|
||||
slice (ADR 0031, outside contribution #92) makes the shape tools draw raw strokes and fills
|
||||
that cut and join. Still to match the report, first-party:
|
||||
* **Selection tool on raw drawings** (ADR 0041): drag an unselected segment to bend it;
|
||||
drag an endpoint or corner to move it, moving every shape that shares the point; snap
|
||||
* ~~**Selection tool on raw drawings** (ADR 0041)~~ ✅: drag an unselected segment to bend
|
||||
it; drag an endpoint or corner to move it, moving every shape that shares the point; snap
|
||||
dragged points to points, strokes and fill edges within 10 screen px, and keyboard moves
|
||||
within 0.2 document px; a marquee that selects the parts of fills and strokes under it
|
||||
(cut at its edges) across unlocked layers; Shift adds and removes.
|
||||
(cut at its edges); Shift adds. Not yet: a marquee across several layers at once (a
|
||||
selection lives on one layer), snapping while drawing, a Snap to Objects switch.
|
||||
* **Subselection on raw drawings, and merging everywhere** (ADR 0042): hollow anchors on
|
||||
connected raw shapes, handles on curves, point marquee on the active layer, dragging a
|
||||
segment or fill moves what is connected; the Paint Bucket's fills and pasted raw shapes
|
||||
|
||||
Reference in new issue
Block a user