Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

M0.37: reconcile shared docking and qualify migration follow-up

skylar taylor-barrick69b9ce2bd128
diff --cc .github/workflows/sonarcloud.yml
index e78fe1ea3,e78fe1ea3..8f1aa5ad5
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@@ -16,6 -16,6 +16,9 @@@ concurrency
jobs:
sonarcloud:
-- # Tracked at @main so org-wide CI improvements propagate without PR churn.
++ # Track shared CI improvements on main.
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
++ with:
++ timeout-minutes: 120
++ fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
secrets: inherit
diff --cc apps/effectcraft-web/src/lib.rs
index 0d59906f2,0d59906f2..97d2e887f
--- a/apps/effectcraft-web/src/lib.rs
+++ b/apps/effectcraft-web/src/lib.rs
@@@ -6,17 -6,17 +6,17 @@@
//!
//! | Desktop | Web |
//! |---|---|
--//! | file system (`FsServices`, media reads, export writes) | a virtual file table ([`files`]) persisted to the Origin Private File System / IndexedDB ([`persist`], [`store`]) |
++//! | file system (`FsServices`, media reads, export writes) | a virtual file table (`files`) persisted to the Origin Private File System / IndexedDB (`persist`, [`store`]) |
//! | config directory (settings, shortcuts, recent projects, auto-saves) | the same store ([`store::WebConfig`]) |
//! | rfd file dialogs | `<input type=file>` pickers; drop files on the page |
--//! | Media Browser on the file system | browser storage and folders opened with the File System Access API ([`browse`]) |
++//! | Media Browser on the file system | browser storage and folders opened with the File System Access API (`browse`) |
//! | written files (Save, Render Queue) | browser downloads (several render files as one `.zip`) |
--//! | frame render threads | frame workers, each with a project replica fed by diffs and its own WebGPU device ([`frames`]); `Frames::pump` on the UI thread without workers |
--//! | disk cache folder | frames in the Origin Private File System, written by the frame workers ([`diskcache`]) |
--//! | (none) | the storage manager: usage, quota, persistence, clearing ([`storage`]) |
--//! | Render Queue / analysis threads | Web Workers running their own engine instance ([`worker`]) |
--//! | cpal audio output | Web Audio: an AudioWorklet fed from the preview mixdown ([`audio`]) |
--//! | TCP control channel / MCP | `window.effectcraft` JavaScript API ([`api`]) |
++//! | frame render threads | frame workers, each with a project replica fed by diffs and its own WebGPU device (`frames`); `Frames::pump` on the UI thread without workers |
++//! | disk cache folder | frames in the Origin Private File System, written by the frame workers (`diskcache`) |
++//! | (none) | the storage manager: usage, quota, persistence, clearing (`storage`) |
++//! | Render Queue / analysis threads | Web Workers running their own engine instance (`worker`) |
++//! | cpal audio output | Web Audio: an AudioWorklet fed from the preview mixdown (`audio`) |
++//! | TCP control channel / MCP | `window.effectcraft` JavaScript API (`api`) |
//!
//! [`store`] is portable (unit-tested natively); everything else is `wasm32`-only.
diff --cc apps/effectcraft/src/main.rs
index ccd46951a,5e3e14c65..6df015290
--- a/apps/effectcraft/src/main.rs
+++ b/apps/effectcraft/src/main.rs
@@@ -128,21 -128,32 +128,36 @@@ fn control_port(name: &str, value: Opti
/// answer without pumping events, so the window stops answering the compositor and the desktop
/// offers to force-quit it while the Open dialog is up (#1275). Windows' blocking dialog pumps
/// its own messages, so it keeps [`effectcraft_ui_egui::Hooks::pick_files`] and friends.
- fn install_file_dialogs(app: &mut EffectcraftApp, ctx: &egui::Context) {
+ /// The dialogs asked for in a frame show at its end ([`sheet_dialogs::show_asked`]), where the
+ /// main window's handle is at hand.
+ fn install_file_dialogs(app: &mut EffectcraftApp) -> Option<std::sync::mpsc::Receiver<sheet_dialogs::Asked>> {
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
- let ctx = ctx.clone();
- app.hooks.file_dialog_async = Some(Box::new(move |dialog, done| sheet_dialogs::show(dialog, done, ctx.clone())));
+ let (tx, rx) = std::sync::mpsc::channel::<sheet_dialogs::Asked>();
+ app.hooks.file_dialog_async = Some(Box::new(move |dialog, done| {
+ if tx.send((dialog, done)).is_err() {
+ log::error!("file dialog: the window is gone");
+ }
+ }));
+ Some(rx)
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
- let _ = (app, ctx);
+ {
+ let _ = app;
+ None
+ }
}
+/// Run a normal desktop launch: install logging and the panic hook, parse arguments (`--version` exits before the
+/// session log is attached), scan fonts, honor the launch guard's backend choice and open the eframe window.
+/// Builds the session, loads settings, plugins, the requested project/media and the optional control server, then
+/// reports startup failure through `startup_failed`. Returns the event loop's result.
fn main() -> eframe::Result {
+ // Windows: the update helper is a copy of this program started with `--finish-update`.
+ #[cfg(windows)]
+ if let Some(result) = craft_update::self_update::finish(&craft_update::suite::EFFECTCRAFT, &std::env::args_os().skip(1).collect::<Vec<_>>()) {
+ std::process::exit(i32::from(result.is_err()));
+ }
// First, so the panic hook and every start-up warning are recorded. Records go to stderr
// and the session log; Help ▸ Enable Logging writes through this logger too, and warnings
// feed the compatibility report.
diff --cc crates/effects/src/catalog.rs
index 0be2b04f5,0be2b04f5..80a937b22
--- a/crates/effects/src/catalog.rs
+++ b/crates/effects/src/catalog.rs
@@@ -92,7 -92,7 +92,7 @@@ const CPU_ONLY_CONTROLS: &[(&str, &[&st
];
/// Whether the GPU kernel of effect `id` covers the instance's current settings (see
--/// [`CPU_ONLY_CONTROLS`]; plus Cell Pattern's HQ variants and Turbulent Displace's locked
++/// `CPU_ONLY_CONTROLS`; plus Cell Pattern's HQ variants and Turbulent Displace's locked
/// pinning).
pub fn gpu_supported(id: &str, ctx: &crate::EffectCtx) -> bool {
match id {
diff --cc crates/effects/src/channel3d.rs
index 39a1c49b1,39a1c49b1..ea194f6da
--- a/crates/effects/src/channel3d.rs
+++ b/crates/effects/src/channel3d.rs
@@@ -359,7 -359,7 +359,7 @@@ pub(crate) fn selection_names(sel: &str
out
}
--/// Parse a selection: comma-separated names (optionally quoted, see [`selection_names`]) or
++/// Parse a selection: comma-separated names (optionally quoted, see `selection_names`) or
/// `<hex>` hashes / wildcards.
pub fn selection_hashes(sel: &str, manifest: Option<&[(String, u32)]>) -> Vec<u32> {
let mut out = vec![];
diff --cc crates/effects/src/color_fx.rs
index 402d0ebe2,402d0ebe2..06884017c
--- a/crates/effects/src/color_fx.rs
+++ b/crates/effects/src/color_fx.rs
@@@ -25,7 -25,7 +25,7 @@@ pub(crate) fn luma_601(c: [f32; 3]) ->
LUMA_601[0] * c[0] + LUMA_601[1] * c[1] + LUMA_601[2] * c[2]
}
--/// The Rec. 601 luma weights of [`luma_601`]. The WGSL kernels repeat them as literals; the GPU
++/// The Rec. 601 luma weights of `luma_601`. The WGSL kernels repeat them as literals; the GPU
/// test `shader_constants_match_the_cpu` checks that they are these.
pub const LUMA_601: [f32; 3] = [0.299, 0.587, 0.114];
@@@ -384,7 -384,7 +384,7 @@@ pub fn mirror_pow(v: f32, p: f32) -> f3
/// back toward the gray). After Effects 2026 with Tint Color [1, 0.5, 0]: gray 0.1 (a red solid
/// at Reds 10, case 717) → (43, 21, 0), gray 0.6 (yellow at defaults, case 825) → (255, 129, 2),
/// white → white; the old hue / saturation / lightness mix gave (51, 26, 0) for the first.
--/// The luminosity weights of [`bw_tint`] (a Color blend's). `fx_color.wgsl` repeats them; the GPU
++/// The luminosity weights of `bw_tint` (a Color blend's). `fx_color.wgsl` repeats them; the GPU
/// test `shader_constants_match_the_cpu` checks that they are these.
pub const BW_TINT_LUMA: [f32; 3] = [0.3, 0.59, 0.11];
@@@ -755,7 -755,7 +755,7 @@@ impl ColoramaPalette
}
}
-- /// Parse "pos:r,g,b[,a] pos:r,g,b …" (positions 0..1, channels 0..1). `None` without stops.
++ /// Parse "pos:r,g,b\[,a\] pos:r,g,b …" (positions 0..1, channels 0..1). `None` without stops.
pub fn parse(s: &str) -> Option<ColoramaPalette> {
let mut stops: Vec<(f32, [f32; 4])> = s
.split_whitespace()
diff --cc crates/effects/src/generate2.rs
index 80d32ce0e,80d32ce0e..fcb05d6e2
--- a/crates/effects/src/generate2.rs
+++ b/crates/effects/src/generate2.rs
@@@ -61,7 -61,7 +61,7 @@@ const CELL_PATTERNS: [&str; 12] =
"Tubular",
];
--/// Shaping used for Cell Pattern option `i` (see [`cell_value`]).
++/// Shaping used for Cell Pattern option `i` (see `cell_value`).
pub fn pattern_kind(i: u32) -> u32 {
match i {
0..=5 => i,
diff --cc crates/effects/src/generate3.rs
index 6beec4cb7,6beec4cb7..9e22ac8ae
--- a/crates/effects/src/generate3.rs
+++ b/crates/effects/src/generate3.rs
@@@ -147,8 -147,8 +147,8 @@@ pub(crate) fn paint(img: &mut Image, co
});
}
--/// Coverage of a plan-drawn generator: round-capped segments rasterised by [`raster_segs`]
--/// with `hardness`, or the union of convex polygons ([`raster_convex`]).
++/// Coverage of a plan-drawn generator: round-capped segments rasterised by `raster_segs`
++/// with `hardness`, or the union of convex polygons (`raster_convex`).
#[derive(Clone, Debug)]
pub enum Coverage {
Segs { segs: Vec<Seg>, hardness: f64 },
@@@ -165,7 -165,7 +165,7 @@@ impl Coverage
}
/// Stroke, Scribble, Vegas and Write-on, shared with the GPU compositor (effectcraft-gpu
--/// `fx_gen2`): the coverage and how it is painted. `style` 0–2 as [`paint`] (On Original
++/// `fx_gen2`): the coverage and how it is painted. `style` 0–2 as `paint` (On Original
/// Image, On Transparent, Reveal Original Image), 3 = under the layer (Vegas' Composite Under).
#[derive(Clone, Debug)]
pub struct PaintPlan {
@@@ -213,7 -213,7 +213,7 @@@ pub fn paint_plan(id: &str, ctx: &Effec
}
}
--/// Scribble's Composite as a [`paint`] style.
++/// Scribble's Composite as a `paint` style.
pub fn scribble_style(ctx: &EffectCtx) -> u32 {
match ctx.params.e("composite") {
0 => 0,
@@@ -1596,7 -1596,7 +1596,7 @@@ fn draw_marks(b: &mut Buf, segs_core: &
}
/// Audio Spectrum / Audio Waveform, shared with the GPU compositor (effectcraft-gpu `fx_gen2`):
--/// the marks (the audio analysis runs on the CPU) and how [`draw_marks`] colours them.
++/// the marks (the audio analysis runs on the CPU) and how `draw_marks` colours them.
#[derive(Clone, Debug)]
pub struct MarksPlan {
pub segs: Vec<Seg>,
diff --cc crates/effects/src/noise3.rs
index baa5fb50a,baa5fb50a..bf1f05ed6
--- a/crates/effects/src/noise3.rs
+++ b/crates/effects/src/noise3.rs
@@@ -333,7 -333,7 +333,7 @@@ impl Fractal
}
/// Fractal / Turbulent Noise resolved for the GPU kernel (effectcraft-gpu `fx_noise`): the
--/// per-pixel constants and, per octave, the terms [`Fractal::raw`] computes before touching the
++/// per-pixel constants and, per octave, the terms `Fractal::raw` computes before touching the
/// pixel, in the same f32 order.
pub struct FractalGpu {
pub kind: u32,
diff --cc crates/effects/src/ocio.rs
index 74816b110,e84720a32..df579964f
--- a/crates/effects/src/ocio.rs
+++ b/crates/effects/src/ocio.rs
@@@ -1055,7 -1055,7 +1055,7 @@@ pub enum ColorOp
/// Negative channels to 0 (the saturation intent).
Max0,
/// A LUT (0 nearest, 1 trilinear, 2 tetrahedral) with an optional per-channel shaper, forward
-- /// or inverse (as [`FileXform::apply`]).
++ /// or inverse (as `FileXform::apply`).
Lut { lut: Arc<Lut>, shaper: Option<Arc<[Vec<(f32, f32)>; 3]>>, interp: u32, inverse: bool },
/// `m × (c + pre) + post` (a custom config's MatrixTransform and RangeTransform).
Affine { m: [[f32; 3]; 3], pre: [f32; 3], post: [f32; 3] },
@@@ -1322,7 -1322,7 +1322,7 @@@ fn curve3(xs: [f64; 3], ys: [f64; 3], v
}
/// Color Stabilizer's correction of buffer `b` as one piecewise-linear map per channel (points
--/// with increasing x; the end segments extend), the same maps [`color_stabilizer`] applies.
++/// with increasing x; the end segments extend), the same maps `color_stabilizer` applies.
/// `None` without a host or reference frame (the layer passes through). (The GPU effect.)
pub fn color_stabilizer_maps(ctx: &EffectCtx, b: &Buf) -> Option<[Vec<(f64, f64)>; 3]> {
let reference = ctx.env.host?.self_at(ctx.params.f("referenceFrame"), ctx.env.effect_index)?;
diff --cc crates/effects/src/ocio_config.rs
index 5ea844414,5ea844414..41c74b4e4
--- a/crates/effects/src/ocio_config.rs
+++ b/crates/effects/src/ocio_config.rs
@@@ -20,7 -20,7 +20,7 @@@
//! * `looks` (`name`, `process_space`, `transform`, `inverse_transform`) and look strings
//! (`+A, -B`, `A | B` = the first one the config has);
//! * transforms: `MatrixTransform` (`matrix` 4×4 row-major, `offset`), `FileTransform` (the LUT,
--//! CDL and matrix files [`super::ocio::parse_file`] reads; `interpolation`, `ccc_id`),
++//! CDL and matrix files `super::ocio::parse_file` reads; `interpolation`, `ccc_id`),
//! `ExponentTransform` (`value`), `ExponentWithLinearTransform` (`gamma`, `offset`, `style:
//! mirror`; the power curve with a linear toe that the Academy CLF specification calls
//! "moncurve"), `LogTransform` (`base`), `LogAffineTransform` (`base`, `logSideSlope`,
diff --cc crates/effects/src/sim.rs
index 14146a9f4,14146a9f4..1bb82f46e
--- a/crates/effects/src/sim.rs
+++ b/crates/effects/src/sim.rs
@@@ -186,7 -186,7 +186,7 @@@ pub enum Tint
/// How a sprite layer meets the original layer.
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Post {
-- /// [`combine`] with this mode (0 Composite … 5 sprites only).
++ /// `combine` with this mode (0 Composite … 5 sprites only).
Combine(u32),
/// The sprites alone.
Replace,
diff --cc crates/effects/src/sim2.rs
index cf7322bda,cf7322bda..939c36757
--- a/crates/effects/src/sim2.rs
+++ b/crates/effects/src/sim2.rs
@@@ -1586,7 -1586,7 +1586,7 @@@ pub struct FoamEnv
/// What Foam draws this frame over a transparent frame of the layer's size: the bubble sprites,
/// then the User Defined texture's discs, the Environment Map's reflections and (Draft + Flow
--/// Map) the flow map under it all, each [`foam_disc`]-composited in bubble order.
++/// Map) the flow map under it all, each `foam_disc`-composited in bubble order.
pub struct FoamPlan {
pub sprites: crate::sim::SpritePlan,
pub user: Option<(crate::LayerPixels, Vec<FoamDisc>)>,
diff --cc crates/export/src/lib.rs
index eda979958,eda979958..9af195204
--- a/crates/export/src/lib.rs
+++ b/crates/export/src/lib.rs
@@@ -13,7 -13,7 +13,7 @@@
//! | AV1 | MP4 (`av01`) | `effectcraft-av1enc` Main 8/10-bit 4:2:0, key + inter frames | no | AAC-LC (FilmCraft) |
//! | WAV / AIFF | RIFF WAVE / AIFF (AIFF-C for float) | — | — | PCM 16/24-bit or 32-bit float, mono/stereo (audio only) |
//!
--//! Every frame goes through [`pipeline`]: the Render Settings overrides (Effects, Solo Switches,
++//! Every frame goes through the internal `pipeline` module: the Render Settings overrides (Effects, Solo Switches,
//! Guide Layers, Frame Blending, Motion Blur, Color Depth), field rendering (two fields half a
//! frame apart woven line by line, with optional 3:2 pulldown from film frames at 4/5 of the
//! rate), then the Output Module's Crop (edges or the region of interest) and Resize. Channels
diff --cc crates/expr/src/rewrite.rs
index 6b0ea539f,6b0ea539f..35c373bb4
--- a/crates/expr/src/rewrite.rs
+++ b/crates/expr/src/rewrite.rs
@@@ -581,7 -581,7 +581,7 @@@ fn push_piece(out: &mut String, p: Piec
/// rewrite (which nests a call per arithmetic operator). The JavaScript parser and compiler
/// recurse per level and a 2 MiB thread overflows its stack (aborting the app) at about 75
/// nested brackets, so deeper expressions are rejected with an error instead. Constructs that
--/// nest without brackets count as part of a level ([`too_nested`]).
++/// nest without brackets count as part of a level (`too_nested`).
pub const MAX_NESTING: usize = 32;
/// Hard limit on bytes emitted by the array-math source rewrite.
pub const MAX_REWRITTEN_BYTES: usize = 4 * 1024 * 1024;
@@@ -608,7 -608,7 +608,7 @@@ const HEAVY: usize = 32
/// about 3 800 links).
const LIGHT: usize = 6;
--/// One bracket level of [`too_nested`]'s walk.
++/// One bracket level of `too_nested`'s walk.
#[derive(Default)]
struct Level {
/// `[`: commas separate elements (a loop in the parser), not operands.
@@@ -710,7 -710,7 +710,7 @@@ fn too_nested(toks: &[Tok]) -> bool
too_nested_from(toks, 0)
}
--/// [`too_nested`] for code that already sits `base` deep (a template substitution).
++/// `too_nested` for code that already sits `base` deep (a template substitution).
fn too_nested_from(toks: &[Tok], base: usize) -> bool {
let mut levels = vec![Level::default()];
let mut prefix = 0usize;
diff --cc crates/media/src/exr_channels.rs
index 8c4cb1339,8c4cb1339..795da99e5
--- a/crates/media/src/exr_channels.rs
+++ b/crates/media/src/exr_channels.rs
@@@ -183,7 -183,7 +183,7 @@@ fn picture_layer<'a>(aux: &AuxChannels
/// The picture of a multi-layer OpenEXR file without an unnamed RGB layer (Blender's
/// `ViewLayer.Combined.R`, the compositor's `Image.R`, Nuke's `beauty.R`, …), which the image
/// decoder rejects. After Effects shows a file's main RGBA channels and leaves the other layers
--/// to EXtractoR; here that is the beauty pass by name ([`BEAUTY`]), else the first colour layer
++/// to EXtractoR; here that is the beauty pass by name (`BEAUTY`), else the first colour layer
/// that is not a data pass (never Cryptomatte, depth or normals, #412), else the first channel
/// as grey. Linear, straight RGBA as the file stores it. `None` when it is not a readable EXR.
pub fn layered_image(bytes: &[u8]) -> Option<image::DynamicImage> {
diff --cc crates/media/src/pool.rs
index 4deefed35,7f602465d..4820efa35
--- a/crates/media/src/pool.rs
+++ b/crates/media/src/pool.rs
@@@ -388,7 -388,7 +388,7 @@@ impl MediaPool
}
/// The conformed-audio file of `path` at `rate` (named by a hash of the path, size and
-- /// modification time, so an edited file conforms again, and of [`CONFORM_VERSION`]).
++ /// modification time, so an edited file conforms again, and of `CONFORM_VERSION`).
pub fn conformed_path(&self, path: &str, rate: u32) -> Option<std::path::PathBuf> {
use std::hash::{Hash, Hasher};
let folder = lock(&self.inner.conform).clone()?;
diff --cc crates/path/src/boolean.rs
index 5a81b3e19,5a81b3e19..bcd395566
--- a/crates/path/src/boolean.rs
+++ b/crates/path/src/boolean.rs
@@@ -5,7 -5,7 +5,7 @@@
//! MIT OR Apache-2.0), reworked to take and return kurbo paths directly.
//!
//! Inputs are closed implicitly (a filled open path is painted as if closed). The sweep splits
--//! curves at intersections and y-extrema; [`tidy_segments`] re-joins pieces that came from one
++//! curves at intersections and y-extrema; `tidy_segments` re-joins pieces that came from one
//! input curve (exactly) or one smooth run (by least-squares refit), so results carry roughly as
//! few vertices as the inputs. Output contours are simple and consistently oriented (holes wind
//! opposite to their outer contour), so they fill the same under either fill rule.
diff --cc crates/path/src/trace.rs
index 429738032,429738032..01508bcaf
--- a/crates/path/src/trace.rs
+++ b/crates/path/src/trace.rs
@@@ -6,7 -6,7 +6,7 @@@
//! with "outside" so every contour closes.
//! 2. **Douglas–Peucker** simplification of each closed loop to the Tolerance (pixels).
//! 3. **Bezier fitting**: each simplified span is fitted with one cubic (least squares with fixed
--//! end tangents, Newton reparameterisation; [`crate::fit`]). The tangent at each vertex is the
++//! end tangents, Newton reparameterisation; `crate::fit`). The tangent at each vertex is the
//! chord direction at Corner Roundness 0 (straight segments, sharp corners) and the smooth
//! (Catmull–Rom) direction at 100 %, blended between.
//!
diff --cc crates/psd/src/lib.rs
index 5ae32126a,5ae32126a..60a9ab806
--- a/crates/psd/src/lib.rs
+++ b/crates/psd/src/lib.rs
@@@ -1,5 -1,5 +1,5 @@@
//! Photoshop document (PSD / PSB) reader, implemented from Adobe's public *Photoshop File Formats
--//! Specification* (see README.md), and a minimal writer ([`write`]) for fixtures.
++//! Specification* (see README.md), and a minimal writer ([`mod@write`]) for fixtures.
//!
//! [`Psd::parse`] reads the structure (header, layer records and their additional information,
//! the layer tree) without decoding pixels; [`Psd::composite`] decodes the merged image and
diff --cc crates/render/src/lib.rs
index bf3aa42ee,bf3aa42ee..e4fc8e6e5
--- a/crates/render/src/lib.rs
+++ b/crates/render/src/lib.rs
@@@ -521,7 -521,7 +521,7 @@@ pub struct RenderOpts
pub motion_blur: bool,
/// Render guide layers (viewer only). Only the top-level comp's own guide layers: nested
/// comps (precomps, collapsed precomps, comps read by effects) never draw theirs, as in
-- /// After Effects (see [`Renderer::nested_opts`]).
++ /// After Effects (see `Renderer::nested_opts`).
pub guides: bool,
/// Draft quality: fewer motion-blur samples, bilinear only.
pub draft: bool,
diff --cc crates/render/src/three_d/adv/shade.rs
index c7c1a40f1,c7c1a40f1..9acc852fe
--- a/crates/render/src/three_d/adv/shade.rs
+++ b/crates/render/src/three_d/adv/shade.rs
@@@ -230,7 -230,7 +230,7 @@@ const PLANE_SLOPE_MAX: f32 = 64.0
/// Fraction of light reaching `p` through shadow map `m` (1 = lit). `ng` is the
/// receiver's geometric (not normal-mapped) normal facing the viewer.
///
--/// PCF over an N×N tap grid (5 ≤ N ≤ [`PCF_MAX_TAPS`]) spread over a reach derived
++/// PCF over an N×N tap grid (5 ≤ N ≤ `PCF_MAX_TAPS`) spread over a reach derived
/// from `radius` (the wanted penumbra in output pixels) divided by the receiver's
/// texel footprint, each tap jittered by an integer hash of the receiver's
/// sub-texel cell and the tap index, and each tap comparing against the four
diff --cc crates/render/src/three_d/compose.rs
index 20061f756,20061f756..929b48d45
--- a/crates/render/src/three_d/compose.rs
+++ b/crates/render/src/three_d/compose.rs
@@@ -703,7 -703,7 +703,7 @@@ fn occlusion(c: &Item, p: Vec3, l: &Lig
/// A Classic 3D run prepared for an accelerator ([`Renderer::prepare_3d_run`]): every plane
/// with its geometry, material and buffer, ready for the per-pixel depth sort, lighting and
--/// ray-cast shadows of [`draw_run`] on another device.
++/// ray-cast shadows of `draw_run` on another device.
#[derive(Clone, Debug)]
pub struct Run3d {
/// Drawn planes in stack order, then shadow casters from outside the run (`draw` false).
@@@ -971,7 -971,7 +971,7 @@@ pub(crate) fn environment_rotation(ctx
.to_radians() as f32
}
--/// An Environment Light Background layer ready to draw (see [`draw_sky`]): the layer's
++/// An Environment Light Background layer ready to draw (see `draw_sky`): the layer's
/// buffer in the blending space, its opacity and the camera's view rays. Also handed to an
/// accelerator's compositor (`Renderer::sky_draw`).
#[derive(Clone)]
diff --cc crates/render/src/three_d/mod.rs
index bccfc3e05,bccfc3e05..f2cc1c70a
--- a/crates/render/src/three_d/mod.rs
+++ b/crates/render/src/three_d/mod.rs
@@@ -2,7 -2,7 +2,7 @@@
//! compositor for runs of 3D layers.
//!
//! The 2D compositor (`Renderer::comp_frame`) walks the layer stack bottom-to-top; each run of
--//! consecutive 3D layers is handed to [`compose::draw_run`] as a group (2D layers break 3D
++//! consecutive 3D layers is handed to `compose::draw_run` as a group (2D layers break 3D
//! groups, as in After Effects).
pub mod adv;
diff --cc crates/script/src/runtime.rs
index 192da5740,192da5740..608c83d0e
--- a/crates/script/src/runtime.rs
+++ b/crates/script/src/runtime.rs
@@@ -710,7 -710,7 +710,7 @@@ pub(crate) fn outcome(output: Vec<Strin
/// don't block.
///
/// ExtendScript's `#include` / `#includepath` are inlined first, and errors point at the file
--/// and line they came from ([`crate::include`]).
++/// and line they came from (`crate::include`).
pub fn run(session: &mut Session, req: &ScriptRequest) -> Outcome {
let expanded = match crate::include::expand(session, req.code, req.name) {
Ok(x) => x,
diff --cc crates/ui-egui/src/dock_ui.rs
index 05bcd1c8e,41977e667..30710392a
--- a/crates/ui-egui/src/dock_ui.rs
+++ b/crates/ui-egui/src/dock_ui.rs
@@@ -88,82 -364,14 +364,16 @@@ impl EffectcraftApp
if let Some(l) = self.session.active_comp().and_then(|c| self.session.state.selected_layers.first().and_then(|id| c.layer(*id)))
&& l.label != effectcraft_engine::color::Label::None
{
- v.push((PanelKind::EffectControls, dock::TabDeco { swatch: self.tokens.label(l.label), locked: false, viewer: false }));
- }
- v
- }
-
- /// Settings ▸ Appearance ▸ Use Label Color for Related Tabs: the Composition and Timeline
- /// tabs carry their comp's label colour, Effect Controls and Properties the layer's.
- fn label_tab_marks(&self, ui: &egui::Ui) {
- if !self.session.prefs.appearance.use_label_color_for_tabs {
- return;
- }
- let Some(cid) = self.session.active_comp_id() else { return };
- let comp_label = self.session.project.item(cid).map(|i| i.label);
- let layer_label = self.session.active_comp().and_then(|c| self.session.state.selected_layers.first().and_then(|l| c.layer(*l))).map(|l| l.label);
- // (the Composition, Timeline and Effect Controls tabs carry their swatch already)
- let _ = comp_label;
- for (p, label) in [(PanelKind::Properties, layer_label)] {
- let (Some(label), Some(e)) = (label, self.auto.find(&format!("panel.tab.{}", p.id()))) else { continue };
- if label == effectcraft_engine::color::Label::None {
- continue;
+ v.push((PanelKind::EffectControls, self.tokens.label(l.label)));
+ if self.session.prefs.appearance.use_label_color_for_tabs {
+ v.push((PanelKind::Properties, self.tokens.label(l.label)));
}
- let r = Rect::from_min_size(pos2(e.rect[0] + 2.0, e.rect[1] + 9.0), vec2(4.0, (e.rect[3] - 16.0).max(6.0)));
- ui.painter().rect_filled(r, 1.0, self.tokens.label(label));
- }
- }
-
- /// Edit the full layout (docked tree + floating groups) with a [`Layout`] operation.
- pub fn edit_layout(&mut self, f: impl FnOnce(&mut Layout) -> bool) -> bool {
- let Ok(shared) = crate::dock_shared::encode(&self.ui.dock, &self.ui.floating) else { return false };
- if shared.validate().is_err() {
- return false;
- }
- let mut l = Layout { root: self.ui.dock.clone(), floating: self.ui.floating.clone() };
- if !f(&mut l) {
- return false;
- }
- self.ui.dock = l.root;
- self.ui.floating = l.floating;
- if self.ui.maximized.is_some_and(|m| !self.ui.dock.contains(m)) {
- self.ui.maximized = None;
- }
- true
- }
-
- /// Close a panel wherever it is (docked or floating).
- pub fn close_panel(&mut self, p: PanelKind) {
- // Commit the layout first: rejected closes must not release viewer or script state.
- if !self.edit_layout(|layout| layout.apply(Action::Close { panel: p }).is_ok()) {
- return;
- }
- // Closing a ScriptUI panel closes its script window (its script's onClose runs).
- if let PanelKind::ScriptPanel(id) = p
- && self.session.script_ui.window(id).is_some()
- && let Err(e) = self.session.execute("scriptui.close", serde_json::json!({"window": id}))
- {
- self.ui.status = e.to_string();
- }
- panels::viewers::on_close(self, p);
- if self.ui.maximized == Some(p) {
- self.ui.maximized = None;
}
- }
-
- /// Toggle the maximized panel (`p`, or none).
- pub fn toggle_maximize(&mut self, p: PanelKind) {
- self.ui.maximized = if self.ui.maximized == Some(p) || !self.ui.dock.contains(p) { None } else { Some(p) };
- }
-
- /// The docked panel whose group is under `pos` (from the last frame), else the focused one.
- pub fn panel_at(&self, pos: Option<egui::Pos2>) -> PanelKind {
- pos.and_then(|p| self.dock_rects.iter().rev().find(|(_, r)| r.contains(p)).map(|(k, _)| *k)).unwrap_or(self.ui.focused)
+ v
}
+ /// Draw panel `p`'s body in `rect`: register its automation region, put the Composition Navigator above an active
+ /// viewer when a nested-comp flow exists, then call the panel's `show` and (for a viewer) the sketch overlay.
fn panel_body(&mut self, ui: &mut egui::Ui, p: PanelKind, rect: Rect) {
self.auto.add(&format!("panel.{}", p.id()), rect, p.title());
let mut content = rect.shrink(1.0);
@@@ -231,9 -404,14 +406,17 @@@
}
}
- /// Lay out and draw the workspace in `body`: the maximized panel or the dock tree, group chrome, active bodies
- /// and focus outline; then floating groups, their native panel windows, layout/action commands, tab drag-and-drop
- /// and the panel menu. Draws the Home screen instead when it is showing.
+ /// Whether floating panels' OS windows take no input: a dialog of the app's own or a
+ /// command's OS file dialog is up. egui's `Modal` blocks only the window it is in.
+ pub(crate) fn floats_blocked(&mut self, ctx: &egui::Context) -> bool {
+ let (focused, now) = ctx.input(|i| (i.focused || i.raw.viewports.values().any(|v| v.focused == Some(true)), i.time));
+ let file_dialog = self.file_dialogs.up(focused, now);
+ self.dialog.is_some() || panels::dialogs::modal_open(ctx) || file_dialog
+ }
+
++ /// Draw the Home screen or workspace in `body`. Shared craft-ui docking owns the dock tree,
++ /// group chrome, tab dragging and floating native windows; this adapter draws panel bodies,
++ /// applies the returned events/actions and shows the panel menu.
pub(crate) fn dock_area(&mut self, ui: &mut egui::Ui, body: Rect) {
let t = self.tokens;
let ctx = ui.ctx().clone();
diff --cc crates/ui-egui/src/lib.rs
index 2a39ea8ed,c21dfef1a..8e9c69fbf
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -853,9 -857,9 +862,9 @@@ impl EffectcraftApp
}
/// Show panel `p` (opening it in its usual place if it is closed), bring it to the front and
- /// give it the focus: Window ▸ <panel>.
+ /// give it the focus: Window ▸ `<panel>`.
pub fn show_panel(&mut self, p: PanelKind) {
- if !self.ui.floating.iter().any(|f| f.panels.contains(&p)) && self.ui.maximized.is_some_and(|m| m != p) {
+ if !self.ui.dock.is_floating(p) && self.ui.maximized.is_some_and(|m| m != p) {
self.ui.maximized = None;
}
self.raise_panel(p);
@@@ -2636,10 -2706,9 +2723,12 @@@ impl eframe::App for EffectcraftApp
}
}
+ /// Feed pending synthetic input into `raw_input` only once fonts are ready (so a non-drawing pass never consumes
+ /// a batch), then prepare pointer wrapping; ending a numeric scrub clears the history merge key so the next edit
+ /// starts a new undo step.
fn raw_input_hook(&mut self, ctx: &egui::Context, raw_input: &mut egui::RawInput) {
+ raw_input.events.append(&mut self.forwarded.events);
+ raw_input.dropped_files.append(&mut self.forwarded.files);
let injected = self.synthetic_in_flight || !self.synthetic.is_empty();
// Only a pass that can draw may receive synthetic input: `Context::run_ui` applies
// everything the hook feeds to its input state, so a pass that cannot draw (fonts still
diff --cc crates/ui-egui/src/panels/viewer_text.rs
index 3c5c04f9e,9a287b3ff..5fe55638e
--- a/crates/ui-egui/src/panels/viewer_text.rs
+++ b/crates/ui-egui/src/panels/viewer_text.rs
@@@ -269,8 -241,13 +269,15 @@@ pub(crate) fn begin_ui(ctx: &egui::Cont
ctx.data_mut(|data| data.remove::<ImeGeometry>(id));
}
+ /// Whether the text editor recorded its IME geometry in this pass of the current viewport.
+ pub(crate) fn ime_recorded(ctx: &egui::Context) -> bool {
+ let viewport = ctx.viewport_id();
+ let pass = ctx.cumulative_pass_nr_for(viewport);
+ ctx.data(|d| d.get_temp::<ImeGeometry>(ime_geometry_id(viewport))).is_some_and(|(p, _, _)| p == pass)
+ }
+
+/// Close a logic-only tick: when no full UI pass ran, revoke admission and resync and suspend the reset guard so a
+/// hidden tick never publishes IME state.
pub(crate) fn finish_logic(app: &EffectcraftApp, ctx: &egui::Context) {
let id = mode_id(ctx.viewport_id());
if !ctx.data(|data| data.get_temp::<bool>(id).unwrap_or(false)) {
@@@ -297,8 -272,6 +304,8 @@@ fn ime_preedit_id(viewport: egui::Viewp
fn ime_composition_id(viewport: egui::ViewportId) -> egui::Id {
egui::Id::unique(("viewer-text-ime-composition", viewport))
}
+/// The `egui::Id` under which the current pass number, text region and caret rectangle are stored for the
- /// pass-end finalizer.
++/// viewport IME publisher.
fn ime_geometry_id(viewport: egui::ViewportId) -> egui::Id {
egui::Id::unique(("viewer-text-ime-geometry", viewport))
}
@@@ -553,11 -508,11 +560,12 @@@ fn visible_preedit(ui: &egui::Ui, app:
(p.owner == owner && !p.text.is_empty()).then_some(p.text)
}
--/// Publish the settled descriptor for one completed viewport pass.
++/// Publish the descriptor from this viewport's current text state and recorded geometry.
///
--/// This runs at the very end of a root pass (after dock actions, ScriptUI, learn and dialogs)
--/// and at the end of each panel-window pass after that window's actions. The overlay only
--/// records geometry; it never publishes early with a snapshot that a later action can replace.
++/// The root viewport publishes after dock actions, ScriptUI, learn and dialogs. Native panel
++/// windows publish after the IME-owning body records geometry and again after their last body;
++/// publication can therefore precede later bodies in that window. The overlay only records
++/// geometry; this function resolves the current owner and availability when it publishes.
pub(crate) fn finish_ime(app: &mut EffectcraftApp, ui: &egui::Ui) {
let ctx = ui.ctx();
let viewport = ctx.viewport_id();
@@@ -1407,7 -1359,7 +1415,7 @@@ fn draw(app: &mut EffectcraftApp, ui: &
let rect = Rect::from_points(&quad);
app.auto.add("viewer.textEdit", rect, &format!("Editing {}", e.layer.name));
let cursor_rect = Rect::from_two_pos(sa, sb).expand2(vec2(1.0, 0.0));
-- // The outgoing IME descriptor is published by the pass-end finalizer, with this actual
++ // The viewport IME publisher uses this actual
// caret geometry and the edited layer's committed `TextDoc` (never the bidi or pre-edit
// display text). An available-empty document stays distinct from unavailable.
let viewport = ui.ctx().viewport_id();
diff --cc crates/ui-egui/src/state.rs
index 1e2f57204,0d69c45ce..88b8e7fa4
--- a/crates/ui-egui/src/state.rs
+++ b/crates/ui-egui/src/state.rs
@@@ -585,6 -577,11 +577,11 @@@ pub struct UiState
/// The panel maximized to fill the dock area (`~`), if any.
#[serde(default)]
pub maximized: Option<PanelKind>,
+ /// Floating windows of [`Self::dock`] whose native rect holds the OS window's outer
+ /// position, from a workspace file of an earlier version (see
- /// [`crate::dock_ui::native_outer_to_content`]). Workspaces are not saved while any remain.
++ /// `crate::dock_ui::native_outer_to_content`). Workspaces are not saved while any remain.
+ #[serde(skip)]
+ pub native_outer: Vec<u64>,
/// Locked Composition / Timeline tabs (panel ids): opening another composition does not
/// bring a locked panel forward (the tab's lock icon, as After Effects' viewer lock).
#[serde(default)]
diff --cc crates/ui-egui/tests/it/ui_preview_align.rs
index 2b2ba1b44,2b2ba1b44..1469a5e9e
--- a/crates/ui-egui/tests/it/ui_preview_align.rs
+++ b/crates/ui-egui/tests/it/ui_preview_align.rs
@@@ -279,21 -279,21 +279,25 @@@ fn playback_prefetches_past_the_cached_
std::thread::sleep(std::time::Duration::from_millis(2));
}
assert_eq!(h.state().frames.cached_frames(&series), (0..120).collect::<Vec<_>>());
++ // Rendering/instrumentation time must not move the playhead near the end of the
++ // cached run. Exercise real prefetch workers while holding playback in its first second.
++ h.state_mut().use_manual_clock();
h.state_mut().session.set_time(Tick::ZERO);
invoke(&mut h, "playback.toggle", json!({}));
++ h.state_mut().clock_mut().advance(0.25);
h.run_steps(2);
assert!(h.state().playback.playing);
let cur = h.state().session.time();
++ assert!(cur > Tick::ZERO, "playback advances with the manual clock");
assert!(cur < Tick::from_seconds_f64(1.0), "{cur:?}");
-- for _ in 0..4000 {
++ let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60);
++ while std::time::Instant::now() < deadline {
if h.state().frames.cached_frames(&series).iter().any(|&f| f >= 120) {
break;
}
h.step();
std::thread::sleep(std::time::Duration::from_millis(1));
-- if h.state().session.time() >= Tick::from_seconds_f64(1.0) {
-- break;
-- }
++ assert_eq!(h.state().session.time(), cur, "worker waits do not advance playback");
}
assert!(h.state().frames.cached_frames(&series).iter().any(|&f| f >= 120), "frames past the cached run render while it plays the first second");
}