* CLI: a headless session's footage frames keep at most 1 GB (#4157)
Since #3301 the footage frames may fill the caches' whole common budget,
and since #3941 the CLI's budget is that of the installed RAM. A one-pass
render reads each frame about once, so it kept gigabytes of frames it never
read again and was killed under a cgroup memory limit.
Session::footage_cap caps the footage frames (and decoded planes) below
the common budget; apply_cache_budgets honours it, so a new memory reading
or a settings change keeps it. headless_session() sets it to
HEADLESS_MEDIA_CACHE (1 GB, the footage cache's default in 0.24). The
desktop app keeps the whole budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(host): a headless session's footage cap is exactly HEADLESS_MEDIA_CACHE (#4157)
Assert the cap itself (or the budget, if smaller) rather than only that it
is below the budget, which a wrong cap above 1 GB would also pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* #3328: output guard checks file identity only where an alias is possible
The output guard opened every footage file of the project, for every check
of an output that existed, on the UI thread: minutes for long sequences on
a network share. It now compares only the files that can be the output
(folders on the output's volume, folders holding symbolic links), keeps the
identities it learnt in the session (folders that changed are looked at
again; Reload Footage forgets them), and does no file system call while its
lock is held.
render.frame checks and writes with one guard. A control request whose
sender stopped waiting is not run, and one tick runs control requests for at
most a tenth of a second; the rest follow in order on the next ticks.
* #3328: output guard compares paths only, no file is opened
Comparing file identities still cost a file open per footage frame when
folders were on the output's volume, and caching them invited races (#3330
review). The guard now compares paths by name once resolved: absolute, dot
segments resolved, one separator, Windows verbatim prefixes as the plain
path, without case on Windows and macOS. A link or hard link to footage
under another name is no longer recognised; the reported data loss (#1743)
is the same-path case. Render queue duplicate outputs compare by name too.
* #3328: drop the link identity tests of the render queue; test and doc review fixes
* #3328: a mapped network drive and its UNC path are one place
On Windows the output guard resolves each drive letter's root once per guard
(std::fs::canonicalize of `X:\`) and compares a path on that letter as the
place it resolves to: a mapped network drive as its \server\share path, a
subst drive as its folder. A root that can't be resolved keeps its letter.
* #3328: drive roots are looked up only where they can matter, and kept a minute
A drive letter's root is resolved only when the output and the protected
files are not all on one letter, or not all UNC paths: footage and output on
one mapped drive never wait for a disconnected drive or an empty removable
one. Resolved roots, failures too, are kept process-wide for 60 s.
* #3328: the 13,000-frame guard test counts file system lookups instead of timing them
* #3328: note why only Windows counts lookups in the 13,000-frame guard test
* #3328: queued outputs collide under drive and UNC spellings
* #3328: queued sequences and subst drives compare by the place they name
* #3328: queued outputs keep their resolved places instead of resolving per comparison
* #3328: cache_bench's play request carries the abandoned flag (main's example met the new ControlRequest field)
* Refuse an output in a folder linked to a source's folder
An output whose name matches no protected file now has its folder resolved on disk, once per folder per guard, and is compared again by name. An output in render-alias/, a symbolic link or junction to plates/, no longer replaces plates/source.exr. No protected file is looked at.
* Resolve both folders, and only for a source with the output's file name
The footage path as imported may itself run through a link (macOS /var is /private/var, Windows 8.3 names), so resolving only the output's folder missed it. Now an output whose path matches nothing is compared again only with sources of the same file name, both folders resolved once per guard. An output named like no source asks the file system nothing.
The movie's audio step now times mixing and encoding as audio and muxing the encoded AAC/PCM
samples (and the AAC drain) as writing, as the timing contract says. A Finished update without
timing clears the item's earlier timing. New test: an_audio_mux_write_counts_as_writing.
The notes about a PhotoCraft composition that was already added now go
to the window as one non-error notice. With several compositions the
notice leads with the first note and a count of the rest, and the
finished import's toast repeats the notes. Both command results keep
the warnings as before.
A PhotoCraft document that imports as a composition now returns its
notes in the result's `warnings` instead of `errors`, so a successful
import no longer reports a failure. With `background`, the notes are
shown and returned when the job starts, since the composition stays in
the project when the footage job is canceled.
* #3057: Convert To Bezier Path converts a selected shape layer's or group's parametric paths
Right after drawing with the Rectangle, Ellipse or Polygon tool only the layer is selected,
and Convert To Bezier Path fell through to the mask branch and reported "no masks". It only
converted when the parametric path row itself (Rectangle Path 1) was selected.
- A selected shape group converts the parametric paths inside it, nested groups included.
- With only layers selected, a shape layer converts its parametric paths, as a selected
layer's masks are targeted. Locked layers are skipped; animated parametric paths are left
alone and reported (skippedAnimated), and selecting the path still converts it.
- Masks win only when targeted (mask param, selected mask, mask vertices) or when one uses
RotoBezier: plain masks no longer turn the command into a silent no-op.
- An explicit layer/layers limits selected shape items to those layers; an unmatched mask
param is an error instead of converting every path.
- Errors say what to select instead of asking for masks.
A PSD shape layer importing as a layer with a mask matches After Effects; no change there.
Fixes#3057
* #3057: Convert To Bezier Path converts a layer named twice once
A layer given twice in `layers` (by id and by name) was widened twice: its parametric paths were queued twice, and the second replacement found no such item, so the whole command failed. The layer list is deduplicated before the widening, which also keeps skippedAnimated from counting a path twice.
* #3057: Convert To Bezier Path leaves locked layers and a group's animated paths alone
Shape items given as `items` or selected on a locked layer converted anyway (only the layer-wide conversion checked locks); they now go through unlocked(), an error when every one is locked. A selected group skips its keyframed or expression-driven parametric paths and reports them in skippedAnimated, as converting a whole layer does; a path selected itself still converts at the current time.
* Doc comments for the functions this PR touches
* #3057: Convert To Bezier Path gives an explicit mask priority over shape items
With a `mask` given, a selected parametric path (or `items`) was converted instead of the mask, an unmatched `mask` converted the shape rather than reporting the miss, and a locked shape-item layer could reject the call before the mask was looked at. Shape items are now ignored when `mask` is present.
* #3057: Convert To Bezier Path converts a selected mask with the selected shape paths
With a mask and a parametric path both selected, only the path converted and the mask kept its RotoBezier tangents. Masks the selection targets (a selected mask or its property, mask vertices, on unlocked layers in scope) now convert in the same undo step, the result reports them as masks, and they stay selected with the new paths. An explicit `mask` keeps its priority.
* #3057: Convert To Bezier Path keeps mask conversion to an explicit layer
With `{"layer": A}` and a RotoBezier mask selected on layer B, the mask branch converted B's mask and left A unchanged. The resolved masks are now scoped to the explicit layer/layers (falling back to those layers' own masks), the priority check only counts selected masks and vertices in scope, and the scoped targets are edited directly instead of being resolved again.
* #3057: Convert To Bezier Path leaves masks on locked layers alone
A scoped or selected RotoBezier mask on a locked layer was converted through the mask branch. Masks on locked layers are now dropped after the scope and its fallback are resolved, so a locked selected mask does not hand the conversion to other masks; when every targeted mask is locked, the command reports the lock, as it does for shape items.
* #3057: Convert To Bezier Path converts in the composition `comp` names
With `comp` naming a composition that is not active, an explicit `mask` was resolved there but filtered against the active composition ("no mask matches"), and explicit `items` were looked up in the active composition. convert_to_bezier now works in the composition comp_id resolves, and selected_shape_items returns the composition layer_p resolved for explicit items (also used by Group and Ungroup Shapes); a selection made in another composition does not apply.
* Convert To Bezier Path: explicit items add no selected masks
With explicit `items`, only those shape paths convert. A RotoBezier mask
selected on the same layer no longer loses its RotoBezier flag as a side
effect. Regression test added.
* Convert To Bezier Path: explicit items without a parametric path convert no mask
* Convert To Bezier Path: items count as given only as a list
---------
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
* Scripts: a ScriptUI Browse… button opens the file dialog
Fixes#2778.
Fixes#2894.
File.openDialog, File.saveDialog, Folder.selectDialog and the instance
openDlg / saveDlg / selectDlg were stubs that returned null, so a script
dialog's or a dockable ScriptUI panel's Browse… button did nothing.
On a script-host thread, in an app that shows them, the script now asks
for the dialog (Session::script_ui.file_dialogs, each with an id), hands
the session back like a modal dialog's show() does and waits for the
answer: a File (an array with multiSelect), a Folder, or null when
cancelled. The script's filter becomes the dialog's (its name, "All Files"
for *.*); without extensions every file shows. Headless runs, the Script
Console, the web and Shutdown scripts get null at once.
The app shows the dialog after the pass's events: blocking on Windows
(Hooks::pick_file_dialog), without blocking on macOS and Linux, one at a
time; a non-blocking dialog that ends without answering counts as
cancelled. scriptui.fileDialogs lists the waiting dialogs and
scriptui.fileDialog answers one (refused while file access is confined,
and refused to scripts). A dialog leaves the list only when its script
has the answer; the script's windows refuse events meanwhile, except
scriptui.close, which cancels the file dialog first. A script host that
ends takes its dialogs with it.
* Scripts: carry a file dialog's prompt, start location and filter to the native dialog (#2778)
serve_file_dialogs collected the script's prompt, start folder and save filter
but dropped them at the host boundary. FileDialog::Script now carries prompt and
start, and new ScriptFolder and ScriptSave requests carry the folder dialog's
prompt/start and the save dialog's prompt and whole filter (label, extensions,
any file) instead of the default name's extension. Both the blocking and the
non-blocking host dialogs apply title, initial directory and filters; Save also
goes through the blocking hook where one is set. Hook-level regression test
asserts all three requests.
* Scripts: a hidden window paints so a script's file dialog is shown (#3253 review)
* Scripts: formatting (#3253)
The command-line tool reads the system's memory once at start, so its caches
share the budget of the installed RAM instead of the budget for unknown RAM.
A Render Queue run's two layer caches and a one-off export's own caches take
the session's layer cache budget instead of a fixed 512 MiB; they are in the
memory accountant, which keeps them within the common budget together with the
other caches. In the browser each gets half the layer cache's cap.
Pasting a copied Source Text keyframe (keys.paste, Paste Reversed) or a
copied unanimated Source Text value (Edit > Copy / Paste) went through the
value's JSON form, which is the characters only, so the pasted key took the
font, size and colours of the property's current value. A copied text value
now pastes as the whole document; every other kind is pasted as before.
The two tests of the 512 MiB limit read a sparse file one byte over it
into memory to show that other ZIP-based files are read whole. They now
check the limit from the file's length alone and read a 4-byte file: the
engine test reads it with and without a smaller limit, and the media
reader's limit comes from input_limit, which gives the limit for .pcraft
files only.
A pass-through group becomes a precomposition with Collapse Transformations on, and the renderer collapses one only 12 comps deep. A deeper one was flattened, so its layers no longer blended with the layers below the group. Composition import now refuses pass-through groups more than 13 levels deep and suggests Footage, as it does for groups more than 16 levels deep. The renderer's limit is effectcraft_render::MAX_COLLAPSE_DEPTH.
The 512 MiB limit is effectcraft_project::PCRAFT_MAX_INPUT. The engine
re-exports it and the media reader's limit is defined from it, so the two
reads cannot drift apart. Both reads compute their take() limit with
saturating_add.
`file.interpretFootage` resolves its items as before and skips what isn't
footage, so an explicit missing id, composition or solid succeeds and
changes nothing again, and a script setting a solid's
mainSource.conformFrameRate doesn't throw. The dialog still opens on the
first item `interpretation_targets` gives, which is the first footage the
command changes, and opens no dialog when that is none.
Tests pin Main's result for those targets, Proxy's existing error, and
the script setter on a solid.
Opened with `item`/`items` (an agent's `ui.menu.invoke`), the Interpret
Footage dialog filled its fields from the Project selection while OK ran
the command on the named item, so that item took another footage's
interpretation. The dialog and the commands now share one target
resolution, `commands::interpretation_targets`: `items`, else `item`,
else the selection, keeping footage (for Proxy, items with a proxy). The
dialog shows its first item.
A named item that is missing, not footage or (Proxy) without a proxy
opens no dialog: the command runs and reports that there is nothing to
interpret, as Proxy already did. Interpret Footage used to accept such
ids and change nothing. Use Proxy and the proxy commands' enablement
share the "has a proxy" filter.
The table holds only Gaussian Blur's row; the ranges changed since 0.24.1
by other work are tracked in #3815. The 30000 render test checks the
buffer against crate::pixel_budget instead of a copied constant.