mirror of
https://github.com/storytold/filmcraft.git
synced 2026-10-25 18:48:09 -06:00
Problem: `cargo xtask parity` (#781, #782) measured only the menu bar; the Effects panel's effects and transitions had no measured parity figure (docs/gaps.md G7). Fix: `--area effects|transitions` compares the catalogue the engine's effect definitions list in the Effects panel (new `effect_catalog` example in filmcraft-project, the panel's own top-folder filter) with a reference of folder paths or bare names (default the local, never committed plan/premiere/<area>.json). Same report, caps and `--min` as menus; placement by folder; Presets / Lumetri Presets and the other area's items are out of scope, so one panel snapshot serves both areas. `--area menus` (default) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.4 KiB
Rust
35 lines
1.4 KiB
Rust
//! Print FilmCraft's effect and transition catalog as the Effects panel lists it, as JSON: one
|
|
//! object per item with its `id`, display `name`, `kind` (`Video`, `Audio`, `VideoTransition`,
|
|
//! `AudioTransition`) and Effects-panel folder `path` (e.g. `["Video Effects", "Blur & Sharpen"]`).
|
|
//! Items with no Effects-panel folder (intrinsic Motion / Opacity / Volume…, graphic layers) and
|
|
//! the hidden obsolete transitions are left out, as in the panel (the same top-level folder filter
|
|
//! as `panels/effects.rs`). `cargo xtask parity --area effects|transitions` reads this to measure
|
|
//! coverage against a reference list.
|
|
//!
|
|
//! ```sh
|
|
//! cargo run -p filmcraft-project --example effect_catalog
|
|
//! ```
|
|
|
|
use std::process::ExitCode;
|
|
|
|
use filmcraft_project::vtransition::EFFECT_TOP_FOLDERS;
|
|
use serde_json::json;
|
|
|
|
fn main() -> ExitCode {
|
|
let items: Vec<serde_json::Value> = filmcraft_project::effect_defs()
|
|
.iter()
|
|
.filter(|d| d.category.first().is_some_and(|top| EFFECT_TOP_FOLDERS.contains(top)))
|
|
.map(|d| json!({"id": d.id, "name": d.name, "kind": format!("{:?}", d.kind), "path": d.category}))
|
|
.collect();
|
|
match serde_json::to_string_pretty(&items) {
|
|
Ok(text) => {
|
|
println!("{text}");
|
|
ExitCode::SUCCESS
|
|
}
|
|
Err(e) => {
|
|
eprintln!("effect_catalog: {e}");
|
|
ExitCode::FAILURE
|
|
}
|
|
}
|
|
}
|