mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-28 17:19:31 +01:00
docs: ADR 0131, the guide on selecting several layers, the ruler and new masks; a screenshot state (M8)
This commit is contained in:
1 parent
b44763a039
commit
0aa9bc6aa1
5 files changed
+163
-11
No files matched your search
@@ -0,0 +1,108 @@
|
||||
# ADR 0131: Several layers selected at once, a ruler that selects no frames, and new masks locked
|
||||
|
||||
* Status: accepted (2026-11-23)
|
||||
* Relates to: backlog items P-009 and P-010 in `docs/roadmap.md`; issues #195, #429, #512, #523,
|
||||
#513, #159, #246, #255; outside pull requests #222, #532 and #535;
|
||||
[ADR 0010](0010-mask-layers.md), [ADR 0044](0044-selection-across-layers.md),
|
||||
[ADR 0061](0061-timeline-polish.md), [ADR 0087](0087-dockable-panels-second-slice.md)
|
||||
|
||||
## Context
|
||||
|
||||
P-009 and P-010 are bug lists. Most of their fixes are small and need no record. Three of them
|
||||
decide how the timeline behaves from now on, and each could reasonably have gone another way.
|
||||
|
||||
1. **#512.** The layer list had one selected layer: the active one. Artists coming from
|
||||
Animate hold Ctrl or Shift to select several, drag them into a folder together, and expect
|
||||
the folder button to gather them.
|
||||
2. **#195.** With frames selected on one layer, a click on the playhead left that selection
|
||||
alone while the playhead stayed inside it, so F5 went on adding frames to one layer. The
|
||||
reference app adds them to every layer after a click on the ruler. Outside PR #222 fixed it
|
||||
by selecting the playhead's frame on every layer.
|
||||
3. **#429.** A new mask shows its edge on the stage in the layer colour, because its layer is
|
||||
unlocked. The reporter read the edge as a rendering fault.
|
||||
|
||||
## Decisions
|
||||
|
||||
### The selected layers are session state, valid only while they hold the active layer
|
||||
|
||||
`Session::layer_sel` lists the layers picked together; `Session::picked_layers()` is how it is
|
||||
read. The list counts only while it contains the active layer and its layers are in the edited
|
||||
timeline; otherwise the active layer alone is selected.
|
||||
|
||||
Many commands set the active layer directly (a new layer, a deleted one, entering a symbol,
|
||||
another scene, undo). Clearing the list in each of them would be a rule every future command
|
||||
has to remember. With the validity rule none of them needs to know the list exists, and a
|
||||
stale list can never make a command act on layers the artist no longer sees as selected.
|
||||
|
||||
The selection is not in the document and not in the undo history, like the active layer and
|
||||
the artwork selection.
|
||||
|
||||
`layer.select` takes `add: "toggle"` (Ctrl-click) and `add: "range"` (Shift-click, counted
|
||||
from the active layer, which stays the anchor, as in a list box). The last layer can't be
|
||||
toggled out: a timeline always has an active layer. The shell adds Shift+Up and Shift+Down on
|
||||
the focused timeline, so the selection can be made without a pointer.
|
||||
|
||||
### Which commands act on the selection
|
||||
|
||||
`layer.move` and `layer.delete` act on `layers: [ids]`, else `layer`, else the selected layers.
|
||||
Both stay one undo step and are all or none. Moved layers land together in the order they had;
|
||||
a layer selected along with the folder or mask that holds it moves once, inside it; the camera
|
||||
layer, selected with others, stays on top.
|
||||
|
||||
`layer.new_folder` puts several selected layers into the new folder, which lands where the top
|
||||
one was. **This departs from the reference app**, where New Folder always makes an empty
|
||||
folder. The reporter of #512 asked for it, it is what the button does in most layer lists
|
||||
artists also use, and an empty folder above a multi-selection is rarely what was meant.
|
||||
`wrap: false` gives the empty folder; with one layer selected nothing changes.
|
||||
|
||||
The row toggles (eye, padlock, outline, onion) and Move Layer Up and Down still act on one
|
||||
layer. Layer Properties for several layers is P-027.
|
||||
|
||||
### A click on the ruler leaves no frames selected
|
||||
|
||||
The ruler is not a frame of any one layer, so a click or a drag on it drops the frame
|
||||
selection, also when the playhead stays inside it. The frame keys then follow the rule `main`
|
||||
already had for "no frames selected" (#242, #438): F5, Shift+F5 and Shift+F6 act on every layer
|
||||
that reaches the playhead, and F6 and F7 on the active layer.
|
||||
|
||||
PR #222's approach (select the playhead's frame on every layer) is merged for its test and
|
||||
credit and then changed, for two reasons:
|
||||
|
||||
* After any scrub, F7 would have put a blank keyframe on every layer and Shift+F6 cleared a
|
||||
keyframe on every layer. Scrubbing is the most common thing done on a timeline; a key
|
||||
pressed after it must not empty the stage.
|
||||
* It also sent Ctrl+C and Ctrl+X to the frames instead of the selected artwork after a scrub.
|
||||
|
||||
### A new mask is locked
|
||||
|
||||
`layer.toggle_mask` locks the mask layer it makes, as the reference app does and as the SVG
|
||||
importer already did. The rule of [ADR 0010](0010-mask-layers.md) stays: an unlocked mask
|
||||
shows its edge in the layer colour, so it can be seen, picked and reshaped; a locked one shows
|
||||
only its result. The masked layer is not locked: in AniCraft the mask applies whether or not
|
||||
the layers are locked, so locking the artwork would only be in the way.
|
||||
|
||||
Hiding the edge unless the mask layer is active was considered and rejected: an unlocked
|
||||
mask's shapes can be picked on the stage, and something that can be picked must be visible.
|
||||
|
||||
`layer.set_type` and Layer Properties do not lock: there the type is one field among several
|
||||
the artist is setting by hand.
|
||||
|
||||
## Not reproduced
|
||||
|
||||
* **#159** (a side dock that grows under the pointer at interface scales of 85, 95, 110, 135,
|
||||
160, 170 and 185 %, reported on 0.2.1). On `main` the stage's rectangle did not move in 54
|
||||
combinations of screen density, window size and interface scale, nor with content wider
|
||||
than the dock. A dock's size comes from egui's panel state, which grows only when what is
|
||||
inside is wider than the panel; [ADR 0087](0087-dockable-panels-second-slice.md) holds every
|
||||
panel's content to the dock's width. A test now pins that at the reported scales. The issue
|
||||
stays open for the reporters to retest on a current build.
|
||||
* **#255** (the window flickers after it regains focus, Intel Arc). It needs the machine.
|
||||
Preferences › Window graphics was added for it earlier; nothing changes here.
|
||||
|
||||
## Consequences
|
||||
|
||||
* Commands that take `layer?` and should act on several layers have one helper,
|
||||
`cmds_timeline::layer_targets`.
|
||||
* Scripts that ran `layer.toggle_mask` and then edited the mask layer must unlock it first
|
||||
(`layer.toggle_lock {on: false}`); the command's result says `locked: true`.
|
||||
* `anicraft-cli info` and the MCP state report `layer_selection`.
|
||||
@@ -17,7 +17,9 @@ wipe, or text that reveals a picture.
|
||||
2. Make a new layer right above it and draw the mask shape there, with a fill.
|
||||
3. Right-click the mask layer and choose **Mask** (or choose **Modify › Timeline › Mask**).
|
||||
|
||||
The layer below becomes **masked**: it's indented under the mask, which gets a stencil icon. To
|
||||
The layer below becomes **masked**: it's indented under the mask, which gets a stencil icon.
|
||||
The new mask layer is **locked**, as Animate leaves it, so you see the result and nothing else.
|
||||
Click its padlock when you want to move or reshape the mask. To
|
||||
mask more layers with the same mask, right-click each layer right under the group and choose
|
||||
**Masked**, or move it in under the mask with the up and down buttons. Moving a layer out of the
|
||||
group takes it out of the mask.
|
||||
@@ -27,8 +29,10 @@ group takes it out of the mask.
|
||||
* Only the mask's **fills** count. Strokes, and the mask artwork's opacity, are ignored.
|
||||
* The mask always applies, on the stage and in every export, so what you see is what you get.
|
||||
If you're coming from Animate, there's no need to lock both layers to preview it.
|
||||
* While the mask layer is unlocked, its shapes' edges show in the layer colour, so you can select
|
||||
and reshape them. Lock the mask layer to hide the edge.
|
||||
* While the mask layer is unlocked, its shapes' edges show on the stage in the layer colour, so
|
||||
you can select and reshape them. Lock the mask layer to hide the edge: a mask you've just
|
||||
made, or one that came in with an SVG, is locked already. The edge is only there while you
|
||||
edit; it's never in Test Movie or an export.
|
||||
* Parts of the masked artwork that are hidden can't be picked on the stage.
|
||||
* Hiding the mask layer turns the mask off.
|
||||
* The mask layer's artwork can have keyframes and tweens like any other layer, for moving
|
||||
|
||||
+29
-7
@@ -48,6 +48,25 @@ wheel.
|
||||
Clicking a layer's name makes it the active layer and selects its artwork, as you'd expect from
|
||||
Animate. Right-click a layer for a menu with nearly everything in this section.
|
||||
|
||||
### Selecting several layers
|
||||
|
||||
* **Ctrl**-click a layer's name to add it to the selected layers, or to take it out again.
|
||||
* **Shift**-click a name to select every layer from the active one to it. With the timeline
|
||||
focused, **Shift+Up** and **Shift+Down** do the same one layer at a time.
|
||||
* Click a name without a key to go back to one layer.
|
||||
|
||||
The selected layers are highlighted. Together they can be:
|
||||
|
||||
* **moved**: drag any one of them by its name and they all go, landing together in the order
|
||||
they had. Drop them on a folder to put them all inside;
|
||||
* **put in a new folder**: click the folder button under the list (or **Insert › Timeline › New
|
||||
Folder**). The folder appears where the top one was, with the selected layers in it;
|
||||
* **deleted**: the delete button and **Modify › Timeline › Delete Layer** take them all, after
|
||||
asking once if they hold artwork.
|
||||
|
||||
Each of these is one undo step. The eye, the padlock and the other buttons on a row still act
|
||||
on that row alone, and the up and down buttons move the active layer.
|
||||
|
||||
### Show, lock and outline
|
||||
|
||||
Each layer row has three toggles:
|
||||
@@ -109,7 +128,8 @@ Layer Properties works on one layer at a time. Editing several layers at once is
|
||||
Folders keep big timelines tidy.
|
||||
|
||||
1. Click the folder button under the layer list, or choose **Insert › Timeline › New Folder**.
|
||||
The folder appears above the active layer.
|
||||
The folder appears above the active layer. With
|
||||
[several layers selected](#selecting-several-layers) they go straight into it.
|
||||
2. Drag a layer by its name onto the folder to put it inside, or between two layers of an open
|
||||
folder. Drag it above or below a layer outside the folder to take it out again. (With the up
|
||||
and down buttons: move a layer in under the folder, and off either end to take it out.)
|
||||
@@ -202,10 +222,11 @@ As in Animate, the keys keep you moving along the timeline:
|
||||
* **F6** or **F7** on a frame that is already a keyframe adds the new keyframe on the *next*
|
||||
frame and moves there, so you can draw, press **F6**, draw again, and so on. On any other
|
||||
frame they key the frame you're on.
|
||||
* With no frames selected (for example after stepping the playhead out of the selection),
|
||||
**F5** adds a frame on every layer that has frames at or after the playhead, so the layers
|
||||
stay in step. Layers that end before the playhead are left alone. When no layer reaches the
|
||||
playhead, it lengthens the layer you're on up to it.
|
||||
* With no frames selected (for example after clicking the frame ruler or dragging the
|
||||
playhead), **F5** adds a frame on every layer that has frames at or after the playhead, so
|
||||
the layers stay in step. Layers that end before the playhead are left alone. When no layer
|
||||
reaches the playhead, it lengthens the layer you're on up to it. **Shift+F5** and
|
||||
**Shift+F6** act on every layer there too; **F6** and **F7** key the layer you're on.
|
||||
* With a frame selected, the keys act on that frame's layer, and the selection moves with the
|
||||
playhead.
|
||||
* With several frames selected, **F6** makes every one of them a keyframe of what it showed, and
|
||||
@@ -220,8 +241,9 @@ An empty frame shows a hint in **Properties › Frame**: press **F7** to start d
|
||||
* Click a frame to select it and move the playhead there.
|
||||
* **Shift**-click, or drag across frames, to select a range. A selection can span several
|
||||
layers.
|
||||
* Click the playhead (the frame ruler) to select that frame on every layer. **F5**, **F6**
|
||||
and the other frame keys then act on all layers, until you click a frame of one layer.
|
||||
* Click the frame ruler, or drag the playhead, to deselect the frames, as in Animate: the
|
||||
ruler isn't a frame of any one layer. **F5** then adds frames on every layer, until you
|
||||
click a frame of one layer again.
|
||||
* **Ctrl+Alt+A** selects every frame.
|
||||
|
||||
The frame keys, the header buttons and the right-click menu all act on the whole selection.
|
||||
|
||||
+18
@@ -1682,6 +1682,24 @@ impl App {
|
||||
}
|
||||
Some("animator") => self.switch_workspace("animator"),
|
||||
Some("designer") => self.switch_workspace("designer"),
|
||||
Some("layerselect") => {
|
||||
// Timeline and panel fixes together (ADR 0131): a new mask (locked, so no edge in
|
||||
// the layer colour on the stage, #429), more layers than rows (the count in the
|
||||
// header, clear of its buttons, #523), three layers picked with Shift and one with
|
||||
// Ctrl (#512), and the Movie Explorer using its pane's height (#513).
|
||||
if let Some(sun) = self.s.timeline().layers.iter().find(|l| l.name == "Sun").map(|l| l.id.0) {
|
||||
self.run("layer.toggle_mask", json!({"layer": sun}));
|
||||
}
|
||||
self.run("layer.select", json!({"index": 0}));
|
||||
for _ in 0..9 {
|
||||
self.run("layer.new", json!({}));
|
||||
}
|
||||
self.run("layer.select", json!({"index": 1}));
|
||||
self.run("layer.select", json!({"index": 3, "add": "range"}));
|
||||
self.run("layer.select", json!({"index": 5, "add": "toggle"}));
|
||||
crate::movie_explorer::open(self);
|
||||
crate::movie_explorer::expand_to(self, 2);
|
||||
}
|
||||
Some("explorer") => {
|
||||
// The Movie Explorer tab (ADR 0058), its first rows open: scene, layers, keyframes
|
||||
// and the instances on them, opening into their symbols.
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ fn parse_args(args: impl IntoIterator<Item = String>) -> Result<Args, String> {
|
||||
/// `--help` (the console's text, in English).
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
// i18n-exempt: the --help console text
|
||||
const HELP: &str = "anicraft [file.anicraft|file.fla|file.xfl] [--version] [--screenshot out.png [--shot-width <px>]] [--renderer gl|wgpu|vulkan|dx12|metal] [--theme dark|light|high-contrast|<file>.json] [--check-theme <file>.json] [--scale <percent>] [--lang <code>|auto|pseudo] [--control <port>] [--open palette|shortcuts|helpbone|lastscene|start|drop|droplibrary|select|selectzoom|about|files|confirm|transform|shapecommands|expandfill|softenfill|tracebitmap|docsettings|origins|pivot|layeropacity|points|merge|rawparts|rawedit|rawsub|rawpoints|rawsnap|rulers|editguides|editgrid|symboledit|groups|combine|nineslice|nineslicedit|brush|brushing|polystar|paintinside|drawingedit|shapeenvelope|brushlibrary|brushcurve|paintbrush|eraser|erasing|erasemerge|tiltbrush|eyedropper|pen|frames|span|bucket|tlzoom|tlwide|motion|motionspan|motionpath|motionpoints|motionedit|motionpins|motionpinsspan|hints|hintsend|camera|cameraview|bones|springbones|shapebones|shapeweights|mixedbones|layerdepth|layerdepthview|filters|strokes|prefs|licenses|zoom|recovery|plugins|actions|script|scriptproblems|testmovie|testmovieinside|testscript|textfields|testtext|htmltext|embedfield|richtext|softmask|pathtext|pathedit|button|testhits|exporthtml|publish|publishreport|publishanim|sound|envelope|ease|easepreset|plugineases|pluginexport|pluginexportwindow|library|librarymenu|libraryfolders|colour|layerprops|frameview|layercolour|timelinepolish|dock|dockicons|floattabs|docknarrow|workspaces|animator|designer|gradient|gradientbucket|swatches|swatchpanel|video|videoimport|datachart|datatable]\n\
|
||||
const HELP: &str = "anicraft [file.anicraft|file.fla|file.xfl] [--version] [--screenshot out.png [--shot-width <px>]] [--renderer gl|wgpu|vulkan|dx12|metal] [--theme dark|light|high-contrast|<file>.json] [--check-theme <file>.json] [--scale <percent>] [--lang <code>|auto|pseudo] [--control <port>] [--open palette|shortcuts|helpbone|lastscene|start|drop|droplibrary|select|selectzoom|about|files|confirm|transform|shapecommands|expandfill|softenfill|tracebitmap|docsettings|origins|pivot|layeropacity|points|merge|rawparts|rawedit|rawsub|rawpoints|rawsnap|rulers|editguides|editgrid|symboledit|groups|combine|nineslice|nineslicedit|brush|brushing|polystar|paintinside|drawingedit|shapeenvelope|brushlibrary|brushcurve|paintbrush|eraser|erasing|erasemerge|tiltbrush|eyedropper|pen|frames|span|bucket|tlzoom|tlwide|motion|motionspan|motionpath|motionpoints|motionedit|motionpins|motionpinsspan|hints|hintsend|camera|cameraview|bones|springbones|shapebones|shapeweights|mixedbones|layerdepth|layerdepthview|filters|strokes|prefs|licenses|zoom|recovery|plugins|actions|script|scriptproblems|testmovie|testmovieinside|testscript|textfields|testtext|htmltext|embedfield|richtext|softmask|pathtext|pathedit|button|testhits|exporthtml|publish|publishreport|publishanim|sound|envelope|ease|easepreset|plugineases|pluginexport|pluginexportwindow|library|librarymenu|libraryfolders|colour|layerprops|frameview|layercolour|timelinepolish|layerselect|dock|dockicons|floattabs|docknarrow|workspaces|animator|designer|gradient|gradientbucket|swatches|swatchpanel|video|videoimport|datachart|datatable]\n\
|
||||
--renderer the window's graphics (also ANICRAFT_RENDERER); default automatic, falling back to OpenGL\n\
|
||||
--theme a built-in look, or a theme file of your own, for this run only\n\
|
||||
--check-theme says whether a theme file would be used (exit 0) or why it is refused (exit 1)\n\
|
||||
|
||||
Reference in new issue
Block a user