diff --git a/Cargo.lock b/Cargo.lock index 2f964dd1..d940a183 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ dependencies = [ [[package]] name = "craft-xfl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93#7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" +source = "git+https://github.com/storytold/craft-libs?rev=bf48df0473a58c85e8bd050e23f97379dd902215#bf48df0473a58c85e8bd050e23f97379dd902215" dependencies = [ "craft-xml", "miniz_oxide 0.8.9", @@ -1329,7 +1329,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93#7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" +source = "git+https://github.com/storytold/craft-libs?rev=bf48df0473a58c85e8bd050e23f97379dd902215#bf48df0473a58c85e8bd050e23f97379dd902215" dependencies = [ "quick-xml 0.41.0", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3f16dfb0..2a757451 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,8 +32,8 @@ craft-audio = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" } craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" } craft-webp = { git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" } -craft-xfl = { git = "https://github.com/storytold/craft-libs", rev = "7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" } +craft-xfl = { git = "https://github.com/storytold/craft-libs", rev = "bf48df0473a58c85e8bd050e23f97379dd902215" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "bf48df0473a58c85e8bd050e23f97379dd902215" } # The GPU stage (ADR 0019) uses the wgpu that eframe's egui-wgpu brings, with the same # (default) features, so the tree keeps one wgpu build. wgpu = "30" diff --git a/crates/xfl/src/import.rs b/crates/xfl/src/import.rs index a669d2ff..9f43d3bd 100644 --- a/crates/xfl/src/import.rs +++ b/crates/xfl/src/import.rs @@ -23,6 +23,7 @@ use crate::edges::{self, Edge}; use crate::xml::{self, Element as X}; +use craft_xfl::filters::{Filter as NativeFilter, FilterKind as NativeFilterKind, FilterList as NativeFilterList, FilterSide as NativeFilterSide}; use anicraft_doc::{ Cap, Dash, Join, StrokeStyle, Bitmap, BitmapId, BlendMode, ColorEffect, ColorTransform, Filter, FilterEntry, FilterSide, Document, Easing, Element, ElementId, ElementKind, GradientStop, Keyframe, Layer, LayerId, LayerKind, LoopMode, Paint, Rgba, Shape, Stage, Stroke, Symbol, SymbolId, Scene, ShapeHint, SymbolKind, Timeline, Tween, TweenKind, CustomEase, EaseGroup, FrameScript, FrameSound, Language, Linkage, ScaleGrid, SoundSync, SourceScript, Spread, MAX_FOCAL, @@ -263,24 +264,31 @@ struct Builder<'a> { faces: HashMap, } -/// A bevel or gradient filter's `type`: `inner`, `outer` or `full` (`default` when missing). -fn filter_side(el: &X, default: FilterSide) -> FilterSide { - match el.attr("type").map(str::trim) { - Some("inner") => FilterSide::Inner, - Some("outer") => FilterSide::Outer, - Some("full") => FilterSide::Full, - _ => default, +/// Maps a neutral shared XFL filter side into the document model, applying the consumer's +/// established default when the wire value is absent or unknown. +fn filter_side(side: Option, default: FilterSide) -> FilterSide { + match side { + Some(NativeFilterSide::Inner) => FilterSide::Inner, + Some(NativeFilterSide::Outer) => FilterSide::Outer, + Some(NativeFilterSide::Full) => FilterSide::Full, + None => default, } } -/// A gradient filter's ramp: its `GradientEntry` children (directly, or in a wrapper), with -/// ratios 0..1 (or Flash's 0..255). -fn ramp(el: &X) -> Vec { - let entries = el.children.iter().flat_map(|c| if c.name == "GradientEntry" { std::slice::from_ref(c) } else { c.children.as_slice() }).filter(|g| g.name == "GradientEntry"); - let raw: Vec<(f32, Rgba)> = entries.take(anicraft_doc::MAX_RAMP_STOPS).map(|g| (g.f32("ratio").filter(|r| r.is_finite()).unwrap_or(0.0), color(g, "color", "alpha"))).collect(); +fn rgba(color: craft_xfl::shape::Color) -> Rgba { + Rgba::hex(color.rgb).with_alpha(color.alpha) +} + +/// Converts the neutral native ramp into AniCraft's sorted, normalized paint stops. +fn ramp(filter: &NativeFilter<'_, X>) -> Vec { + let raw: Vec<(f32, Rgba)> = filter + .ramp_entries() + .take(anicraft_doc::MAX_RAMP_STOPS) + .map(|entry| (entry.ratio().unwrap_or(0.0), rgba(entry.color()))) + .collect(); // One scale for the whole ramp: any ratio past 1 means bytes. - let scale = if raw.iter().any(|(r, _)| *r > 1.0) { 1.0 / 255.0 } else { 1.0 }; - let mut stops: Vec = raw.into_iter().map(|(r, c)| GradientStop { offset: (r * scale).clamp(0.0, 1.0), color: c }).collect(); + let scale = if raw.iter().any(|(ratio, _)| *ratio > 1.0) { 1.0 / 255.0 } else { 1.0 }; + let mut stops: Vec = raw.into_iter().map(|(ratio, color)| GradientStop { offset: (ratio * scale).clamp(0.0, 1.0), color }).collect(); stops.sort_by(|a, b| a.offset.total_cmp(&b.offset)); stops } @@ -493,50 +501,81 @@ impl<'a> Builder<'a> { /// are reported. fn filters(&mut self, el: &X) -> Vec { let mut out = Vec::new(); - for f in el.list("filters") { - let enabled = f.bool("enabled") != Some(false); - let num = |k: &str, d: f32| f.f32(k).unwrap_or(d); - let flag = |k: &str| f.bool(k).unwrap_or(false); - let quality = f.u32("quality").unwrap_or(1).clamp(1, 3) as u8; - let filter = match f.name.as_str() { - "BlurFilter" => Filter::Blur { blur_x: num("blurX", 5.0), blur_y: num("blurY", 5.0), quality }, - "DropShadowFilter" => Filter::DropShadow { - blur_x: num("blurX", 5.0), - blur_y: num("blurY", 5.0), - strength: num("strength", 1.0), + for f in NativeFilterList::new(el).iter() { + let enabled = f.enabled(); + let quality = f.quality(); + let num = |value: Option, default: f32| value.unwrap_or(default); + let flag = |value: Option| value.unwrap_or(false); + let filter = match f.kind() { + Some(NativeFilterKind::Blur) => Filter::Blur { blur_x: num(f.blur_x(), 5.0), blur_y: num(f.blur_y(), 5.0), quality }, + Some(NativeFilterKind::DropShadow) => Filter::DropShadow { + blur_x: num(f.blur_x(), 5.0), + blur_y: num(f.blur_y(), 5.0), + strength: num(f.strength(), 1.0), quality, - angle: num("angle", 45.0), - distance: num("distance", 4.0), - color: color(f, "color", "alpha"), - inner: flag("inner"), - knockout: flag("knockout"), - hide_object: flag("hideObject"), + angle: num(f.angle(), 45.0), + distance: num(f.distance(), 4.0), + color: rgba(f.color()), + inner: flag(f.inner()), + knockout: flag(f.knockout()), + hide_object: flag(f.hide_object()), }, - "GlowFilter" => Filter::Glow { blur_x: num("blurX", 5.0), blur_y: num("blurY", 5.0), strength: num("strength", 1.0), quality, color: color(f, "color", "alpha"), inner: flag("inner"), knockout: flag("knockout") }, - "AdjustColorFilter" => Filter::AdjustColor { brightness: num("brightness", 0.0), contrast: num("contrast", 0.0), saturation: num("saturation", 0.0), hue: num("hue", 0.0) }, - "BevelFilter" => Filter::Bevel { - blur_x: num("blurX", 5.0), - blur_y: num("blurY", 5.0), - strength: num("strength", 1.0), + Some(NativeFilterKind::Glow) => Filter::Glow { + blur_x: num(f.blur_x(), 5.0), + blur_y: num(f.blur_y(), 5.0), + strength: num(f.strength(), 1.0), quality, - angle: num("angle", 45.0), - distance: num("distance", 5.0), - shadow_color: color(f, "shadowColor", "shadowAlpha"), - highlight_color: if f.attr("highlightColor").is_some() { color(f, "highlightColor", "highlightAlpha") } else { Rgba::WHITE.with_alpha(num("highlightAlpha", 1.0).clamp(0.0, 1.0)) }, - side: filter_side(f, FilterSide::Inner), - knockout: flag("knockout"), + color: rgba(f.color()), + inner: flag(f.inner()), + knockout: flag(f.knockout()), }, - "GradientGlowFilter" | "GradientBevelFilter" => { - let glow = f.name == "GradientGlowFilter"; - let (blur_x, blur_y, strength, angle, distance, knockout) = (num("blurX", 5.0), num("blurY", 5.0), num("strength", 1.0), num("angle", 45.0), num("distance", 5.0), flag("knockout")); - let stops = ramp(f); - if glow { - Filter::GradientGlow { blur_x, blur_y, strength, quality, angle, distance, stops: if stops.is_empty() { anicraft_doc::default_glow_ramp() } else { stops }, side: filter_side(f, FilterSide::Outer), knockout } - } else { - Filter::GradientBevel { blur_x, blur_y, strength, quality, angle, distance, stops: if stops.is_empty() { anicraft_doc::default_bevel_ramp() } else { stops }, side: filter_side(f, FilterSide::Inner), knockout } + Some(NativeFilterKind::AdjustColor) => Filter::AdjustColor { + brightness: num(f.brightness(), 0.0), + contrast: num(f.contrast(), 0.0), + saturation: num(f.saturation(), 0.0), + hue: num(f.hue(), 0.0), + }, + Some(NativeFilterKind::Bevel) => Filter::Bevel { + blur_x: num(f.blur_x(), 5.0), + blur_y: num(f.blur_y(), 5.0), + strength: num(f.strength(), 1.0), + quality, + angle: num(f.angle(), 45.0), + distance: num(f.distance(), 5.0), + shadow_color: rgba(f.shadow_color()), + highlight_color: f.highlight_color().map(rgba).unwrap_or_else(|| Rgba::WHITE.with_alpha(num(f.highlight_alpha(), 1.0).clamp(0.0, 1.0))), + side: filter_side(f.side(), FilterSide::Inner), + knockout: flag(f.knockout()), + }, + Some(NativeFilterKind::GradientGlow) => { + let stops = ramp(&f); + Filter::GradientGlow { + blur_x: num(f.blur_x(), 5.0), + blur_y: num(f.blur_y(), 5.0), + strength: num(f.strength(), 1.0), + quality, + angle: num(f.angle(), 45.0), + distance: num(f.distance(), 5.0), + stops: if stops.is_empty() { anicraft_doc::default_glow_ramp() } else { stops }, + side: filter_side(f.side(), FilterSide::Outer), + knockout: flag(f.knockout()), } } - _ => { + Some(NativeFilterKind::GradientBevel) => { + let stops = ramp(&f); + Filter::GradientBevel { + blur_x: num(f.blur_x(), 5.0), + blur_y: num(f.blur_y(), 5.0), + strength: num(f.strength(), 1.0), + quality, + angle: num(f.angle(), 45.0), + distance: num(f.distance(), 5.0), + stops: if stops.is_empty() { anicraft_doc::default_bevel_ramp() } else { stops }, + side: filter_side(f.side(), FilterSide::Inner), + knockout: flag(f.knockout()), + } + } + None => { self.report.skip("unknown filters"); continue; } @@ -713,9 +752,10 @@ impl<'a> Builder<'a> { craft_xfl::document::TweenType::Motion | craft_xfl::document::TweenType::Shape => { let kind = if schema_frame.tween_type == craft_xfl::document::TweenType::Shape { TweenKind::Shape } else { TweenKind::Classic }; - let orient = f.bool("motionTweenOrientToPath").unwrap_or(false); + let native_tween = craft_xfl::tween::FrameTween::new(f); + let orient = native_tween.orient_to_path().unwrap_or(false); if kind == TweenKind::Classic - && f.attr("motionTweenRotate").is_some_and(|r| matches!(r.trim(), "clockwise" | "counter-clockwise")) + && native_tween.rotate().is_some_and(|r| matches!(r.trim(), "clockwise" | "counter-clockwise")) { self.report.skip("tween spins (turned the shortest way)"); } @@ -726,15 +766,16 @@ impl<'a> Builder<'a> { craft_xfl::document::TweenType::Other => {} } // Shape hints sit on both keyframes of a shape tween; they are paired up below. - if let Some(h) = f.child("shapeHints").filter(|h| !h.children.is_empty()) { - raw_hints.insert(start, self.raw_hints(h)); + let shape_hints = craft_xfl::shape_hints::ShapeHints::new(f); + if !shape_hints.is_empty() { + raw_hints.insert(start, self.raw_hints(f)); } // Frame scripts are kept verbatim (ADR 0013 tier 1); those in the subset run. if let Some(a) = f.child("Actionscript") { k.script = self.frame_script(a); } - if let Some(name) = f.attr("soundName").filter(|n| !n.trim().is_empty()) { - k.sound = self.frame_sound(f, name); + if craft_xfl::sound::FrameSound::new(f).name().is_some_and(|name| !name.trim().is_empty()) { + k.sound = self.frame_sound(f); } let mut els = Vec::new(); self.elements(f.list("elements"), &Affine::IDENTITY, &mut els, 0); @@ -784,21 +825,22 @@ impl<'a> Builder<'a> { /// `useSingleEaseCurve="false"` each property group (`position`, `rotation`, `scale`, /// `color`, `filters`) has its own curve, and `all` (or the slider) eases the rest. fn easing(&mut self, f: &X) -> (Easing, Vec<(EaseGroup, Easing)>) { - let acc = f.f32("acceleration").unwrap_or(0.0).clamp(-100.0, 100.0); + let native_tween = craft_xfl::tween::FrameTween::new(f); + let acc = native_tween.acceleration().unwrap_or(0.0).clamp(-100.0, 100.0); let classic = if acc == 0.0 { Easing::Linear } else { Easing::Classic(acc) }; - if f.bool("hasCustomEase") != Some(true) { + if native_tween.has_custom_ease() != Some(true) { return (classic, Vec::new()); } - let curves: Vec<&X> = f.list("tweens").iter().filter(|c| c.name == "CustomEase").collect(); + let curves: Vec<_> = native_tween.custom_eases().collect(); if curves.is_empty() { self.report.skip("custom eases without their curve (drawn with the simple ease)"); return (classic, Vec::new()); } - let single = f.bool("useSingleEaseCurve") != Some(false) || curves.len() == 1; + let single = native_tween.use_single_ease_curve() != Some(false) || curves.len() == 1; let mut main = None; let mut groups: Vec<(EaseGroup, Easing)> = Vec::new(); for (n, c) in curves.iter().enumerate() { - let target = c.attr("target").map_or("all", str::trim); + let target = c.target(); // One curve for everything: the first. if single && n > 0 { break; @@ -823,10 +865,10 @@ impl<'a> Builder<'a> { } /// One `` curve; `None` (reported) when its points don't make a curve. - fn ease_curve(&mut self, c: &X) -> Option { + fn ease_curve(&mut self, c: &craft_xfl::tween::CustomEase<'_, X>) -> Option { // Far more than a curve keeps (longer ones are thinned), and one more to tell. const MAX_READ: usize = anicraft_doc::MAX_EASE_POINTS * 3 * 16 + 1; - let pts: Vec = c.children.iter().filter(|p| p.name == "Point").take(MAX_READ + 1).map(|p| Vec2::new(p.f32("x").unwrap_or(0.0), p.f32("y").unwrap_or(0.0))).collect(); + let pts: Vec = c.points().take(MAX_READ + 1).map(|point| Vec2::new(point.x().unwrap_or(0.0), point.y().unwrap_or(0.0))).collect(); if pts.len() > MAX_READ { self.report.skip("custom ease curves too long to read (drawn with the simple ease)"); return None; @@ -853,25 +895,19 @@ impl<'a> Builder<'a> { /// `startX`/`startY`), and may carry its end point too (`endPoint`, or `endX`/`endY`); /// otherwise the end comes from the same hint on the next keyframe. Points are in pixels. /// The order is `index` (or a letter `name`), else the order in the file. - fn raw_hints(&mut self, list: &X) -> Vec { - let pt = |h: &X, joined: &str, x: &str, y: &str| -> Option { - let p = match h.attr(joined) { - Some(v) => { - let mut it = v.split([',', ' ']).filter(|s| !s.trim().is_empty()).map(|s| s.trim().parse::().ok()); - Vec2::new(it.next()??, it.next()??) - } - None => Vec2::new(h.f32(x)?, h.f32(y)?), - }; - (p.is_finite() && p.x.abs() < 1e6 && p.y.abs() < 1e6).then_some(p) + fn raw_hints(&mut self, frame: &X) -> Vec { + let hints = craft_xfl::shape_hints::ShapeHints::new(frame); + let to_vec = |point: Option| { + point.map(|point| Vec2::new(point.x, point.y)).filter(|point| point.x.abs() < 1e6 && point.y.abs() < 1e6) }; let mut out: Vec = Vec::new(); - for (n, h) in list.children.iter().enumerate().take(anicraft_doc::MAX_SHAPE_HINTS * 4) { - let order = h.u32("index").map(|i| i as usize).or_else(|| h.attr("name").and_then(anicraft_doc::hint_index)).unwrap_or(n); - let Some(here) = pt(h, "startPoint", "startX", "startY").or_else(|| pt(h, "point", "x", "y")) else { + for (n, hint) in hints.iter().enumerate().take(anicraft_doc::MAX_SHAPE_HINTS * 4) { + let order = hint.index().unwrap_or(n); + let Some(here) = to_vec(hint.start_point()) else { self.report.skip("shape hints without a position"); continue; }; - out.push(RawHint { order, here, end: pt(h, "endPoint", "endX", "endY") }); + out.push(RawHint { order, here, end: to_vec(hint.end_point()) }); } out.sort_by_key(|h| h.order); if out.len() > anicraft_doc::MAX_SHAPE_HINTS { @@ -1102,22 +1138,24 @@ impl<'a> Builder<'a> { /// start, stop or stream), repeats (`soundLoopMode` loop or repeat, `soundLoop` times) and /// effect (`soundEffect`, and the volume points of a custom one in `SoundEnvelope`). /// Buttons' frames included: they play as the pointer changes the button's state. - fn frame_sound(&mut self, f: &X, name: &str) -> Option { + fn frame_sound(&mut self, f: &X) -> Option { + let native = craft_xfl::sound::FrameSound::new(f); + let name = native.name()?; let Some(id) = self.sounds.get(name).copied() else { self.report.skip("frame sounds whose sound isn't in the package"); return None; }; let mut fs = FrameSound::new(id); - fs.sync = match f.attr("soundSync").map(str::trim) { - Some("start") => SoundSync::Start, - Some("stop") => SoundSync::Stop, - Some("stream") => SoundSync::Stream, - _ => SoundSync::Event, + fs.sync = match native.sync_mode() { + craft_xfl::sound::SyncMode::Start => SoundSync::Start, + craft_xfl::sound::SyncMode::Stop => SoundSync::Stop, + craft_xfl::sound::SyncMode::Stream => SoundSync::Stream, + craft_xfl::sound::SyncMode::Event => SoundSync::Event, }; - fs.looping = f.attr("soundLoopMode").map(str::trim) == Some("loop"); - fs.repeat = f.u32("soundLoop").unwrap_or(1).clamp(1, anicraft_doc::sound::MAX_REPEAT); - fs.effect = self.sound_effect(f); - if f.attr("inPoint44").is_some() || f.attr("outPoint44").is_some() { + fs.looping = native.looping(); + fs.repeat = native.repeat().unwrap_or(1).clamp(1, anicraft_doc::sound::MAX_REPEAT); + fs.effect = self.sound_effect(&native); + if native.has_in_point() || native.has_out_point() { self.report.skip("sound in and out points (played whole)"); } Some(fs) @@ -1127,8 +1165,8 @@ impl<'a> Builder<'a> { /// volume points of its envelope (`SoundEnvelope`; each `SoundEnvelopePoint` a time in /// samples at 44.1 kHz, `mark44`, and a level per channel, `level0` left and `level1` right, /// `0..=32768`, as the SWF format's `SOUNDENVELOPE` keeps them). - fn sound_effect(&mut self, f: &X) -> SoundEffect { - let key: String = f.attr("soundEffect").unwrap_or("").chars().filter(char::is_ascii_alphanumeric).map(|c| c.to_ascii_lowercase()).collect(); + fn sound_effect(&mut self, frame: &craft_xfl::sound::FrameSound<'_, X>) -> SoundEffect { + let key = frame.effect_key(); let preset = match key.as_str() { "" | "none" => Some(SoundEffect::None), "left" | "leftchannel" => Some(SoundEffect::LeftChannel), @@ -1139,14 +1177,12 @@ impl<'a> Builder<'a> { "fadeout" => Some(SoundEffect::FadeOut), _ => None, }; - let points: Vec = f - .child("SoundEnvelope") - .map(|e| e.children.iter().filter(|p| p.name == "SoundEnvelopePoint").take(anicraft_doc::sound::MAX_ENVELOPE_POINTS).collect::>()) - .unwrap_or_default() - .into_iter() - .map(|p| { - let level = |k: &str| p.f32(k).map_or(1.0, |v| v / 32_768.0); - EnvelopePoint::new(f64::from(p.f32("mark44").unwrap_or(0.0)) / 44_100.0, level("level0"), level("level1")) + let points: Vec = frame + .envelope_points() + .take(anicraft_doc::sound::MAX_ENVELOPE_POINTS) + .map(|point| { + let level = |value: Option| value.map_or(1.0, |value| value / 32_768.0); + EnvelopePoint::new(f64::from(point.mark44().unwrap_or(0.0)) / 44_100.0, level(point.level0()), level(point.level1())) }) .collect(); match preset { diff --git a/crates/xfl/src/tests.rs b/crates/xfl/src/tests.rs index 67c73580..dbc3952b 100644 --- a/crates/xfl/src/tests.rs +++ b/crates/xfl/src/tests.rs @@ -211,6 +211,17 @@ fn symbols_instances_and_the_tween_between_them() { assert!(x > 100.0 && x < 300.0, "{x}"); } +#[test] +fn bevel_filter_keeps_white_highlight_when_only_alpha_is_stored() { + let mut files = package(); + let document = Box::leak(DOC.replace("", "").into_boxed_str()); + files.insert("DOMDocument.xml", document); + let (doc, _) = import(&files).unwrap(); + let ElementKind::Symbol { filters, .. } = &doc.timeline(0).layers[0].keyframes[0].elements[0].kind else { panic!("a symbol instance") }; + let anicraft_doc::Filter::Bevel { highlight_color, .. } = filters[0].filter else { panic!("a bevel filter") }; + assert_eq!(highlight_color, Rgba::WHITE.with_alpha(0.4)); +} + #[test] fn shapes_become_fills_and_strokes() { let (doc, _) = import(&package()).unwrap(); diff --git a/docs/roadmap.md b/docs/roadmap.md index 64a84a17..971fe60c 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -16,7 +16,7 @@ milestone ends with a green tree: build, tests, clippy, a `--screenshot` check a | 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. **A window of its own on the desktop** (ADR 0062): sized to the stage at 100 % (smaller to fit the screen), titled with the document, back where it was last (not on Wayland, where the desktop places windows), with the keyboard when it opens; Esc or Ctrl+W (⌘W) closes it, Ctrl+Enter restarts it in place, and the editor's Ctrl/Alt shortcuts work from it; floating inside the editor in the web build, where the system can't open windows (it says so), or by choice in Preferences › Test Movie. Not yet: full screen, zoom in the movie window, remembering its size. 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; **filters and Subtract/Invert in the page** (ADR 0072: `filters.js`, a port of the renderer's filters run over the group's pixels on a layer that reaches past the canvas by the filters' reach, Subtract and Invert composited per pixel, results kept while the group is unchanged; equal to the oracle's pixels within 9.3e-4 in Boa; 3.4 ms a frame for the demo's filters at 1080p while they change); Web Audio for Event/Start/Stop/Stream sounds; bitmap tints, 9-slice scaling and plug-in frame scripts reported. Not yet: 9-slice in the page, keeping a moving filtered group's pixels, filters off the main thread. **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`; **ActionScript timeline subset runs** (ADR 0013 tier 2): a hand-written, bounded lexer and parser (`anicraft_actions::as3`) lower stop/play/go to/next and previous frame and scene on instance-name paths, mouse listeners (click, down, up, roll over and out; named or inline functions, `currentTarget`), `trace` and property settings to the action IR, compiled once per script; anything else is reported with line and column and the script doesn't run (never half-run), `navigateToURL` and the like are ignored and noted; the player keeps listeners per instance, Test Movie's Output says which scripts run and which don't and why, the Script view lists problems in place, the XFL report and `script.list/check` say what runs, and the HTML page runs the same steps (`player.js` checked against the Rust player). **ActionScript small logic** (ADR 0052): scripts compile to a small typed script IR evaluated by the player with fuel (100,000 per script or listener call, 1,000,000 per step; an endless loop or a run-time error stops its script with an Output line and the movie plays on): typed variables (Number, int, uint, Boolean, String, untyped) kept per timeline instance across its frame scripts, expressions as ECMA-262 has them, `if`/`else`, `for`/`while`/`do`, functions with parameters, results and recursion, called from any frame of the same timeline (a timeline-level link step; names that aren't there keep the script from running, said in place), property reads of instances and timelines (`x`, `y`, `alpha`, `visible`, `rotation`, `scaleX/Y`, `currentFrame`, `totalFrames`, `currentLabel`, `mouseX/Y`, `name`), `removeEventListener`, `Event.ENTER_FRAME`, `KeyboardEvent.KEY_DOWN/KEY_UP` on the stage with `e.keyCode`, `e.target`/`e.currentTarget`, seeded `Math.random()`; keyboard in Test Movie and the HTML page, `control.test_movie` key events and `seed`; `player.js` mirrors the evaluator, checked step by step in Boa. Not yet: ActionScript `switch`, `for in`, arrays and objects, string methods, closures, event bubbling, mouse listeners on the stage, ActionScript 1.0/2.0, 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. **Buttons, complete** (ADR 0057): a button open in place names its frames Up, Over, Down and Hit on the timeline and shows its Hit area translucent over the other states; Test Movie has **Show hit areas**; sounds on its frames play as its state changes. | | Headless | CLI: info, render, render-seq, **gif**, **apng**, **webp**, 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. | | Sound | **Audio layers, first slice** (ADR 0020): WAV (own reader), Ogg Vorbis (`lewton`) and MP3 (`nanomp3`) import, bounded and crash-proof; sounds live in the library, stored in `.anicraft` as imported, decoded once in the background. A sound belongs to a keyframe as in Animate (Properties › Sound: name, Sync Event/Start/Stop/Stream, Repeat ×N or Loop); Import to Stage puts one on a new layer spanning its length, Import to Library only adds it, the Library previews, places and deletes sounds. The timeline draws each sound's waveform over its span. Stage playback plays the mix through `cpal` (default feature `sound-output`) and the playhead follows the audio clock; stream sounds resync after a jump and scrubbing plays one-frame snippets. Mixing is pure and sample-exact (`doc::sound::voices` + `audio::mix`, Catmull-Rom resampling between rates). Headless: `sound.place/set/remove/rename/delete`, `file.import_to_library`, **`file.export_audio`** (WAV, 16/24-bit or float, any rate), and Export Video carries the soundtrack (Opus in WebM, AAC in MP4, by the user's ffmpeg). **Second slice** (ADR 0039): each frame sound has an **Effect** (None, Left channel, Right channel, Fade left to right, Fade right to left, Fade in, Fade out, shaped over the time it is heard, or **Custom**: up to 16 volume points per channel in the **Edit Envelope** window, drawn on each channel's waveform; the timeline's waveform follows the envelope). Layers holding sounds get a **Volume** and **Mute** (Properties, and a speaker toggle in the timeline); volumes multiply down through symbols and muted layers are silent in playback and every export. **Sounds inside symbols** play: a graphic's on its own frames mapped to the parent's time (loop mode and first frame apply; streams join mid-way and follow the parent playhead), a movie clip's on a loop from when the instance appeared; in the interactive player and **Test Movie** (which now has sound, the picture keeping time with it) movie clips start theirs as their own timelines reach them. The HTML page carries envelopes, volumes and graphic sounds. Headless: `sound.set {effect, envelope}`, `layer.set_volume`, `layer.toggle_mute`. **Sounds on button frames** (ADR 0057) play in Test Movie and the HTML page as the pointer changes the button's state (Over, Down, and Up and Hit on leaving and release, as the SWF format keeps them; never in the soundtrack); `control.test_movie` lists the sounds it starts. **XFL** brings sounds whose file is in the package (WAV, Ogg, MP3) with the sounds on frames that use them, buttons' included. **Output polish** (ADR 0095): the playhead follows the sound *heard* (the device's latency taken off, frames dropped rather than drifting; under a frame off over an hour in tests), event sounds play to their end across a loop and after the last frame (Enter stops all), a **monitor volume and mute** in the timeline header (Control › Mute Sounds; the listener's, in preferences, never in exports), **Control › Audio Scrubbing** (a slice of at least 1/20 s), a lost or missing device never crashes (silent playback, one notice, a log line, reopened on the next play; a new default device is followed), and the **web build plays sound through Web Audio**. The device sits behind an `Output` trait, so the clock and mixing paths are tested with a fake one. Not yet: sounds kept only in Animate's own data format (undocumented; reported), sound effects and in/out points from XFL, sound panning beyond the envelope, audio in Lottie, stream sounds that follow go-tos in the HTML page, lossless compression of stored WAVs, choosing an output device other than the system's default, `stopAllSounds` as a timeline action. | -| Files | `.anicraft` JSON load/save (v3, with scenes; v1 and v2 files open as one scene), PNG frame and sequence export, **animated GIF export** (parallel render and quantize, exact frame timing, looping), **animated PNG and animated WebP export** (ADR 0063: full colour and real alpha, transparent or on the stage colour; every frame exactly the renderer's; repeated frames merged into longer delays; later frames only the rectangle that changed (APNG blends opaque changes over, WebP replaces); APNG delays exact fractions of the frame rate, WebP milliseconds that never drift; loop forever, once or N times; File › Export, Publish Settings, the web build's downloads, `anicraft-cli apng`/`webp`; not yet: lossy WebP (no permissive pure-Rust VP8 encoder exists), dispose-to-background frames, palette or RGB APNG for smaller files), **SVG frame export** (from the same evaluated frame as the renderer: stage-space paths, renderer-matched stroke widths, caps, joins and dashes, gradients under `gradientTransform`, colour effects baked in, masks as nested `clipPath`s). **Opens Animate documents** (`.fla`, `.xfl`, XFL folders; ADR 0009; `.fla` archives in every common zip layout, ZIP64 included, and hostile ones refused with a readable error, ADR 0054): stage, first scene, layers, keyframes, labels, classic tweens with ease, shapes (solid/linear/radial fills, strokes), groups, primitives, symbol instances (matrix, alpha, tint, loop, blend mode, all seven filters), library symbols, **shape tweens**, **layer folders** and **mask layers** (masks inside folders too); imported files are untitled so Save never overwrites them; what isn't supported yet is reported after opening. One damaged bitmap, sound or library symbol is left out and reported rather than refusing the whole file (#226), and a document without a stage colour gets Animate's default white (#163). Every scene comes across. **Bitmaps**: library items whose image is in the package as PNG or JPEG (the original in `LIBRARY/`, else the `bin/` data file when it is PNG or JPEG), instances, and bitmap fills with their matrix (twips scale removed; repeating unless clipped); Animate's own bitmap encodings are not public and are reported, not decoded. **Text** (ADR 0014): static, dynamic and input text fields become text blocks laid out by `anicraft-text`, with face (by PostScript name, family, or the family the name suggests; `_sans`/`_serif`/`_typewriter`), size, colour, bold/italic, alignment, letter and line spacing, margins, matrix, fixed width (wraps) or auto-size, and several lines; runs in different styles become one block per run of same-style lines, stacked as in Animate; a line mixing styles takes its main style and is counted; missing families fall back and are named in the report; dynamic/input fields come across as static text (reported). **Shape hints** on shape tweens (a tolerant self-authored `shapeHints` reader, ADR 0023). Colour effects in every style (Brightness, Tint, Advanced, Alpha; ADR 0056), movie clip and button instance names, one-segment custom eases (as cubic Béziers); a symbol without `symbolType` is a movie clip; frame comments aren't labels. Stroke caps, joins and miter limit, dashed and dotted strokes (ADR 0046; ragged, stipple and hatched are drawn solid and reported). Reported rather than silently changed: gradient strokes, repeating/reflecting, focal-point, elliptical and linear-RGB gradients, reverse loop modes, extra tween spins. A self-authored corpus with golden renders covers all of it (ADR 0035). No per-character styles or motion tweens from XFL yet; **frame scripts are kept** verbatim (scenes and every symbol, with the language from the publish settings), with symbol linkage classes and the document class, and the report lists them as kept, not run (ADR 0013 tier 1; scripts on instances and linkage on bitmaps and sounds are reported); **Import to Stage (Ctrl+R) for SVG drawings**: editable shapes on a new layer at the playhead, with groups, use and symbols, transforms, viewBox, styles, opacity and gradients; **clip paths and opaque masks** (ADR 0021) become mask layers in a folder named after the file (clips that cut nothing dropped, clips inside clips intersected exactly when all but one are convex polygons, curves kept), and **text** becomes text blocks, one per text chunk (position, anchor, font family list, size, weight, style, letter spacing, fill), with missing fonts named; stroke caps, joins, miter limits and dashes come across (ADR 0046); soft masks, per-character positions and text on a path are reported, as is anything else unsupported. **Sprite sheet export**: movie frames on one PNG grid (parallel render, columns/padding/scale, transparent or stage background) with a "JSON hash" frame map (rectangles, sizes, per-frame durations). **Video export**: WebM (VP9) or MP4 (H.264) by streaming raw frames, in order and rendered in parallel batches, to the user's own ffmpeg (no encoder bundled; ffmpeg from a parameter, `ANICRAFT_FFMPEG` or the PATH; argument lists, never a shell). **Lottie export** (`file.export_lottie`): each frame is evaluated, artwork that persists (same layer and element, or the same look on the same layer across keyframes) becomes one shape layer, and what changes is written as **keyframes with Lottie's Bézier eases** (ADR 0089): holds where values stay, eased keys wherever an ease of the document draws the frames exactly (linear, Classic, Bézier, custom curves, Quad/Cubic/Back/Bounce; a key per cubic piece), checked at every frame, and a hold key per frame only where nothing exact exists (Elastic, Sine…, reported once); moving artwork keeps its outline in its own space under an animated group transform (position, rotation, skew, scale), and shape tweens between outlines of one structure are shape keys; a playback parity test plays the file with a Lottie player written from the spec through the oracle at every frame (sample scenes, a movie of every ease, the XFL corpus); files 57–90 % smaller (demo 46.7 → 10.4 kB); one layer order consistent with every frame (topological); checked against the reference web player (matches the renderer). Reported, not exported: bitmap fills, nested masks (innermost kept), group fades (per shape), stretched radial gradients (circles). **HTML canvas export** (`file.export_html`, ADR 0028): one self-contained web page that plays the movie, buttons and actions included (see Interactivity). **Drops, Open Recent and the start screen** (ADR 0059): files dropped on the window open (documents) or import onto the stage at the drop point on the active layer, or into the Library folder under the pointer, in one undo step (`file.drop`), with a drop highlight; File › Open Recent (10 recent, pinned favourites, missing files greyed with Remove) kept in the preferences; a start screen at launch with New presets (1280 × 720, 1920 × 1080, 1080 × 1080, 1080 × 1920, custom), Open, the sample and recent files with thumbnails captured on save. **Templates, SVG into the Library and drops on the timeline** (ADR 0065): six built-in templates made in code (banners 728 × 90 and 300 × 250, social square 1080 × 1080 at 30 fps, storyboard 16:9 panels, character turnaround, lip-sync mouth chart) with guides on a locked guide layer, on the start screen and File › New from Template; File › Save as Template keeps the document with a picture in the settings folder by category (replacing and deleting confirm); an SVG dropped on or imported to the Library becomes one graphic symbol named after the file, in the folder under the pointer; a sound dropped on a layer's frame goes onto that keyframe, an image or SVG onto that layer in a keyframe made there if needed, one undo step, with a highlight on the cell. Not yet: exact drop positions on the desktop (eframe 0.36 and 0.37 are on winit 0.30, which gives none during a drag; a drop waits for the first pointer move, else lands mid-view), user template descriptions and renaming, several documents at once. **Publish Settings and Publish** (ADR 0060): the formats to publish, with their options and output names, saved in the document; File › Publish (Shift+F12) writes them all in the background with progress, Cancel and one report; presets in Preferences. | +| Files | `.anicraft` JSON load/save (v3, with scenes; v1 and v2 files open as one scene), PNG frame and sequence export, **animated GIF export** (parallel render and quantize, exact frame timing, looping), **animated PNG and animated WebP export** (ADR 0063: full colour and real alpha, transparent or on the stage colour; every frame exactly the renderer's; repeated frames merged into longer delays; later frames only the rectangle that changed (APNG blends opaque changes over, WebP replaces); APNG delays exact fractions of the frame rate, WebP milliseconds that never drift; loop forever, once or N times; File › Export, Publish Settings, the web build's downloads, `anicraft-cli apng`/`webp`; not yet: lossy WebP (no permissive pure-Rust VP8 encoder exists), dispose-to-background frames, palette or RGB APNG for smaller files), **SVG frame export** (from the same evaluated frame as the renderer: stage-space paths, renderer-matched stroke widths, caps, joins and dashes, gradients under `gradientTransform`, colour effects baked in, masks as nested `clipPath`s). **Opens Animate documents** (`.fla`, `.xfl`, XFL folders; ADR 0009; `.fla` archives in every common zip layout, ZIP64 included, and hostile ones refused with a readable error, ADR 0054): stage, first scene, layers, keyframes, labels, classic tweens with ease, shapes (solid/linear/radial fills, strokes), groups, primitives, symbol instances (matrix, alpha, tint, loop, blend mode, all seven filters), library symbols, **shape tweens**, **layer folders** and **mask layers** (masks inside folders too); imported files are untitled so Save never overwrites them; what isn't supported yet is reported after opening. One damaged bitmap, sound or library symbol is left out and reported rather than refusing the whole file (#226), and a document without a stage colour gets Animate's default white (#163). Every scene comes across. **Bitmaps**: library items whose image is in the package as PNG or JPEG (the original in `LIBRARY/`, else the `bin/` data file when it is PNG or JPEG), instances, and bitmap fills with their matrix (twips scale removed; repeating unless clipped); Animate's own bitmap encodings are not public and are reported, not decoded. **Text** (ADR 0014): static, dynamic and input text fields become text blocks laid out by `anicraft-text`, with face (by PostScript name, family, or the family the name suggests; `_sans`/`_serif`/`_typewriter`), size, colour, bold/italic, alignment, letter and line spacing, margins, matrix, fixed width (wraps) or auto-size, and several lines; runs in different styles become one block per run of same-style lines, stacked as in Animate; a line mixing styles takes its main style and is counted; missing families fall back and are named in the report; dynamic/input fields come across as static text (reported). **Shape hints** on shape tweens (a tolerant self-authored `shapeHints` reader, ADR 0023). Colour effects in every style (Brightness, Tint, Advanced, Alpha; ADR 0056), movie clip and button instance names, one-segment custom eases (as cubic Béziers); a symbol without `symbolType` is a movie clip; frame comments aren't labels. Stroke caps, joins and miter limit, dashed and dotted strokes (ADR 0046; ragged, stipple and hatched are drawn solid and reported). Reported rather than silently changed: gradient strokes, repeating/reflecting, focal-point, elliptical and linear-RGB gradients, reverse loop modes, extra tween spins. A self-authored corpus with golden renders covers all of it (ADR 0035). Shared `craft-xfl` readers now parse filters, shape hints, tween easing, and frame-sound envelopes; AniCraft retains document-model mapping and validation. The XFL schema audit remains in progress, including per-character styles and motion-tween records; **frame scripts are kept** verbatim (scenes and every symbol, with the language from the publish settings), with symbol linkage classes and the document class, and the report lists them as kept, not run (ADR 0013 tier 1; scripts on instances and linkage on bitmaps and sounds are reported); **Import to Stage (Ctrl+R) for SVG drawings**: editable shapes on a new layer at the playhead, with groups, use and symbols, transforms, viewBox, styles, opacity and gradients; **clip paths and opaque masks** (ADR 0021) become mask layers in a folder named after the file (clips that cut nothing dropped, clips inside clips intersected exactly when all but one are convex polygons, curves kept), and **text** becomes text blocks, one per text chunk (position, anchor, font family list, size, weight, style, letter spacing, fill), with missing fonts named; stroke caps, joins, miter limits and dashes come across (ADR 0046); soft masks, per-character positions and text on a path are reported, as is anything else unsupported. **Sprite sheet export**: movie frames on one PNG grid (parallel render, columns/padding/scale, transparent or stage background) with a "JSON hash" frame map (rectangles, sizes, per-frame durations). **Video export**: WebM (VP9) or MP4 (H.264) by streaming raw frames, in order and rendered in parallel batches, to the user's own ffmpeg (no encoder bundled; ffmpeg from a parameter, `ANICRAFT_FFMPEG` or the PATH; argument lists, never a shell). **Lottie export** (`file.export_lottie`): each frame is evaluated, artwork that persists (same layer and element, or the same look on the same layer across keyframes) becomes one shape layer, and what changes is written as **keyframes with Lottie's Bézier eases** (ADR 0089): holds where values stay, eased keys wherever an ease of the document draws the frames exactly (linear, Classic, Bézier, custom curves, Quad/Cubic/Back/Bounce; a key per cubic piece), checked at every frame, and a hold key per frame only where nothing exact exists (Elastic, Sine…, reported once); moving artwork keeps its outline in its own space under an animated group transform (position, rotation, skew, scale), and shape tweens between outlines of one structure are shape keys; a playback parity test plays the file with a Lottie player written from the spec through the oracle at every frame (sample scenes, a movie of every ease, the XFL corpus); files 57–90 % smaller (demo 46.7 → 10.4 kB); one layer order consistent with every frame (topological); checked against the reference web player (matches the renderer). Reported, not exported: bitmap fills, nested masks (innermost kept), group fades (per shape), stretched radial gradients (circles). **HTML canvas export** (`file.export_html`, ADR 0028): one self-contained web page that plays the movie, buttons and actions included (see Interactivity). **Drops, Open Recent and the start screen** (ADR 0059): files dropped on the window open (documents) or import onto the stage at the drop point on the active layer, or into the Library folder under the pointer, in one undo step (`file.drop`), with a drop highlight; File › Open Recent (10 recent, pinned favourites, missing files greyed with Remove) kept in the preferences; a start screen at launch with New presets (1280 × 720, 1920 × 1080, 1080 × 1080, 1080 × 1920, custom), Open, the sample and recent files with thumbnails captured on save. **Templates, SVG into the Library and drops on the timeline** (ADR 0065): six built-in templates made in code (banners 728 × 90 and 300 × 250, social square 1080 × 1080 at 30 fps, storyboard 16:9 panels, character turnaround, lip-sync mouth chart) with guides on a locked guide layer, on the start screen and File › New from Template; File › Save as Template keeps the document with a picture in the settings folder by category (replacing and deleting confirm); an SVG dropped on or imported to the Library becomes one graphic symbol named after the file, in the folder under the pointer; a sound dropped on a layer's frame goes onto that keyframe, an image or SVG onto that layer in a keyframe made there if needed, one undo step, with a highlight on the cell. Not yet: exact drop positions on the desktop (eframe 0.36 and 0.37 are on winit 0.30, which gives none during a drag; a drop waits for the first pointer move, else lands mid-view), user template descriptions and renaming, several documents at once. **Publish Settings and Publish** (ADR 0060): the formats to publish, with their options and output names, saved in the document; File › Publish (Shift+F12) writes them all in the background with progress, Cancel and one report; presets in Preferences. | | Library | **Library management, first slice** (ADR 0050): nested **folders** (New Folder, rename, drag items and folders in and out, Move to; deleting a folder that holds items asks), **inline rename** (F2 or double-click the name; names unique per folder, case aside), **Duplicate Symbol** (fresh ids, same folder, “Ball copy”), **Swap Symbol** in Properties (keeps transform, colour effect, filters, looping and name), a **use count** column, **Select Unused Items** and **Delete Unused Items** (unused = not reachable from any scene; linkage classes count as used; asks first), deleting used items asks and removes their instances, fills and keyframe sounds, **sort** by name, type, use count or date added, **search** (opens the folders that lead to a match), multiple selection, a **preview** (a symbol's first frame from the oracle, a bitmap as smoothed or not, a sound's waveform with play) and **item properties** (symbol type and linkage class, bitmap **Allow Smoothing**, which the oracle, the GPU stage, SVG and HTML honour). Folders are a side table in the document (older files open flat); XFL import keeps folders and Allow Smoothing. Headless: `library.items/new_folder/rename/move/duplicate/delete/unused/delete_unused/set_smoothing`, `element.swap_symbol`. **Second slice** (ADR 0053): **drag items onto the stage** (symbols and bitmaps land at the pointer on the active layer at the playhead, sounds go onto its keyframe; several at once; one undo step; inside a symbol open for editing too), **Place on Stage** (button, right-click, or Enter) at the centre of the view, **Swap Bitmap** in Properties (a placed bitmap keeps its corner and takes the new size; a bitmap fill keeps its shape), a **Convert to Symbol** dialog with name, type and **folder** that offers the last folder and type again, and **"mixed" on every Properties row** for several elements (Scale, Rotation, Alpha, Symbol, Type, Filters, Blending, Looping, First frame, Fill, Bitmap, Stroke, Width, Style; each row compares only the elements it edits; editing a mixed row sets all, and Type sets every selected instance's symbol). Headless: `library.place {items, x, y}` (and `sound`), `element.swap_bitmap`, `kind` and `folder` on `modify.convert_to_symbol`. **9-slice scaling** (ADR 0055): Enable guides for 9-slice scaling on a symbol (Library or Properties). Scaled instances keep their corners, stretch their edges one way and the centre both ways, and strokes keep their width. Rotation and skew apply after; nested symbols, text and bitmaps scale normally. Guides are dragged as dashed lines while editing the symbol in place, or typed in Properties. The CPU, GPU, SVG and Lottie output all show it, and XFL `scaleGrid*` attributes are imported; guides switched off are kept and come back when switched on (ADR 0057). Not yet: 9-slice in HTML canvas export (scaled as a whole and reported), guides in Library previews, snapping guides. Not yet: shared libraries and importing items from another document, linkage on bitmaps and sounds, bitmap compression, dropping files from the desktop, a picture of the item while dragging, Swap Bitmap on a Library item (every use), mixed text style rows, a Colour Effect row with tint. | | Find & navigation | **Find and Replace, and the Movie Explorer, first slice** (ADR 0058): Edit › Find and Replace (Ctrl+F) finds text (text fields, frame labels, layer and instance names, frame scripts; match case, whole word, regular expressions on a linear-time engine), fonts, colours, symbols, sounds and bitmaps, in this scene with its symbols or the whole document; results as you type; F3 / Shift+F3 go there, opening symbols in place; Replace, and Replace All as one undo step that asks above 100 places. Window › Movie Explorer (Alt+F3), beside the Library: scenes › layers › keyframes › instances (into their symbols), text, sounds, bitmaps and scripts, symbol definitions, Show filters and search, double-click to go there. Headless `find.search`, `find.replace`, `find.goto`, `explorer.tree`. Not yet: action parameters, ActionScript strings apart from code, font size and style, colour tolerance, renaming in the explorer. | | Tests | 133 tests (adds point editing, closed-path anchors, curve fitting, pen/pencil/subselection commands, the Pen's path data, frame ranges, keyframe moves, range confirmations, frame selection and the frame clipboard): unit, analytic render, band/determinism, robustness fuzz over all commands, round trip (v1 and v2 files), structural sharing and history budget, render-service equivalence, confirmations, clipboard, transforms and align, GIF decode and timing, free-transform maths, UI-guideline enforcement, CLI. | @@ -118,6 +118,10 @@ Next, in order: ~~every scene~~ ✅, ~~bitmaps~~ ✅ (PNG/JPEG data), ~~text~~ ✅ (one style per line; per-character styles with the text model), motion tweens, and ~~a larger self-authored corpus checked by render tests~~ ✅ (ADR 0035). + - Shared wire-schema work in progress: filters, shape hints, tweens/eases and frame-sound + envelopes now read through craft-libs views; AniCraft keeps validation and mapping into its + document models. Audit any remaining native document wire parsing before declaring the + full XFL format cutover complete. 2. ~~SVG import~~ ✅ and ~~SVG frame export~~ ✅, ~~text, clip paths and masks (onto mask layers)~~ ✅ (ADR 0021). ~~dashes~~ ✅ (ADR 0046). ~~soft masks (luminance and alpha), text on a path (`textPath`) and per-character positions where simple~~ ✅ (ADR 0070). Next for SVG: booleans between two curved clips, multi-line blocks from stacked chunks, images and style sheets. ## Risks