Viewer: each composition keeps its Resolution in the project, as in After Effects (#417)

What: the Composition panel's Resolution (Auto, Full, Half, Third, Quarter, Custom) is now a
property of the composition (`Comp::resolution`, moved with its `Resolution` type from the UI
into the project crate) instead of one global viewer setting. Switching to another comp shows
that comp's resolution, switching back shows the first one's again, and saving and reopening the
project keeps them. `view.res.full|half|third|quarter|custom` and the new engine command
`view.res.auto` set it (headless too, with an optional `comp`); `ui.set {viewer: {res}}` sets
the active comp's and `ui.inspect` still reports `ui.viewer.res`; `comp.info` reports
`resolution` and `resolutionFactor`; View ▸ Resolution's check marks come from the engine.

Why: After Effects saves each composition's Resolution with the project (CompItem.resolutionFactor
is a per-comp attribute). As there, changing it marks the project modified but adds no undo step:
undo, redo and History jumps carry the current values over to the restored state. It is not part
of the comp's pixels (`Comp::same_pixels` ignores it and `Comp::pixel_form` normalises it), so
changing it keeps the comp's RAM and disk cache keys. Auto is not written (serde default and
skip_serializing_if), so projects saved before open with Auto and older versions read new files.
The magnification is not saved per comp: Adobe's documentation doesn't say it is.

Tests: project `comp_resolution_is_saved_and_old_projects_load_with_auto`,
`resolution_factors_and_scales`; engine
`each_comp_keeps_its_resolution_outside_the_undo_history_and_in_the_file` (switching comps,
no undo step, undo/redo keep it, save/open round trip, menu check marks, Custom dialog);
ui-egui `each_comp_keeps_its_viewer_resolution` (the viewer popup on comp A, comp B through
`ui.set`, back to A, unchanged frame cache identity, save/open). They don't build before the
change (no `Comp::resolution`, no `view.res.auto` engine command).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatasticandClaude Opus 5.5 committed 2026-10-10 00:57:00 +07:00
1 parent 176cddcdad
commit 67305fbcd1
21 files changed
+377 -118

No files matched your search

+4
View File
@@ -180,6 +180,10 @@ build real projects through these interfaces; they are worked examples of everyt
* **Nested comps**: `comp.settings {preserveFrameRate, preserveResolution}` (Composition Settings ▸
Advanced); `comp.info` / `get_comp` report both. A precomp layer shows nothing outside its
nested comp's span.
* **Viewer Resolution** belongs to each comp and is saved with the project, as in After Effects:
`view.res.full|half|third|quarter|auto {comp?}` or `view.res.custom {factor: 1..40, comp?}`
(headless too; no undo step, the project becomes modified). `comp.info` reports `resolution`
and `resolutionFactor` (`null` for Auto).
* **Several footage items at once**: `file.newCompFromSelection {single, dimensionsFrom, duration,
sequence, overlap, overlapDuration, transition, addToRenderQueue}` is one undo step (select the
items first: `project.select`).
+4 -1
View File
@@ -172,7 +172,10 @@ options are never shown. When the budget (Settings ▸ Memory & CPU) is full the
shown frames go first, and frames of an older revision are dropped as soon as the project
changes. The timeline's green bar counts the frames of exactly what the viewer shows.
Resolution Auto renders the pixels the magnification needs, as in After Effects (Full above
50 %, Half down to 33.3 %, Third down to 25 %, then Quarter). Below 100 % the viewer averages
50 %, Half down to 33.3 %, Third down to 25 %, then Quarter). The Resolution is the comp's
(`Comp::resolution`, saved with the project): setting it is no undo step (undo, redo and history
jumps carry the current values over) and, like the Shy switches, it is outside
`Comp::same_pixels`, so cached frames stay valid. Below 100 % the viewer averages
instead of skipping pixels (Viewer Zoom Quality More Accurate): GPU frames carry a mip chain
sampled trilinearly, CPU frames go up averaged down by the whole factor that leaves about one
texel per screen pixel.
+4 -1
View File
@@ -114,7 +114,10 @@ Viewer state that agents drive headless too: `view.snapping`, `view.snappingOpti
`header.snappingOptions`: After Effects' Snap Edges Extended and Snap to Features in Collapsed
Compositions and Text Layers), `view.channel {channel, colorized?}`,
`view.exposure {stops | delta}`, `view.resetExposure`, `view.takeSnapshot`, `view.showSnapshot`,
`view.fastPreviewMode {mode}`, `view.setRegionOfInterest {rect}`, `view.addGuide`,
`view.fastPreviewMode {mode}`, `view.res.full|half|third|quarter|auto {comp?}` and
`view.res.custom {factor, comp?}` (the comp's Resolution, saved with the project but no undo
step; `ui.set {viewer: {res}}` sets the active comp's, and `ui.inspect` reports it as
`ui.viewer.res`), `view.setRegionOfInterest {rect}`, `view.addGuide`,
`view.moveGuide`, `view.removeGuide`; editing: `shape.newPath` (Pen on shape layers),
`shape.newShape` (the shape tools: a new group in the selected shape layer, else a new shape layer),
`shape.toolOptions` (the Tools bar's Tool Creates Shape / Mask and Fill and Stroke Options),
+9 -2
View File
@@ -417,8 +417,15 @@ Fixes from measured reports:
too large (#390).
- The viewer's Auto resolution renders the pixels the magnification needs (Full above 50 %), and
frames shown below 100 % are averaged (GPU frames through mip levels, CPU frames by a whole
factor) instead of minified bilinearly (#417). Not yet: the viewer resolution and magnification
are not remembered between launches.
factor) instead of minified bilinearly (#417).
- Each composition keeps its Resolution (Auto, Full, Half, Third, Quarter or Custom) in the
project, as in After Effects: switching to another comp and back, or saving and reopening the
project, shows the same resolution. Changing it marks the project modified but adds no undo
step (undo and redo keep it) and keeps the comp's cached frames; projects saved before open
with Auto. View ▸ Resolution and the panel's popup run `view.res.full|half|third|quarter|auto`
and `view.res.custom {factor}`, which now work headless too; `comp.info` reports `resolution`
and `resolutionFactor` (#417). Not yet: the magnification is not saved per comp, and the
Composition Settings dialog has no Resolution popup.
## Update: plug-ins and extensions as in After Effects; ease presets become a ScriptUI panel