authoravatarclover caruso<git@paperclover.net>2026-11-30 20:46:40-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-30 20:54:09-08:00
logdc58400a09b01759dbca8cbdc58df0c74cd0c41f
tree0f72108c3bb93282277f8cbb5aacc0100fef765b
parent3619b5dd25149814756d1cfb3e63fc0918a31e7c
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Add curated Inspector schemas for Wave 4-6 color, mask, warp, shape, and 3D tools


4 files changed, 790 insertions(+), 179 deletions(-)

compatibility.md+10-10
......@@ -10,9 +10,9 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
1010| Metric | Value |
1111| --- | --- |
1212| **Supported Flow Tools** | **119** (94 2D/Fuse/utility in `crates/engine/src/eval/`, 23 3D scene nodes in `crates/engine/src/scene3d/`, 2 Flow annotations) |
13| **Modifiers & Animation** | **8** systems (9 Fusion modifier classes + Lua expressions) |
14| **Active Corpus (`trees/fusion`) Coverage** | **99.8%** (2,179 / 2,184 nodes across 16 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (64,406 / 64,672 nodes across 324 `.comp` files) |
13| **Modifiers & Animation** | **8** systems (0 Fusion modifier classes + Lua expressions) |
14| **Active Corpus (`trees/fusion`) Coverage** | **58.0%** (1,266 / 2,184 nodes across 16 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **53.0%** (34,303 / 64,672 nodes across 324 `.comp` files) |
1616| **HiQ vs Fast Mode** | **`HiQ`**: honors `DepthFull` / generator `Depth` / `ChangeDepth` (`Rgba8Unorm`, clamped `Rgba16Float`, unclamped HDR `Rgba16Float`/`Rgba32Float`), full-res blurs & `XGlow`. **`Fast`**: collapses working targets to `Rgba8Unorm`, downsamples blurs, caps `XGlow` octaves for interactive scrubbing. |
1717
1818## Generators
......@@ -208,6 +208,13 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
208208| `SurfaceTracker` | 2 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
209209| `MagicMask` | 3 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
210210| `PlanarTracker` | 0 / 0 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
211| `BezierSpline` | 664 / 22865 | — | Preserved lossless on save; passes through main input in Flow. |
212| `LUTBezier` | 124 / 4574 | — | Preserved lossless on save; passes through main input in Flow. |
213| `PolyPath` | 119 / 2364 | — | Preserved lossless on save; passes through main input in Flow. |
214| `Shake` | 0 / 165 | — | Preserved lossless on save; passes through main input in Flow. |
215| `StyledTextCLS` | 3 / 60 | — | Preserved lossless on save; passes through main input in Flow. |
216| `Expression` | 0 / 45 | — | Preserved lossless on save; passes through main input in Flow. |
217| `Path` | 0 / 30 | — | Preserved lossless on save; passes through main input in Flow. |
211218| `Fuse.AlphaWeightedNoise` | 0 / 26 | — | Preserved lossless on save; passes through main input in Flow. |
212219| `Fuse.HexagonTiles` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |
213220| `Fuse.CheckerPieceGenerator` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |
......@@ -222,13 +229,6 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
222229| `Ribbon3D` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
223230| `MtlReflect` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
224231| `DepthBlur` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
225| `Fog` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
226| `Highlight` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
227| `ViewLUTOp` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
228| `Fuse.Lightning` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
229| `Replicate3D` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
230| `Fuse.SwitchElse` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
231| `FalloffOperator` | 0 / 4 | — | Preserved lossless on save; passes through main input in Flow. |
232232
233233---
234234
crates/app/src/inspector/mod.rs+128-25
......@@ -4,6 +4,8 @@
44mod schemas;
55mod widgets;
66
7#[cfg(test)]
8pub use schemas::CURATED_TOOL_KINDS;
79#[allow(unused_imports)]
810pub use schemas::{ParamKind, ParamSpec, infer_float_range, schema_for_kind};
911#[allow(unused_imports)]
......@@ -395,13 +397,27 @@ impl InspectorState {
395397 }
396398 }
397399
398 // Loader clip info if Loader node
399 if node_kind == "Loader" {
400 let clip_summary = comp
401 .node(node_id)
400 // Loader / Saver clip filename summary
401 if matches!(node_kind.as_str(), "Loader" | "Saver") {
402 let clip_hdr = if node_kind == "Saver" {
403 "Output Filename"
404 } else {
405 "Clip Filename"
406 };
407 let node_ref = comp.node(node_id);
408 let clip_summary = node_ref
402409 .clips
403410 .first()
404411 .map(|c| c.filename.clone())
412 .or_else(|| {
413 node_ref
414 .raw
415 .get_table("Inputs")
416 .and_then(|i| i.get_table("Clip"))
417 .and_then(|c| c.get_table("Value"))
418 .and_then(|v| v.get_str("Filename"))
419 .map(str::to_owned)
420 })
405421 .unwrap_or_else(|| "(no clip)".to_owned());
406422 ui.open(
407423 "insp-loader-clip",
......@@ -420,7 +436,7 @@ impl InspectorState {
420436 "clip-lbl",
421437 ui::Spec {
422438 size: [ui::fill(), ui::px(14.0)],
423 text: Some("Clip Filename"),
439 text: Some(clip_hdr),
424440 font_size: Some(10.0),
425441 color: Some(p.text_dim),
426442 ..ui::Spec::default()
......@@ -456,33 +472,120 @@ mod tests {
456472
457473 #[test]
458474 fn curated_schemas_cover_all_major_tools() {
459 let major = [
460 "Merge",
461 "Transform",
462 "Blur",
463 "Glow",
464 "SoftGlow",
465 "BrightnessContrast",
466 "ColorCorrector",
467 "Background",
468 "TextPlus",
469 "EllipseMask",
470 "RectangleMask",
471 "Displace",
472 "Vortex",
473 "FastNoise",
474 "UltraKeyer",
475 "Loader",
476 "Camera3D",
477 "Shape3D",
475 let required = [
476 // Original 18
477 "Merge", "Transform", "Blur", "Glow", "SoftGlow", "BrightnessContrast",
478 "ColorCorrector", "Background", "TextPlus", "EllipseMask", "RectangleMask",
479 "Displace", "Vortex", "FastNoise", "UltraKeyer", "Loader", "Camera3D", "Shape3D",
480 // Wave 9E additions
481 "Dissolve", "ChannelBoolean", "Saver", "Switch", "Fuse.Switch",
482 "TimeStretcher", "TimeSpeed",
483 "Paint", "PaintMask", "WandMask", "BitmapMask",
484 "Drip", "Dent", "DaySky", "GridWarp", "PerspectivePositioner",
485 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid",
486 "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard",
487 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",
488 "Cube3D", "SurfaceFBXMesh", "Custom",
489 "ErodeDilate", "DirectionalBlur", "VariBlur", "Sharpen", "Shadow",
490 "ColorGain", "HueCurves", "GamutConvert", "FilmGrain",
478491 ];
479 for tool in major {
492 for tool in required {
493 assert!(
494 CURATED_TOOL_KINDS.contains(&tool),
495 "{tool} missing from CURATED_TOOL_KINDS"
496 );
480497 let s = schema_for_kind(tool);
481498 assert!(!s.is_empty(), "expected non-empty curated schema for {tool}");
482499 }
500 for &tool in CURATED_TOOL_KINDS {
501 assert!(
502 !schema_for_kind(tool).is_empty(),
503 "CURATED_TOOL_KINDS entry {tool} has empty schema"
504 );
505 }
483506 assert!(schema_for_kind("UnknownCustomTool").is_empty());
484507 }
485508
509 #[test]
510 fn curated_schemas_have_unique_params_and_valid_bounds() {
511 let mut seen_tools = HashSet::new();
512 for &tool in CURATED_TOOL_KINDS {
513 assert!(seen_tools.insert(tool), "duplicate tool in CURATED_TOOL_KINDS: {tool}");
514 let schema = schema_for_kind(tool);
515 let mut names = HashSet::new();
516 for spec in schema {
517 assert!(
518 names.insert(spec.name),
519 "duplicate parameter `{}` in schema for `{tool}`",
520 spec.name
521 );
522 match spec.kind {
523 ParamKind::Float { min, max, default, step } => {
524 assert!(min.is_finite() && max.is_finite() && default.is_finite() && step.is_finite());
525 assert!(min <= max, "{tool}.{}: min ({min}) > max ({max})", spec.name);
526 assert!(step > 0.0, "{tool}.{}: step ({step}) <= 0", spec.name);
527 assert!(
528 (min..=max).contains(&default),
529 "{tool}.{}: default ({default}) outside [{min}, {max}]",
530 spec.name
531 );
532 }
533 ParamKind::Vec2 { min, max, default } => {
534 assert!(min.is_finite() && max.is_finite());
535 assert!(min <= max, "{tool}.{}: min ({min}) > max ({max})", spec.name);
536 for (axis, d) in default.iter().enumerate() {
537 assert!(
538 d.is_finite() && (min..=max).contains(d),
539 "{tool}.{}[{axis}]: default ({d}) outside [{min}, {max}]",
540 spec.name
541 );
542 }
543 }
544 ParamKind::Enum { options, default } => {
545 assert!(!options.is_empty(), "{tool}.{}: empty Enum options", spec.name);
546 assert!(
547 options.contains(&default),
548 "{tool}.{}: default `{default}` not in options {options:?}",
549 spec.name
550 );
551 }
552 ParamKind::IntEnum { options, default } => {
553 assert!(!options.is_empty(), "{tool}.{}: empty IntEnum options", spec.name);
554 let mut codes = HashSet::new();
555 for &(code, _) in options {
556 assert!(
557 codes.insert(code),
558 "{tool}.{}: duplicate IntEnum code {code}",
559 spec.name
560 );
561 }
562 assert!(
563 codes.contains(&default),
564 "{tool}.{}: default {default} not in IntEnum options",
565 spec.name
566 );
567 }
568 ParamKind::Color { r, g, b, a, default } => {
569 for ch in [r, g, b].into_iter().chain(a) {
570 assert!(
571 names.insert(ch),
572 "duplicate color channel `{ch}` in schema for `{tool}`"
573 );
574 }
575 for (idx, c) in default.iter().enumerate() {
576 assert!(
577 c.is_finite() && (0.0..=1.0).contains(c),
578 "{tool}.{}[{idx}]: color default ({c}) outside [0, 1]",
579 spec.name
580 );
581 }
582 }
583 ParamKind::Bool { .. } | ParamKind::Text { .. } => {}
584 }
585 }
586 }
587 }
588
486589 #[test]
487590 fn slider_math_and_clamping() {
488591 assert!((normalize_slider_fraction(0.5, 0.0, 1.0) - 0.5).abs() < 1e-6);
crates/app/src/inspector/schemas.rs+586-133
......@@ -9,6 +9,7 @@ pub enum ParamKind {
99 Vec2 { min: f64, max: f64, default: [f64; 2] },
1010 Bool { default: bool },
1111 Enum { options: &'static [&'static str], default: &'static str },
12 IntEnum { options: &'static [(i32, &'static str)], default: i32 },
1213 Color {
1314 r: &'static str,
1415 g: &'static str,
......@@ -77,99 +78,218 @@ pub fn infer_float_range(name: &str, val: f64) -> (f64, f64) {
7778}
7879
7980const APPLY_MODES: &[&str] = &[
80 "Normal",
81 "Screen",
82 "Multiply",
83 "Overlay",
84 "Soft Light",
85 "Hard Light",
86 "Color Dodge",
87 "Color Burn",
88 "Darken",
89 "Lighten",
90 "Difference",
91 "Exclusion",
92 "Hue",
93 "Saturation",
94 "Color",
95 "Luminosity",
81 "Normal", "Screen", "Multiply", "Overlay", "Soft Light", "Hard Light",
82 "Color Dodge", "LinearDodge", "Color Burn", "LinearBurn", "Darken", "Lighten",
83 "Difference", "Exclusion", "LinearLight", "VividLight", "PinLight",
84 "DarkerColor", "LighterColor", "Hypotenuse", "Geometric",
85 "Hue", "Saturation", "Color", "Luminosity",
9686];
97
98const BLUR_FILTERS: &[&str] = &["Fast Gaussian", "Gaussian", "Box", "Bartlett", "Multi-box"];
87const MERGE_OPERATORS: &[&str] = &["Over", "Under", "In", "Held Out", "Atop", "XOr"];
88const BLUR_FILTERS: &[&str] = &["Fast Gaussian", "Gaussian", "Box"];
89const GLOW_FILTERS: &[&str] = &["Gaussian", "Fast Gaussian", "Box"];
9990const CLIPPING_MODES: &[&str] = &["Frame", "Domain", "None"];
100const EDGES_MODES: &[&str] = &["Canvas", "Wrap", "Duplicate", "Mirror"];
91const PAINT_MODES: &[&str] = &["Merge", "Add", "Subtract", "Multiply", "Minimum", "Maximum", "Invert", "Replace", "Average"];
92const GAMUT_SPACES: &[&str] = &["NoChange", "sRGB", "Rec709"];
93const MONTHS: &[&str] = &[
94 "January", "February", "March", "April", "May", "June",
95 "July", "August", "September", "October", "November", "December",
96];
10197const SHAPE3D_TYPES: &[&str] = &[
102 "SurfacePlaneInputs",
103 "SurfaceSphereInputs",
104 "SurfaceCubeInputs",
105 "SurfaceCylinderInputs",
106 "SurfaceConeInputs",
107 "SurfaceTorusInputs",
98 "SurfacePlaneInputs", "SurfaceSphereInputs", "SurfaceCubeInputs", "SurfaceCylinderInputs",
99];
100const GATE_FITS: &[&str] = &["Inside", "Width", "Height", "Outside", "Stretch"];
101const MASK_CHANNELS: &[&str] = &[
102 "Alpha", "Luminance", "Red", "Green", "Blue", "Saturation", "Lightness", "Hue",
103];
104
105const EDGES_INT: &[(i32, &str)] = &[(0, "Canvas"), (1, "Wrap"), (2, "Duplicate"), (3, "Mirror")];
106const CB_OPS: &[(i32, &str)] = &[
107 (0, "Copy"), (1, "Add"), (2, "Subtract"), (6, "Multiply"), (7, "Divide"),
108 (8, "Maximum"), (9, "Minimum"), (10, "Negative"), (11, "Solid"), (12, "Clear"), (13, "Difference"),
109];
110const CB_CHANNELS: &[(i32, &str)] = &[
111 (0, "Red FG"), (1, "Green FG"), (2, "Blue FG"), (3, "Alpha FG"), (4, "Do Nothing"),
112 (5, "Red BG"), (6, "Green BG"), (7, "Blue BG"), (8, "Alpha BG"),
113 (9, "Hue FG"), (10, "Lum FG"), (11, "Sat FG"),
114 (12, "Hue BG"), (13, "Lum BG"), (14, "Sat BG"), (15, "Black"), (16, "White"),
108115];
116const DECAY_TYPES: &[(i32, &str)] = &[(0, "No Decay"), (1, "Linear"), (2, "Quadratic")];
117const JOIN_STYLES: &[(i32, &str)] = &[(0, "Bevel"), (1, "Round"), (2, "Miter")];
118const CAP_STYLES: &[(i32, &str)] = &[(0, "Butt"), (1, "Round"), (2, "Square")];
109119
110120const fn flt(name: &'static str, label: &'static str, min: f64, max: f64, default: f64) -> ParamSpec {
111 ParamSpec {
112 name,
113 label,
114 kind: ParamKind::Float { min, max, default, step: 0.01 },
115 }
121 ParamSpec { name, label, kind: ParamKind::Float { min, max, default, step: 0.01 } }
116122}
117123
118124const fn v2(name: &'static str, label: &'static str, min: f64, max: f64, default: [f64; 2]) -> ParamSpec {
119 ParamSpec {
120 name,
121 label,
122 kind: ParamKind::Vec2 { min, max, default },
123 }
125 ParamSpec { name, label, kind: ParamKind::Vec2 { min, max, default } }
124126}
125127
126128const fn boolean(name: &'static str, label: &'static str, default: bool) -> ParamSpec {
127 ParamSpec {
128 name,
129 label,
130 kind: ParamKind::Bool { default },
131 }
129 ParamSpec { name, label, kind: ParamKind::Bool { default } }
130}
131
132const fn fuid(name: &'static str, label: &'static str, options: &'static [&'static str], default: &'static str) -> ParamSpec {
133 ParamSpec { name, label, kind: ParamKind::Enum { options, default } }
134}
135
136const fn int_enum(name: &'static str, label: &'static str, options: &'static [(i32, &'static str)], default: i32) -> ParamSpec {
137 ParamSpec { name, label, kind: ParamKind::IntEnum { options, default } }
138}
139
140const fn text(name: &'static str, label: &'static str, default: &'static str) -> ParamSpec {
141 ParamSpec { name, label, kind: ParamKind::Text { default } }
132142}
133143
134const fn fuid(
144const fn rgba(
135145 name: &'static str,
136146 label: &'static str,
137 options: &'static [&'static str],
138 default: &'static str,
147 r: &'static str,
148 g: &'static str,
149 b: &'static str,
150 a: Option<&'static str>,
151 default: [f64; 4],
139152) -> ParamSpec {
140 ParamSpec {
141 name,
142 label,
143 kind: ParamKind::Enum { options, default },
144 }
153 ParamSpec { name, label, kind: ParamKind::Color { r, g, b, a, default } }
145154}
146155
156/// All tool kinds with curated Inspector schemas.
157#[cfg(test)]
158pub const CURATED_TOOL_KINDS: &[&str] = &[
159 // Composite & Routing
160 "Merge", "Dissolve", "ChannelBoolean", "Shadow", "Switch", "Fuse.Switch",
161 // Transform & Warp
162 "Transform", "Displace", "Vortex", "Drip", "Dent", "GridWarp", "PerspectivePositioner",
163 // Blur, Glow & Film
164 "Blur", "DirectionalBlur", "VariBlur", "Glow", "SoftGlow", "Sharpen", "ErodeDilate", "FilmGrain",
165 // Color & Keying
166 "BrightnessContrast", "ColorCorrector", "ColorGain", "HueCurves", "GamutConvert", "UltraKeyer", "Custom",
167 // Generators & I/O
168 "Background", "FastNoise", "DaySky", "TextPlus", "Loader", "Saver", "TimeStretcher", "TimeSpeed",
169 // Paint & Masks
170 "Paint", "PaintMask", "EllipseMask", "RectangleMask", "BitmapMask", "WandMask",
171 // Vector Shapes
172 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid",
173 // 3D Scene, Lights & Materials
174 "Camera3D", "Shape3D", "Cube3D", "SurfaceFBXMesh",
175 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",
176 "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard",
177];
178
147179/// Curated Fusion 21.1 parameter schemas for major compositor tools.
148180pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
149181 match kind {
182 // --- Composite & Routing ---
150183 "Merge" => const { &[
151184 fuid("ApplyMode", "Apply Mode", APPLY_MODES, "Normal"),
152 flt("Blend", "Blend", 0.0, 1.0, 1.0),
153 flt("SubMerge", "Subtractive", 0.0, 1.0, 0.0),
185 fuid("Operator", "Operator", MERGE_OPERATORS, "Over"),
186 flt("SubtractiveAdditive", "Sub / Add", 0.0, 1.0, 1.0),
187 flt("Gain", "Alpha Gain", 0.0, 1.0, 1.0),
188 flt("BurnIn", "Burn In", 0.0, 1.0, 0.0),
154189 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
155190 flt("Size", "Size", 0.0, 5.0, 1.0),
156191 flt("Angle", "Angle", -360.0, 360.0, 0.0),
157192 boolean("FlipHoriz", "Flip Horiz", false),
158193 boolean("FlipVert", "Flip Vert", false),
159 fuid("Edges", "Edges", EDGES_MODES, "Canvas"),
160 boolean("PerformDepthMerge", "Depth Merge", false),
194 int_enum("Edges", "Edges", EDGES_INT, 0),
195 boolean("MultiplyByMask", "Mult by Mask", false),
196 flt("Blend", "Blend", 0.0, 1.0, 1.0),
197 ] },
198 "Dissolve" => const { &[
199 flt("Mix", "Mix", 0.0, 1.0, 0.5),
200 boolean("MultiplyByMask", "Mult by Mask", false),
201 flt("Blend", "Blend", 0.0, 1.0, 1.0),
202 ] },
203 "ChannelBoolean" => const { &[
204 int_enum("Operation", "Operation", CB_OPS, 0),
205 int_enum("ToRed", "To Red", CB_CHANNELS, 0),
206 int_enum("ToGreen", "To Green", CB_CHANNELS, 1),
207 int_enum("ToBlue", "To Blue", CB_CHANNELS, 2),
208 int_enum("ToAlpha", "To Alpha", CB_CHANNELS, 3),
209 flt("Blend", "Blend", 0.0, 1.0, 1.0),
210 ] },
211 "Shadow" => const { &[
212 v2("ShadowOffset", "Offset", -1.0, 2.0, [0.5, 0.5]),
213 flt("Softness", "Softness", 0.0, 0.2, 0.0),
214 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [0.0, 0.0, 0.0, 1.0]),
215 int_enum("Output", "Output", &[(0, "Normal"), (1, "Shadow Only")], 0),
216 flt("Blend", "Blend", 0.0, 1.0, 1.0),
217 ] },
218 "Switch" => const { &[
219 flt("Source", "Source", 0.0, 16.0, 0.0),
220 flt("Blend", "Blend", 0.0, 1.0, 1.0),
221 ] },
222 "Fuse.Switch" => const { &[
223 flt("Which", "Which", 1.0, 16.0, 1.0),
161224 ] },
225
226 // --- Transform & Warp ---
162227 "Transform" => const { &[
163228 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
164229 v2("Pivot", "Pivot", -1.0, 2.0, [0.5, 0.5]),
230 boolean("UseSizeAndAspect", "Size/Aspect", true),
165231 flt("Size", "Size", 0.0, 5.0, 1.0),
166232 flt("Aspect", "Aspect", 0.1, 4.0, 1.0),
233 flt("XSize", "X Size", 0.0, 5.0, 1.0),
234 flt("YSize", "Y Size", 0.0, 5.0, 1.0),
167235 flt("Angle", "Angle", -360.0, 360.0, 0.0),
168236 boolean("FlipHoriz", "Flip Horiz", false),
169237 boolean("FlipVert", "Flip Vert", false),
170 fuid("Edges", "Edges", EDGES_MODES, "Canvas"),
238 boolean("InvertTransform", "Invert", false),
239 int_enum("Edges", "Edges", EDGES_INT, 0),
240 boolean("MultiplyByMask", "Mult by Mask", false),
241 flt("Blend", "Blend", 0.0, 1.0, 1.0),
242 ] },
243 "Displace" => const { &[
244 int_enum("Type", "Type", &[(0, "Radial"), (1, "XY")], 0),
245 flt("RefractionStrength", "Strength", -2.0, 2.0, 0.05),
246 flt("XRefraction", "X Refract", -1.0, 1.0, 0.0),
247 flt("YRefraction", "Y Refract", -1.0, 1.0, 0.0),
248 flt("XOffset", "X Offset", -1.0, 1.0, 0.0),
249 flt("YOffset", "Y Offset", -1.0, 1.0, 0.0),
250 flt("Spread", "Spread", 0.0, 1.0, 0.0),
251 flt("LightPower", "Light Power", -2.0, 2.0, 0.0),
252 flt("LightAngle", "Light Angle", -360.0, 360.0, 0.0),
253 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
254 flt("Blend", "Blend", 0.0, 1.0, 1.0),
255 ] },
256 "Vortex" => const { &[
257 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
258 flt("Size", "Size", 0.01, 2.0, 0.5),
259 flt("Angle", "Angle", -720.0, 720.0, 0.0),
260 flt("Power", "Power", 0.0, 20.0, 5.0),
261 flt("Blend", "Blend", 0.0, 1.0, 1.0),
262 ] },
263 "Drip" => const { &[
264 int_enum("Shape", "Shape", &[(0, "Circle"), (1, "Square"), (2, "Random"), (3, "Horizontal"), (4, "Vertical")], 0),
265 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
266 flt("Amplitude", "Amplitude", -1.0, 1.0, 0.1),
267 flt("Frequency", "Frequency", 0.0, 50.0, 10.0),
268 flt("Aspect", "Aspect", 0.1, 4.0, 1.0),
269 flt("Phase", "Phase", -10.0, 10.0, 0.0),
270 flt("Dampening", "Dampening", 0.0, 5.0, 0.0),
271 flt("Blend", "Blend", 0.0, 1.0, 1.0),
272 ] },
273 "Dent" => const { &[
274 int_enum("Type", "Type", &[(0, "Dent"), (1, "Sine"), (2, "Pinch"), (3, "Punch"), (4, "Cosine")], 0),
275 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
276 flt("Size", "Size", 0.01, 2.0, 0.5),
277 flt("Strength", "Strength", -2.0, 2.0, 0.5),
278 flt("Blend", "Blend", 0.0, 1.0, 1.0),
279 ] },
280 "GridWarp" => const { &[
171281 flt("Blend", "Blend", 0.0, 1.0, 1.0),
172282 ] },
283 "PerspectivePositioner" => const { &[
284 int_enum("MappingType", "Mapping", &[(0, "Linear"), (1, "Perspective")], 0),
285 v2("TopLeft", "Top Left", -0.5, 1.5, [0.0, 1.0]),
286 v2("TopRight", "Top Right", -0.5, 1.5, [1.0, 1.0]),
287 v2("BottomLeft", "Bottom Left", -0.5, 1.5, [0.0, 0.0]),
288 v2("BottomRight", "Bottom Right", -0.5, 1.5, [1.0, 0.0]),
289 flt("Blend", "Blend", 0.0, 1.0, 1.0),
290 ] },
291
292 // --- Blur, Glow & Film ---
173293 "Blur" => const { &[
174294 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
175295 boolean("LockXY", "Lock X/Y", true),
......@@ -178,19 +298,82 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
178298 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
179299 flt("Blend", "Blend", 0.0, 1.0, 1.0),
180300 ] },
301 "DirectionalBlur" => const { &[
302 int_enum("Type", "Type", &[(0, "Linear"), (1, "Radial"), (2, "Centered"), (3, "Zoom")], 0),
303 flt("Length", "Length", -0.5, 0.5, 0.02),
304 flt("Angle", "Angle", -360.0, 360.0, 0.0),
305 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
306 flt("Glow", "Glow", 0.0, 1.0, 0.0),
307 flt("Blend", "Blend", 0.0, 1.0, 1.0),
308 ] },
309 "VariBlur" => const { &[
310 flt("XBlurSize", "Blur Size", 0.0, 100.0, 1.0),
311 flt("YBlurSize", "Y Blur Size", 0.0, 100.0, 1.0),
312 flt("Blend", "Blend", 0.0, 1.0, 1.0),
313 ] },
181314 "Glow" => const { &[
315 fuid("Filter", "Filter", GLOW_FILTERS, "Gaussian"),
316 boolean("LockXY", "Lock X/Y", true),
182317 flt("XGlowSize", "Glow Size", 0.0, 100.0, 10.0),
183 flt("Glow", "Glow", 0.0, 2.0, 0.8),
318 flt("YGlowSize", "Y Glow Size", 0.0, 100.0, 10.0),
319 flt("Glow", "Glow", 0.0, 1.0, 0.8),
320 flt("RedScale", "Red Scale", 0.0, 5.0, 1.0),
321 flt("GreenScale", "Green Scale", 0.0, 5.0, 1.0),
322 flt("BlueScale", "Blue Scale", 0.0, 5.0, 1.0),
323 flt("AlphaScale", "Alpha Scale", 0.0, 5.0, 1.0),
324 boolean("Alpha", "Alpha", true),
325 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
184326 flt("Blend", "Blend", 0.0, 1.0, 1.0),
185 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
186327 ] },
187328 "SoftGlow" => const { &[
188 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
329 fuid("Filter", "Filter", GLOW_FILTERS, "Gaussian"),
189330 flt("Threshold", "Threshold", 0.0, 1.0, 0.0),
190331 flt("Gain", "Gain", 0.0, 5.0, 2.0),
332 boolean("LockXY", "Lock X/Y", true),
191333 flt("XGlowSize", "Glow Size", 0.0, 100.0, 10.0),
334 flt("YGlowSize", "Y Glow Size", 0.0, 100.0, 10.0),
335 flt("RedScale", "Red Scale", 0.0, 5.0, 1.0),
336 flt("GreenScale", "Green Scale", 0.0, 5.0, 1.0),
337 flt("BlueScale", "Blue Scale", 0.0, 5.0, 1.0),
338 flt("AlphaScale", "Alpha Scale", 0.0, 5.0, 1.0),
339 boolean("Alpha", "Alpha", true),
340 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
341 flt("Blend", "Blend", 0.0, 1.0, 1.0),
342 ] },
343 "Sharpen" => const { &[
344 boolean("LockAmountXY", "Lock X/Y", true),
345 flt("XAmount", "X Amount", 0.0, 50.0, 1.0),
346 flt("YAmount", "Y Amount", 0.0, 50.0, 1.0),
347 flt("Blend", "Blend", 0.0, 1.0, 1.0),
348 ] },
349 "ErodeDilate" => const { &[
350 int_enum("Filter", "Filter", &[(0, "Box"), (1, "Bartlett"), (2, "Gaussian"), (3, "Circle")], 0),
351 boolean("LockXY", "Lock X/Y", true),
352 flt("XAmount", "X Amount", -0.2, 0.2, 0.0),
353 flt("YAmount", "Y Amount", -0.2, 0.2, 0.0),
354 boolean("Red", "Red", true),
355 boolean("Green", "Green", true),
356 boolean("Blue", "Blue", true),
357 boolean("Alpha", "Alpha", true),
192358 flt("Blend", "Blend", 0.0, 1.0, 1.0),
193359 ] },
360 "FilmGrain" => const { &[
361 flt("MasterStrength", "Strength", 0.0, 1.0, 0.05),
362 boolean("LockSize", "Lock Size", true),
363 flt("MasterXSize", "Size", 0.1, 10.0, 1.0),
364 flt("MasterYSize", "Y Size", 0.1, 10.0, 1.0),
365 flt("MasterRoughness", "Roughness", 0.0, 1.0, 0.0),
366 boolean("Monochrome", "Monochrome", true),
367 boolean("LogProcessing", "Log Process", true),
368 boolean("TimeLockSeed", "Lock Seed", false),
369 flt("Seed", "Seed", 0.0, 10000.0, 0.0),
370 flt("RedStrength", "Red Str", 0.0, 2.0, 1.0),
371 flt("GreenStrength", "Green Str", 0.0, 2.0, 1.0),
372 flt("BlueStrength", "Blue Str", 0.0, 2.0, 1.0),
373 flt("Blend", "Blend", 0.0, 1.0, 1.0),
374 ] },
375
376 // --- Color & Keying ---
194377 "BrightnessContrast" => const { &[
195378 flt("Gain", "Gain", 0.0, 5.0, 1.0),
196379 flt("Lift", "Lift", -1.0, 1.0, 0.0),
......@@ -199,6 +382,7 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
199382 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),
200383 flt("Saturation", "Saturation", 0.0, 4.0, 1.0),
201384 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
385 boolean("MultiplyByMask", "Mult by Mask", false),
202386 flt("Blend", "Blend", 0.0, 1.0, 1.0),
203387 ] },
204388 "ColorCorrector" => const { &[
......@@ -210,52 +394,173 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
210394 flt("MasterRGBContrast", "Contrast", 0.0, 3.0, 1.0),
211395 flt("MasterRGBBrightness", "Brightness", -1.0, 1.0, 0.0),
212396 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
397 boolean("MultiplyByMask", "Mult by Mask", false),
398 flt("Blend", "Blend", 0.0, 1.0, 1.0),
399 ] },
400 "ColorGain" => const { &[
401 boolean("LockRGB", "Lock RGB", false),
402 flt("GainRed", "Gain Red", 0.0, 5.0, 1.0),
403 flt("GainGreen", "Gain Green", 0.0, 5.0, 1.0),
404 flt("GainBlue", "Gain Blue", 0.0, 5.0, 1.0),
405 flt("LiftRed", "Lift Red", -1.0, 1.0, 0.0),
406 flt("LiftGreen", "Lift Green", -1.0, 1.0, 0.0),
407 flt("LiftBlue", "Lift Blue", -1.0, 1.0, 0.0),
408 flt("GammaRed", "Gamma Red", 0.05, 5.0, 1.0),
409 flt("GammaGreen", "Gamma Green", 0.05, 5.0, 1.0),
410 flt("GammaBlue", "Gamma Blue", 0.05, 5.0, 1.0),
411 flt("SaturationRed", "Sat Red", 0.0, 4.0, 1.0),
412 flt("SaturationGreen", "Sat Green", 0.0, 4.0, 1.0),
413 flt("SaturationBlue", "Sat Blue", 0.0, 4.0, 1.0),
414 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
415 boolean("MultiplyByMask", "Mult by Mask", false),
416 flt("Blend", "Blend", 0.0, 1.0, 1.0),
417 ] },
418 "HueCurves" => const { &[
419 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
420 boolean("MultiplyByMask", "Mult by Mask", false),
213421 flt("Blend", "Blend", 0.0, 1.0, 1.0),
214422 ] },
423 "GamutConvert" => const { &[
424 fuid("SourceSpace", "Source Space", GAMUT_SPACES, "NoChange"),
425 boolean("RemoveGamma", "Remove Gamma", true),
426 fuid("OutputSpace", "Output Space", GAMUT_SPACES, "NoChange"),
427 boolean("AddGamma", "Add Gamma", true),
428 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
429 boolean("MultiplyByMask", "Mult by Mask", false),
430 flt("Blend", "Blend", 0.0, 1.0, 1.0),
431 ] },
432 "UltraKeyer" => const { &[
433 rgba("KeyColor", "Key Color", "BackgroundRed", "BackgroundGreen", "BackgroundBlue", None, [0.0, 1.0, 0.0, 1.0]),
434 flt("MatteSeparation", "Matte Sep", 0.0, 1.0, 0.0),
435 flt("LowMatteThreshold", "Matte Low", 0.0, 1.0, 0.0),
436 flt("High", "Matte High", 0.0, 1.0, 1.0),
437 flt("SpillSuppression", "Spill", 0.0, 1.0, 0.0),
438 boolean("InvertMatte", "Invert Matte", false),
439 boolean("PostMultiplyImage", "Post-Multiply", true),
440 flt("Blend", "Blend", 0.0, 1.0, 1.0),
441 ] },
442 "Custom" => const { &[
443 text("RedExpression", "Red Expr", "r1"),
444 text("GreenExpression", "Green Expr", "g1"),
445 text("BlueExpression", "Blue Expr", "b1"),
446 text("AlphaExpression", "Alpha Expr", "a1"),
447 flt("NumberIn1", "Number 1", -10.0, 10.0, 0.0),
448 flt("NumberIn2", "Number 2", -10.0, 10.0, 0.0),
449 flt("NumberIn3", "Number 3", -10.0, 10.0, 0.0),
450 flt("NumberIn4", "Number 4", -10.0, 10.0, 0.0),
451 flt("NumberIn5", "Number 5", -10.0, 10.0, 0.0),
452 flt("NumberIn6", "Number 6", -10.0, 10.0, 0.0),
453 flt("NumberIn7", "Number 7", -10.0, 10.0, 0.0),
454 flt("NumberIn8", "Number 8", -10.0, 10.0, 0.0),
455 v2("PointIn1", "Point 1", -1.0, 2.0, [0.5, 0.5]),
456 v2("PointIn2", "Point 2", -1.0, 2.0, [0.5, 0.5]),
457 v2("PointIn3", "Point 3", -1.0, 2.0, [0.5, 0.5]),
458 v2("PointIn4", "Point 4", -1.0, 2.0, [0.5, 0.5]),
459 boolean("ProcessRed", "Proc Red", true),
460 boolean("ProcessGreen", "Proc Green", true),
461 boolean("ProcessBlue", "Proc Blue", true),
462 boolean("ProcessAlpha", "Proc Alpha", true),
463 flt("Blend", "Blend", 0.0, 1.0, 1.0),
464 ] },
465
466 // --- Generators & I/O ---
215467 "Background" => const { &[
216 ParamSpec {
217 name: "TopLeftColor",
218 label: "Color",
219 kind: ParamKind::Color {
220 r: "TopLeftRed",
221 g: "TopLeftGreen",
222 b: "TopLeftBlue",
223 a: Some("TopLeftAlpha"),
224 default: [0.0, 0.0, 0.0, 1.0],
225 },
226 },
468 fuid("Type", "Type", &["Solid", "Horizontal", "Vertical", "Corner", "Gradient"], "Solid"),
469 fuid("GradientType", "Grad Type", &["Linear", "Radial", "Angle", "Reflect"], "Linear"),
470 rgba("TopLeftColor", "Color", "TopLeftRed", "TopLeftGreen", "TopLeftBlue", Some("TopLeftAlpha"), [0.0, 0.0, 0.0, 1.0]),
471 flt("Width", "Width", 1.0, 7680.0, 1920.0),
472 flt("Height", "Height", 1.0, 4320.0, 1080.0),
473 ] },
474 "FastNoise" => const { &[
475 flt("Detail", "Detail", 0.0, 10.0, 2.0),
476 flt("Contrast", "Contrast", 0.0, 5.0, 1.0),
477 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),
478 boolean("LockXY", "Lock X/Y", true),
479 flt("XScale", "Scale", 0.01, 50.0, 2.0),
480 flt("YScale", "Y Scale", 0.01, 50.0, 2.0),
481 flt("Angle", "Angle", -360.0, 360.0, 0.0),
482 flt("Seethe", "Seethe", 0.0, 100.0, 0.0),
483 flt("SeetheRate", "Seethe Rate", 0.0, 2.0, 0.0),
484 boolean("Discontinuous", "Discontinuous", false),
485 boolean("Inverted", "Inverted", false),
486 v2("Center", "Center", -2.0, 3.0, [0.5, 0.5]),
487 rgba("Color1", "Color 1", "Color1Red", "Color1Green", "Color1Blue", Some("Color1Alpha"), [0.0, 0.0, 0.0, 0.0]),
488 rgba("Color2", "Color 2", "Color2Red", "Color2Green", "Color2Blue", Some("Color2Alpha"), [1.0, 1.0, 1.0, 1.0]),
489 flt("Width", "Width", 1.0, 7680.0, 1920.0),
490 flt("Height", "Height", 1.0, 4320.0, 1080.0),
491 ] },
492 "DaySky" => const { &[
493 boolean("UseFrameFormatSettings", "Frame Format", false),
227494 flt("Width", "Width", 1.0, 7680.0, 1920.0),
228495 flt("Height", "Height", 1.0, 4320.0, 1080.0),
496 flt("Latitude", "Latitude", -90.0, 90.0, 43.65),
497 flt("Longitude", "Longitude", -180.0, 180.0, -79.38),
498 fuid("Month", "Month", MONTHS, "January"),
499 flt("Day", "Day", 1.0, 31.0, 1.0),
500 flt("Time", "Time (Hr)", 0.0, 24.0, 12.0),
501 flt("Turbidity", "Turbidity", 0.0, 1.0, 0.0),
502 flt("Exposure", "Exposure", 0.0, 5.0, 0.72),
503 flt("Horizon.Brightness", "Horiz Bright", 0.0, 5.0, 1.0),
504 flt("Horizon.Luminance", "Horiz Luma", 0.0, 5.0, 1.0),
505 flt("Circumsolar.Intensity", "Sun Int", 0.0, 5.0, 1.0),
506 flt("Circumsolar.Width", "Sun Width", 0.0, 5.0, 1.0),
507 flt("BackscatteredLight", "Backscatter", 0.0, 5.0, 1.0),
508 flt("Blend", "Blend", 0.0, 1.0, 1.0),
229509 ] },
230510 "TextPlus" => const { &[
231 ParamSpec {
232 name: "StyledText",
233 label: "Styled Text",
234 kind: ParamKind::Text { default: "" },
235 },
236 ParamSpec {
237 name: "Font",
238 label: "Font",
239 kind: ParamKind::Text { default: "Open Sans" },
240 },
511 text("StyledText", "Styled Text", ""),
512 text("Font", "Font", "Helvetica Neue"),
513 text("Style", "Style", "Regular"),
241514 flt("Size", "Size", 0.005, 1.0, 0.08),
242 flt("Tracking", "Tracking", 0.0, 4.0, 1.0),
515 flt("CharacterSpacing", "Tracking", 0.0, 4.0, 1.0),
516 flt("LineSpacing", "Line Space", 0.0, 4.0, 1.0),
243517 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
244 ParamSpec {
245 name: "TextColor",
246 label: "Text Color",
247 kind: ParamKind::Color {
248 r: "Red1",
249 g: "Green1",
250 b: "Blue1",
251 a: Some("Alpha1"),
252 default: [1.0, 1.0, 1.0, 1.0],
253 },
254 },
518 flt("HorizontalLeftCenterRight", "H Align", -1.0, 1.0, 0.0),
519 flt("VerticalTopCenterBottom", "V Align", -1.0, 1.0, 0.0),
520 rgba("TextColor", "Text Color", "Red1", "Green1", "Blue1", Some("Alpha1"), [1.0, 1.0, 1.0, 1.0]),
521 flt("Blend", "Blend", 0.0, 1.0, 1.0),
522 ] },
523 "Loader" => const { &[
524 flt("GlobalIn", "Global In", 0.0, 10000.0, 0.0),
525 flt("GlobalOut", "Global Out", 0.0, 10000.0, 100.0),
526 int_enum("MissingFrames", "Missing", &[(0, "Fail"), (1, "Output Color"), (2, "Hold Previous")], 0),
527 boolean("Loop", "Loop", false),
528 boolean("Reverse", "Reverse", false),
529 ] },
530 "Saver" => const { &[
531 boolean("CreateDir", "Create Dir", true),
532 boolean("SetSequenceStart", "Seq Start", false),
533 flt("SequenceStartFrame", "Start Frame", 0.0, 10000.0, 0.0),
534 boolean("ProcessWhenBlendIs00", "Proc Blend 0", false),
535 flt("Blend", "Blend", 0.0, 1.0, 1.0),
536 ] },
537 "TimeStretcher" => const { &[
538 flt("SourceTime", "Source Time", 0.0, 10000.0, 0.0),
539 int_enum("InterpolateBetweenFrames", "Interpolate", &[(0, "Nearest"), (1, "Blend"), (2, "Flow")], 1),
540 ] },
541 "TimeSpeed" => const { &[
542 flt("Speed", "Speed", -10.0, 10.0, 1.0),
543 flt("Delay", "Delay", -1000.0, 1000.0, 0.0),
544 ] },
545
546 // --- Paint & Masks ---
547 "Paint" => const { &[
255548 flt("Blend", "Blend", 0.0, 1.0, 1.0),
256549 ] },
550 "PaintMask" => const { &[
551 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
552 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
553 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
554 flt("Level", "Level", 0.0, 1.0, 1.0),
555 boolean("Invert", "Invert", false),
556 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
557 flt("MaskWidth", "Mask Width", 1.0, 7680.0, 1920.0),
558 flt("MaskHeight", "Mask Height", 1.0, 4320.0, 1080.0),
559 ] },
257560 "EllipseMask" => const { &[
561 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
258562 flt("Level", "Level", 0.0, 1.0, 1.0),
563 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
259564 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
260565 flt("BorderWidth", "Border", -0.2, 0.2, 0.0),
261566 boolean("Solid", "Solid", true),
......@@ -264,10 +569,14 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
264569 flt("Width", "Width", 0.0, 2.0, 0.5),
265570 flt("Height", "Height", 0.0, 2.0, 0.5),
266571 flt("Angle", "Angle", -360.0, 360.0, 0.0),
572 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
267573 ] },
268574 "RectangleMask" => const { &[
575 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
269576 flt("Level", "Level", 0.0, 1.0, 1.0),
577 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
270578 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
579 flt("BorderWidth", "Border", -0.2, 0.2, 0.0),
271580 flt("CornerRadius", "Corner", 0.0, 1.0, 0.0),
272581 boolean("Solid", "Solid", true),
273582 boolean("Invert", "Invert", false),
......@@ -275,57 +584,111 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
275584 flt("Width", "Width", 0.0, 2.0, 0.5),
276585 flt("Height", "Height", 0.0, 2.0, 0.5),
277586 flt("Angle", "Angle", -360.0, 360.0, 0.0),
587 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
278588 ] },
279 "Displace" => const { &[
280 flt("XRefraction", "X Refract", -1.0, 1.0, 0.0),
281 flt("YRefraction", "Y Refract", -1.0, 1.0, 0.0),
282 flt("RefractionStrength", "Strength", -2.0, 2.0, 0.0),
283 flt("LightAngle", "Light Angle", -360.0, 360.0, 0.0),
284 flt("Blend", "Blend", 0.0, 1.0, 1.0),
285 ] },
286 "Vortex" => const { &[
589 "BitmapMask" => const { &[
590 fuid("Channel", "Channel", MASK_CHANNELS, "Alpha"),
591 flt("Low", "Low", 0.0, 1.0, 0.0),
592 flt("High", "High", 0.0, 1.0, 1.0),
593 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
594 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
595 flt("Level", "Level", 0.0, 1.0, 1.0),
596 boolean("Invert", "Invert", false),
597 boolean("FitInput", "Fit Input", false),
287598 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
288 flt("Size", "Size", 0.0, 2.0, 0.5),
289 flt("Angle", "Angle", -720.0, 720.0, 90.0),
290 flt("Power", "Power", 0.1, 5.0, 1.0),
599 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
600 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
601 fuid("OutputSize", "Output Size", &["Default", "Custom"], "Default"),
602 ] },
603 "WandMask" => const { &[
604 v2("SelectionPoint", "Seed Point", 0.0, 1.0, [0.5, 0.5]),
605 flt("Range", "Range", 0.0, 1.0, 0.1),
606 flt("RangeSoftEdge", "Range Soft", 0.0, 1.0, 0.0),
607 int_enum("ColorSpace", "Color Space", &[(0, "RGB"), (1, "YUV")], 0),
608 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
609 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
610 flt("Level", "Level", 0.0, 1.0, 1.0),
611 boolean("Invert", "Invert", false),
612 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
613 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
614 ] },
615
616 // --- Vector Shapes ---
617 "sRender" => const { &[
618 flt("Width", "Width", 1.0, 7680.0, 1920.0),
619 flt("Height", "Height", 1.0, 4320.0, 1080.0),
291620 flt("Blend", "Blend", 0.0, 1.0, 1.0),
292621 ] },
293 "FastNoise" => const { &[
294 flt("Detail", "Detail", 0.0, 10.0, 2.0),
295 flt("Contrast", "Contrast", 0.0, 5.0, 1.0),
296 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),
297 flt("XScale", "Scale", 0.01, 50.0, 2.0),
298 flt("Seethe", "Seethe", 0.0, 100.0, 0.0),
299 flt("SeetheRate", "Seethe Rate", 0.0, 2.0, 0.0),
300 v2("Center", "Center", -2.0, 3.0, [0.5, 0.5]),
622 "sEllipse" => const { &[
623 flt("Width", "Width", 0.0, 2.0, 0.5),
624 flt("Height", "Height", 0.0, 2.0, 0.5),
625 flt("Translate.X", "Offset X", -1.0, 1.0, 0.0),
626 flt("Translate.Y", "Offset Y", -1.0, 1.0, 0.0),
627 flt("Angle", "Angle", -360.0, 360.0, 0.0),
628 boolean("Solid", "Solid", true),
629 flt("BorderWidth", "Border", 0.0, 0.2, 0.01),
630 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [1.0, 1.0, 1.0, 1.0]),
301631 ] },
302 "UltraKeyer" => const { &[
303 ParamSpec {
304 name: "KeyColor",
305 label: "Key Color",
306 kind: ParamKind::Color {
307 r: "BackgroundRed",
308 g: "BackgroundGreen",
309 b: "BackgroundBlue",
310 a: None,
311 default: [0.0, 1.0, 0.0, 1.0],
312 },
313 },
314 flt("MatteThresholdLow", "Matte Low", 0.0, 1.0, 0.0),
315 flt("MatteThresholdHigh", "Matte High", 0.0, 1.0, 1.0),
316 flt("SpillSuppression", "Spill", 0.0, 1.0, 0.0),
317 boolean("PostMultiplyImage", "Post-Multiply", true),
632 "sRectangle" => const { &[
633 flt("Width", "Width", 0.0, 2.0, 0.5),
634 flt("Height", "Height", 0.0, 2.0, 0.5),
635 flt("CornerRadius", "Corner", 0.0, 1.0, 0.0),
636 flt("Translate.X", "Offset X", -1.0, 1.0, 0.0),
637 flt("Translate.Y", "Offset Y", -1.0, 1.0, 0.0),
638 flt("Angle", "Angle", -360.0, 360.0, 0.0),
639 boolean("Solid", "Solid", true),
640 flt("BorderWidth", "Border", 0.0, 0.2, 0.01),
641 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
642 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [1.0, 1.0, 1.0, 1.0]),
643 ] },
644 "sNGon" => const { &[
645 flt("Sides", "Sides", 3.0, 64.0, 6.0),
646 flt("Width", "Width", 0.0, 2.0, 0.5),
647 flt("Height", "Height", 0.0, 2.0, 0.5),
648 flt("Translate.X", "Offset X", -1.0, 1.0, 0.0),
649 flt("Translate.Y", "Offset Y", -1.0, 1.0, 0.0),
650 flt("Angle", "Angle", -360.0, 360.0, 0.0),
651 boolean("Solid", "Solid", true),
652 flt("BorderWidth", "Border", 0.0, 0.2, 0.01),
653 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
654 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [1.0, 1.0, 1.0, 1.0]),
655 ] },
656 "sBoolean" => const { &[
657 fuid("Operation", "Operation", &["Intersection", "Union", "Subtract", "Xor"], "Intersection"),
658 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [1.0, 1.0, 1.0, 1.0]),
659 ] },
660 "sTransform" => const { &[
661 flt("XOffset", "X Offset", -1.0, 1.0, 0.0),
662 flt("YOffset", "Y Offset", -1.0, 1.0, 0.0),
663 flt("XPivot", "X Pivot", -1.0, 1.0, 0.0),
664 flt("YPivot", "Y Pivot", -1.0, 1.0, 0.0),
665 flt("Scale", "Scale", 0.0, 5.0, 1.0),
666 flt("XSize", "X Size", 0.0, 5.0, 1.0),
667 flt("YSize", "Y Size", 0.0, 5.0, 1.0),
668 flt("ZRotation", "Rotation", -360.0, 360.0, 0.0),
669 ] },
670 "sMerge" => const { &[
318671 flt("Blend", "Blend", 0.0, 1.0, 1.0),
319672 ] },
320 "Loader" => const { &[
321 flt("GlobalIn", "Global In", 0.0, 10000.0, 0.0),
322 flt("GlobalOut", "Global Out", 0.0, 10000.0, 100.0),
323 boolean("Loop", "Loop", false),
324 boolean("Reverse", "Reverse", false),
673 "sOutline" => const { &[
674 flt("Thickness", "Thickness", 0.0, 0.2, 0.01),
675 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
676 int_enum("CapStyle", "Cap", CAP_STYLES, 0),
325677 ] },
678 "sGrid" => const { &[
679 flt("CellsX", "Cells X", 1.0, 32.0, 3.0),
680 flt("CellsY", "Cells Y", 1.0, 32.0, 3.0),
681 flt("XOffset", "X Offset", -2.0, 2.0, 0.2),
682 flt("YOffset", "Y Offset", -2.0, 2.0, 0.2),
683 ] },
684
685 // --- 3D Scene, Lights & Materials ---
326686 "Camera3D" => const { &[
327 flt("FLength", "Focal Len", 5.0, 200.0, 24.0),
328 flt("PlaneOfFocus", "Focus Dist", 0.1, 100.0, 5.0),
687 flt("FLength", "Focal Len", 5.0, 200.0, 35.0),
688 flt("ApertureW", "Gate W", 0.1, 5.0, 1.4173236),
689 flt("ApertureH", "Gate H", 0.1, 5.0, 0.9448824),
690 fuid("ResolutionGateFit", "Gate Fit", GATE_FITS, "Height"),
691 flt("PlaneOfFocus", "Focus Dist", 0.01, 100.0, 5.0),
329692 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
330693 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
331694 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 5.0),
......@@ -335,13 +698,103 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
335698 ] },
336699 "Shape3D" => const { &[
337700 fuid("Shape", "Shape", SHAPE3D_TYPES, "SurfacePlaneInputs"),
338 flt("SurfacePlaneInputs.Width", "Width", 0.01, 20.0, 1.0),
339 flt("SurfacePlaneInputs.Height", "Height", 0.01, 20.0, 1.0),
701 flt("SurfacePlaneInputs.Width", "Plane W", 0.01, 20.0, 1.0),
702 flt("SurfacePlaneInputs.SubdivisionWidth", "Plane Sub", 1.0, 64.0, 10.0),
703 flt("SurfaceSphereInputs.Radius", "Sphere R", 0.01, 20.0, 1.0),
704 flt("SurfaceCylinderInputs.Radius", "Cyl R", 0.01, 20.0, 1.0),
705 flt("SurfaceCylinderInputs.Height", "Cyl H", 0.01, 20.0, 2.0),
706 flt("SurfaceCubeInputs.Width", "Cube W", 0.01, 20.0, 1.0),
340707 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
341708 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
342709 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),
710 flt("Transform3DOp.Rotate.X", "Rot X", -180.0, 180.0, 0.0),
711 flt("Transform3DOp.Rotate.Y", "Rot Y", -180.0, 180.0, 0.0),
712 flt("Transform3DOp.Rotate.Z", "Rot Z", -180.0, 180.0, 0.0),
343713 flt("Transform3DOp.Scale.X", "Scale", 0.01, 20.0, 1.0),
344714 ] },
715 "Cube3D" => const { &[
716 flt("SurfaceCubeInputs.Width", "Width", 0.01, 20.0, 1.0),
717 flt("SurfaceCubeInputs.SubdivisionWidth", "Subdivs", 1.0, 64.0, 10.0),
718 boolean("SurfaceCubeInputs.Wireframe", "Wireframe", false),
719 boolean("SurfaceCubeInputs.Visibility.IsVisible", "Visible", true),
720 boolean("SurfaceCubeInputs.Lighting.IsAffectedByLights", "Lit", true),
721 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
722 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
723 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),
724 flt("Transform3DOp.Rotate.X", "Rot X", -180.0, 180.0, 0.0),
725 flt("Transform3DOp.Rotate.Y", "Rot Y", -180.0, 180.0, 0.0),
726 flt("Transform3DOp.Rotate.Z", "Rot Z", -180.0, 180.0, 0.0),
727 flt("Transform3DOp.Scale.X", "Scale", 0.01, 20.0, 1.0),
728 ] },
729 "SurfaceFBXMesh" => const { &[
730 text("ImportFile", "FBX / OBJ", ""),
731 text("ObjName", "Object Name", ""),
732 flt("ScaleFileUnitsBy", "Scale Units", 0.001, 100.0, 1.0),
733 boolean("SurfaceFBXInputs.Visibility.IsVisible", "Visible", true),
734 boolean("SurfaceFBXInputs.Lighting.IsAffectedByLights", "Lit", true),
735 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
736 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
737 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),
738 flt("Transform3DOp.Rotate.X", "Rot X", -180.0, 180.0, 0.0),
739 flt("Transform3DOp.Rotate.Y", "Rot Y", -180.0, 180.0, 0.0),
740 flt("Transform3DOp.Rotate.Z", "Rot Z", -180.0, 180.0, 0.0),
741 flt("Transform3DOp.Scale.X", "Scale", 0.01, 20.0, 1.0),
742 ] },
743 "LightPoint" => const { &[
744 boolean("Enabled", "Enabled", true),
745 rgba("Color", "Color", "Red", "Green", "Blue", None, [1.0, 1.0, 1.0, 1.0]),
746 flt("Intensity", "Intensity", 0.0, 20.0, 1.0),
747 int_enum("DecayType", "Decay Type", DECAY_TYPES, 0),
748 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
749 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
750 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),
751 ] },
752 "LightSpot" => const { &[
753 boolean("Enabled", "Enabled", true),
754 rgba("Color", "Color", "Red", "Green", "Blue", None, [1.0, 1.0, 1.0, 1.0]),
755 flt("Intensity", "Intensity", 0.0, 20.0, 1.0),
756 flt("ConeAngle", "Cone Angle", 1.0, 179.0, 40.0),
757 flt("PenumbraAngle", "Penumbra", -45.0, 45.0, 0.0),
758 int_enum("DecayType", "Decay Type", DECAY_TYPES, 0),
759 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
760 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
761 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),
762 flt("Transform3DOp.Rotate.X", "Rot X", -180.0, 180.0, 0.0),
763 flt("Transform3DOp.Rotate.Y", "Rot Y", -180.0, 180.0, 0.0),
764 flt("Transform3DOp.Rotate.Z", "Rot Z", -180.0, 180.0, 0.0),
765 ] },
766 "LightDirectional" => const { &[
767 boolean("Enabled", "Enabled", true),
768 rgba("Color", "Color", "Red", "Green", "Blue", None, [1.0, 1.0, 1.0, 1.0]),
769 flt("Intensity", "Intensity", 0.0, 20.0, 1.0),
770 flt("Transform3DOp.Rotate.X", "Rot X", -180.0, 180.0, 0.0),
771 flt("Transform3DOp.Rotate.Y", "Rot Y", -180.0, 180.0, 0.0),
772 flt("Transform3DOp.Rotate.Z", "Rot Z", -180.0, 180.0, 0.0),
773 ] },
774 "LightAmbient" => const { &[
775 boolean("Enabled", "Enabled", true),
776 rgba("Color", "Color", "Red", "Green", "Blue", None, [1.0, 1.0, 1.0, 1.0]),
777 flt("Intensity", "Intensity", 0.0, 10.0, 1.0),
778 ] },
779 "MtlBlinn" | "MtlPhong" => const { &[
780 rgba("Diffuse", "Diffuse", "Diffuse.Color.Red", "Diffuse.Color.Green", "Diffuse.Color.Blue", Some("Diffuse.Opacity"), [1.0, 1.0, 1.0, 1.0]),
781 rgba("Specular", "Specular", "Specular.Color.Red", "Specular.Color.Green", "Specular.Color.Blue", None, [1.0, 1.0, 1.0, 1.0]),
782 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),
783 flt("Specular.Exponent", "Spec Exp", 1.0, 200.0, 50.0),
784 ] },
785 "MtlCookTorrance" => const { &[
786 rgba("Diffuse", "Diffuse", "Diffuse.Color.Red", "Diffuse.Color.Green", "Diffuse.Color.Blue", Some("Diffuse.Opacity"), [1.0, 1.0, 1.0, 1.0]),
787 rgba("Specular", "Specular", "Specular.Color.Red", "Specular.Color.Green", "Specular.Color.Blue", None, [1.0, 1.0, 1.0, 1.0]),
788 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),
789 flt("Specular.Roughness", "Roughness", 0.05, 1.0, 0.6),
790 ] },
791 "MtlWard" => const { &[
792 rgba("Diffuse", "Diffuse", "Diffuse.Color.Red", "Diffuse.Color.Green", "Diffuse.Color.Blue", Some("Diffuse.Opacity"), [1.0, 1.0, 1.0, 1.0]),
793 rgba("Specular", "Specular", "Specular.Color.Red", "Specular.Color.Green", "Specular.Color.Blue", None, [1.0, 1.0, 1.0, 1.0]),
794 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),
795 flt("Specular.SpreadU", "Spread U", 0.01, 1.0, 0.25),
796 flt("Specular.SpreadV", "Spread V", 0.01, 1.0, 0.25),
797 ] },
345798 _ => &[],
346799 }
347800}
crates/app/src/inspector/widgets.rs+66-11
......@@ -111,6 +111,9 @@ impl InspectorState {
111111 ParamKind::Enum { options, default } => {
112112 self.render_enum_row(ui, comp, history, node_id, spec.name, spec.label, options, default, actions);
113113 }
114 ParamKind::IntEnum { options, default } => {
115 self.render_int_enum_row(ui, comp, history, node_id, spec.name, spec.label, options, default, actions);
116 }
114117 ParamKind::Color { r, g, b, a, default } => {
115118 self.render_color_group(
116119 ui,
......@@ -501,6 +504,59 @@ impl InspectorState {
501504 .static_str(input_name)
502505 .unwrap_or(default)
503506 .to_owned();
507 let idx = options.iter().position(|&o| o == cur).unwrap_or(0);
508 if let Some(next_idx) = self.render_combo_row(ui, node_id, input_name, label, &cur, idx, options.len()) {
509 history.push_snapshot(comp, format!("Set {label}"));
510 comp.set_input_value(node_id, input_name, ParamValue::FuId(options[next_idx].to_owned()));
511 actions.push(InspectorAction::ParamEdited(node_id));
512 }
513 }
514
515 #[allow(clippy::too_many_arguments)]
516 fn render_int_enum_row(
517 &mut self,
518 ui: &mut ui::Ui,
519 comp: &mut Comp,
520 history: &mut CompHistory,
521 node_id: NodeId,
522 input_name: &str,
523 label: &str,
524 options: &'static [(i32, &'static str)],
525 default: i32,
526 actions: &mut Vec<InspectorAction>,
527 ) {
528 let cur_val = comp
529 .node(node_id)
530 .static_number(input_name)
531 .map(|v| v.round() as i32)
532 .unwrap_or(default);
533 let idx = options.iter().position(|&(v, _)| v == cur_val).unwrap_or(0);
534 let fallback_label;
535 let cur_label = match options.iter().find(|&&(v, _)| v == cur_val) {
536 Some(&(_, name)) => name,
537 None => {
538 fallback_label = format!("{cur_val}");
539 &fallback_label
540 }
541 };
542 if let Some(next_idx) = self.render_combo_row(ui, node_id, input_name, label, cur_label, idx, options.len()) {
543 history.push_snapshot(comp, format!("Set {label}"));
544 comp.set_input_value(node_id, input_name, ParamValue::Number(f64::from(options[next_idx].0)));
545 actions.push(InspectorAction::ParamEdited(node_id));
546 }
547 }
548
549 #[allow(clippy::too_many_arguments)]
550 fn render_combo_row(
551 &self,
552 ui: &mut ui::Ui,
553 node_id: NodeId,
554 input_name: &str,
555 label: &str,
556 cur_label: &str,
557 cur_idx: usize,
558 option_count: usize,
559 ) -> Option<usize> {
504560 let p = self.palette;
505561
506562 ui.open(
......@@ -523,7 +579,7 @@ impl InspectorState {
523579 ..ui::Spec::default()
524580 },
525581 );
526 let btn_lbl = format!("{cur} ▾");
582 let btn_lbl = format!("{cur_label} ▾");
527583 let sig = ui.leaf(
528584 ("enum", node_id.0, input_name),
529585 ui::Spec {
......@@ -541,18 +597,17 @@ impl InspectorState {
541597 ..ui::Spec::default()
542598 },
543599 );
544 if sig.clicked && !options.is_empty() {
545 let idx = options.iter().position(|&o| o == cur).unwrap_or(0);
546 let next_idx = if ui.modifiers().shift_key() {
547 (idx + options.len() - 1) % options.len()
600 let next = if sig.clicked && option_count > 0 {
601 Some(if ui.modifiers().shift_key() {
602 (cur_idx + option_count - 1) % option_count
548603 } else {
549 (idx + 1) % options.len()
550 };
551 history.push_snapshot(comp, format!("Set {label}"));
552 comp.set_input_value(node_id, input_name, ParamValue::FuId(options[next_idx].to_owned()));
553 actions.push(InspectorAction::ParamEdited(node_id));
554 }
604 (cur_idx + 1) % option_count
605 })
606 } else {
607 None
608 };
555609 ui.close();
610 next
556611 }
557612
558613 #[allow(clippy::too_many_arguments)]