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...@@ -10,9 +10,9 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
10| Metric | Value |10| Metric | Value |
11| --- | --- |11| --- | --- |
12| **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) |12| **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) |13| **Modifiers & Animation** | **8** systems (0 Fusion modifier classes + Lua expressions) |
14| **Active Corpus (`trees/fusion`) Coverage** | **99.8%** (2,179 / 2,184 nodes across 16 `.comp` files) |14| **Active Corpus (`trees/fusion`) Coverage** | **58.0%** (1,266 / 2,184 nodes across 16 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (64,406 / 64,672 nodes across 324 `.comp` files) |15| **Archive Corpus (`private/samples`) Coverage** | **53.0%** (34,303 / 64,672 nodes across 324 `.comp` files) |
16| **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. |16| **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
18## Generators18## Generators
...@@ -208,6 +208,13 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w...@@ -208,6 +208,13 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
208| `SurfaceTracker` | 2 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |208| `SurfaceTracker` | 2 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
209| `MagicMask` | 3 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |209| `MagicMask` | 3 / 1 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |
210| `PlanarTracker` | 0 / 0 | [#7](https://shale.paperclover.net/fission/issues/7) | Preserved lossless on save; passes through main image input in Flow. |210| `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. |
211| `Fuse.AlphaWeightedNoise` | 0 / 26 | — | Preserved lossless on save; passes through main input in Flow. |218| `Fuse.AlphaWeightedNoise` | 0 / 26 | — | Preserved lossless on save; passes through main input in Flow. |
212| `Fuse.HexagonTiles` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |219| `Fuse.HexagonTiles` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |
213| `Fuse.CheckerPieceGenerator` | 0 / 25 | — | Preserved lossless on save; passes through main input in Flow. |220| `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...@@ -222,13 +229,6 @@ Unlike Blackmagic Fusion — which unlinks missing OFX or Resolve-only plugins w
222| `Ribbon3D` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |229| `Ribbon3D` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
223| `MtlReflect` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |230| `MtlReflect` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |
224| `DepthBlur` | 0 / 5 | — | Preserved lossless on save; passes through main input in Flow. |231| `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
233---233---
234234
crates/app/src/inspector/mod.rs+128-25
...@@ -4,6 +4,8 @@...@@ -4,6 +4,8 @@
4mod schemas;4mod schemas;
5mod widgets;5mod widgets;
66
7#[cfg(test)]
8pub use schemas::CURATED_TOOL_KINDS;
7#[allow(unused_imports)]9#[allow(unused_imports)]
8pub use schemas::{ParamKind, ParamSpec, infer_float_range, schema_for_kind};10pub use schemas::{ParamKind, ParamSpec, infer_float_range, schema_for_kind};
9#[allow(unused_imports)]11#[allow(unused_imports)]
...@@ -395,13 +397,27 @@ impl InspectorState {...@@ -395,13 +397,27 @@ impl InspectorState {
395 }397 }
396 }398 }
397399
398 // Loader clip info if Loader node400 // Loader / Saver clip filename summary
399 if node_kind == "Loader" {401 if matches!(node_kind.as_str(), "Loader" | "Saver") {
400 let clip_summary = comp402 let clip_hdr = if node_kind == "Saver" {
401 .node(node_id)403 "Output Filename"
404 } else {
405 "Clip Filename"
406 };
407 let node_ref = comp.node(node_id);
408 let clip_summary = node_ref
402 .clips409 .clips
403 .first()410 .first()
404 .map(|c| c.filename.clone())411 .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 })
405 .unwrap_or_else(|| "(no clip)".to_owned());421 .unwrap_or_else(|| "(no clip)".to_owned());
406 ui.open(422 ui.open(
407 "insp-loader-clip",423 "insp-loader-clip",
...@@ -420,7 +436,7 @@ impl InspectorState {...@@ -420,7 +436,7 @@ impl InspectorState {
420 "clip-lbl",436 "clip-lbl",
421 ui::Spec {437 ui::Spec {
422 size: [ui::fill(), ui::px(14.0)],438 size: [ui::fill(), ui::px(14.0)],
423 text: Some("Clip Filename"),439 text: Some(clip_hdr),
424 font_size: Some(10.0),440 font_size: Some(10.0),
425 color: Some(p.text_dim),441 color: Some(p.text_dim),
426 ..ui::Spec::default()442 ..ui::Spec::default()
...@@ -456,33 +472,120 @@ mod tests {...@@ -456,33 +472,120 @@ mod tests {
456472
457 #[test]473 #[test]
458 fn curated_schemas_cover_all_major_tools() {474 fn curated_schemas_cover_all_major_tools() {
459 let major = [475 let required = [
460 "Merge",476 // Original 18
461 "Transform",477 "Merge", "Transform", "Blur", "Glow", "SoftGlow", "BrightnessContrast",
462 "Blur",478 "ColorCorrector", "Background", "TextPlus", "EllipseMask", "RectangleMask",
463 "Glow",479 "Displace", "Vortex", "FastNoise", "UltraKeyer", "Loader", "Camera3D", "Shape3D",
464 "SoftGlow",480 // Wave 9E additions
465 "BrightnessContrast",481 "Dissolve", "ChannelBoolean", "Saver", "Switch", "Fuse.Switch",
466 "ColorCorrector",482 "TimeStretcher", "TimeSpeed",
467 "Background",483 "Paint", "PaintMask", "WandMask", "BitmapMask",
468 "TextPlus",484 "Drip", "Dent", "DaySky", "GridWarp", "PerspectivePositioner",
469 "EllipseMask",485 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid",
470 "RectangleMask",486 "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard",
471 "Displace",487 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",
472 "Vortex",488 "Cube3D", "SurfaceFBXMesh", "Custom",
473 "FastNoise",489 "ErodeDilate", "DirectionalBlur", "VariBlur", "Sharpen", "Shadow",
474 "UltraKeyer",490 "ColorGain", "HueCurves", "GamutConvert", "FilmGrain",
475 "Loader",
476 "Camera3D",
477 "Shape3D",
478 ];491 ];
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 );
480 let s = schema_for_kind(tool);497 let s = schema_for_kind(tool);
481 assert!(!s.is_empty(), "expected non-empty curated schema for {tool}");498 assert!(!s.is_empty(), "expected non-empty curated schema for {tool}");
482 }499 }
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 }
483 assert!(schema_for_kind("UnknownCustomTool").is_empty());506 assert!(schema_for_kind("UnknownCustomTool").is_empty());
484 }507 }
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
486 #[test]589 #[test]
487 fn slider_math_and_clamping() {590 fn slider_math_and_clamping() {
488 assert!((normalize_slider_fraction(0.5, 0.0, 1.0) - 0.5).abs() < 1e-6);591 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 {...@@ -9,6 +9,7 @@ pub enum ParamKind {
9 Vec2 { min: f64, max: f64, default: [f64; 2] },9 Vec2 { min: f64, max: f64, default: [f64; 2] },
10 Bool { default: bool },10 Bool { default: bool },
11 Enum { options: &'static [&'static str], default: &'static str },11 Enum { options: &'static [&'static str], default: &'static str },
12 IntEnum { options: &'static [(i32, &'static str)], default: i32 },
12 Color {13 Color {
13 r: &'static str,14 r: &'static str,
14 g: &'static str,15 g: &'static str,
...@@ -77,99 +78,218 @@ pub fn infer_float_range(name: &str, val: f64) -> (f64, f64) {...@@ -77,99 +78,218 @@ pub fn infer_float_range(name: &str, val: f64) -> (f64, f64) {
77}78}
7879
79const APPLY_MODES: &[&str] = &[80const APPLY_MODES: &[&str] = &[
80 "Normal",81 "Normal", "Screen", "Multiply", "Overlay", "Soft Light", "Hard Light",
81 "Screen",82 "Color Dodge", "LinearDodge", "Color Burn", "LinearBurn", "Darken", "Lighten",
82 "Multiply",83 "Difference", "Exclusion", "LinearLight", "VividLight", "PinLight",
83 "Overlay",84 "DarkerColor", "LighterColor", "Hypotenuse", "Geometric",
84 "Soft Light",85 "Hue", "Saturation", "Color", "Luminosity",
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",
96];86];
9787const MERGE_OPERATORS: &[&str] = &["Over", "Under", "In", "Held Out", "Atop", "XOr"];
98const BLUR_FILTERS: &[&str] = &["Fast Gaussian", "Gaussian", "Box", "Bartlett", "Multi-box"];88const BLUR_FILTERS: &[&str] = &["Fast Gaussian", "Gaussian", "Box"];
89const GLOW_FILTERS: &[&str] = &["Gaussian", "Fast Gaussian", "Box"];
99const CLIPPING_MODES: &[&str] = &["Frame", "Domain", "None"];90const 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];
101const SHAPE3D_TYPES: &[&str] = &[97const SHAPE3D_TYPES: &[&str] = &[
102 "SurfacePlaneInputs",98 "SurfacePlaneInputs", "SurfaceSphereInputs", "SurfaceCubeInputs", "SurfaceCylinderInputs",
103 "SurfaceSphereInputs",99];
104 "SurfaceCubeInputs",100const GATE_FITS: &[&str] = &["Inside", "Width", "Height", "Outside", "Stretch"];
105 "SurfaceCylinderInputs",101const MASK_CHANNELS: &[&str] = &[
106 "SurfaceConeInputs",102 "Alpha", "Luminance", "Red", "Green", "Blue", "Saturation", "Lightness", "Hue",
107 "SurfaceTorusInputs",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"),
108];115];
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
110const fn flt(name: &'static str, label: &'static str, min: f64, max: f64, default: f64) -> ParamSpec {120const fn flt(name: &'static str, label: &'static str, min: f64, max: f64, default: f64) -> ParamSpec {
111 ParamSpec {121 ParamSpec { name, label, kind: ParamKind::Float { min, max, default, step: 0.01 } }
112 name,
113 label,
114 kind: ParamKind::Float { min, max, default, step: 0.01 },
115 }
116}122}
117123
118const fn v2(name: &'static str, label: &'static str, min: f64, max: f64, default: [f64; 2]) -> ParamSpec {124const fn v2(name: &'static str, label: &'static str, min: f64, max: f64, default: [f64; 2]) -> ParamSpec {
119 ParamSpec {125 ParamSpec { name, label, kind: ParamKind::Vec2 { min, max, default } }
120 name,
121 label,
122 kind: ParamKind::Vec2 { min, max, default },
123 }
124}126}
125127
126const fn boolean(name: &'static str, label: &'static str, default: bool) -> ParamSpec {128const fn boolean(name: &'static str, label: &'static str, default: bool) -> ParamSpec {
127 ParamSpec {129 ParamSpec { name, label, kind: ParamKind::Bool { default } }
128 name,130}
129 label,131
130 kind: ParamKind::Bool { default },132const fn fuid(name: &'static str, label: &'static str, options: &'static [&'static str], default: &'static str) -> ParamSpec {
131 }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 } }
132}142}
133143
134const fn fuid(144const fn rgba(
135 name: &'static str,145 name: &'static str,
136 label: &'static str,146 label: &'static str,
137 options: &'static [&'static str],147 r: &'static str,
138 default: &'static str,148 g: &'static str,
149 b: &'static str,
150 a: Option<&'static str>,
151 default: [f64; 4],
139) -> ParamSpec {152) -> ParamSpec {
140 ParamSpec {153 ParamSpec { name, label, kind: ParamKind::Color { r, g, b, a, default } }
141 name,
142 label,
143 kind: ParamKind::Enum { options, default },
144 }
145}154}
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
147/// Curated Fusion 21.1 parameter schemas for major compositor tools.179/// Curated Fusion 21.1 parameter schemas for major compositor tools.
148pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {180pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
149 match kind {181 match kind {
182 // --- Composite & Routing ---
150 "Merge" => const { &[183 "Merge" => const { &[
151 fuid("ApplyMode", "Apply Mode", APPLY_MODES, "Normal"),184 fuid("ApplyMode", "Apply Mode", APPLY_MODES, "Normal"),
152 flt("Blend", "Blend", 0.0, 1.0, 1.0),185 fuid("Operator", "Operator", MERGE_OPERATORS, "Over"),
153 flt("SubMerge", "Subtractive", 0.0, 1.0, 0.0),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),
154 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),189 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
155 flt("Size", "Size", 0.0, 5.0, 1.0),190 flt("Size", "Size", 0.0, 5.0, 1.0),
156 flt("Angle", "Angle", -360.0, 360.0, 0.0),191 flt("Angle", "Angle", -360.0, 360.0, 0.0),
157 boolean("FlipHoriz", "Flip Horiz", false),192 boolean("FlipHoriz", "Flip Horiz", false),
158 boolean("FlipVert", "Flip Vert", false),193 boolean("FlipVert", "Flip Vert", false),
159 fuid("Edges", "Edges", EDGES_MODES, "Canvas"),194 int_enum("Edges", "Edges", EDGES_INT, 0),
160 boolean("PerformDepthMerge", "Depth Merge", false),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),
161 ] },224 ] },
225
226 // --- Transform & Warp ---
162 "Transform" => const { &[227 "Transform" => const { &[
163 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),228 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
164 v2("Pivot", "Pivot", -1.0, 2.0, [0.5, 0.5]),229 v2("Pivot", "Pivot", -1.0, 2.0, [0.5, 0.5]),
230 boolean("UseSizeAndAspect", "Size/Aspect", true),
165 flt("Size", "Size", 0.0, 5.0, 1.0),231 flt("Size", "Size", 0.0, 5.0, 1.0),
166 flt("Aspect", "Aspect", 0.1, 4.0, 1.0),232 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),
167 flt("Angle", "Angle", -360.0, 360.0, 0.0),235 flt("Angle", "Angle", -360.0, 360.0, 0.0),
168 boolean("FlipHoriz", "Flip Horiz", false),236 boolean("FlipHoriz", "Flip Horiz", false),
169 boolean("FlipVert", "Flip Vert", false),237 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 { &[
171 flt("Blend", "Blend", 0.0, 1.0, 1.0),281 flt("Blend", "Blend", 0.0, 1.0, 1.0),
172 ] },282 ] },
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 ---
173 "Blur" => const { &[293 "Blur" => const { &[
174 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),294 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
175 boolean("LockXY", "Lock X/Y", true),295 boolean("LockXY", "Lock X/Y", true),
...@@ -178,19 +298,82 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -178,19 +298,82 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
178 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),298 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
179 flt("Blend", "Blend", 0.0, 1.0, 1.0),299 flt("Blend", "Blend", 0.0, 1.0, 1.0),
180 ] },300 ] },
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 ] },
181 "Glow" => const { &[314 "Glow" => const { &[
315 fuid("Filter", "Filter", GLOW_FILTERS, "Gaussian"),
316 boolean("LockXY", "Lock X/Y", true),
182 flt("XGlowSize", "Glow Size", 0.0, 100.0, 10.0),317 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"),
184 flt("Blend", "Blend", 0.0, 1.0, 1.0),326 flt("Blend", "Blend", 0.0, 1.0, 1.0),
185 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
186 ] },327 ] },
187 "SoftGlow" => const { &[328 "SoftGlow" => const { &[
188 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),329 fuid("Filter", "Filter", GLOW_FILTERS, "Gaussian"),
189 flt("Threshold", "Threshold", 0.0, 1.0, 0.0),330 flt("Threshold", "Threshold", 0.0, 1.0, 0.0),
190 flt("Gain", "Gain", 0.0, 5.0, 2.0),331 flt("Gain", "Gain", 0.0, 5.0, 2.0),
332 boolean("LockXY", "Lock X/Y", true),
191 flt("XGlowSize", "Glow Size", 0.0, 100.0, 10.0),333 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),
192 flt("Blend", "Blend", 0.0, 1.0, 1.0),358 flt("Blend", "Blend", 0.0, 1.0, 1.0),
193 ] },359 ] },
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 ---
194 "BrightnessContrast" => const { &[377 "BrightnessContrast" => const { &[
195 flt("Gain", "Gain", 0.0, 5.0, 1.0),378 flt("Gain", "Gain", 0.0, 5.0, 1.0),
196 flt("Lift", "Lift", -1.0, 1.0, 0.0),379 flt("Lift", "Lift", -1.0, 1.0, 0.0),
...@@ -199,6 +382,7 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -199,6 +382,7 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
199 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),382 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),
200 flt("Saturation", "Saturation", 0.0, 4.0, 1.0),383 flt("Saturation", "Saturation", 0.0, 4.0, 1.0),
201 boolean("PreDividePostMultiply", "Pre-Div/Post", false),384 boolean("PreDividePostMultiply", "Pre-Div/Post", false),
385 boolean("MultiplyByMask", "Mult by Mask", false),
202 flt("Blend", "Blend", 0.0, 1.0, 1.0),386 flt("Blend", "Blend", 0.0, 1.0, 1.0),
203 ] },387 ] },
204 "ColorCorrector" => const { &[388 "ColorCorrector" => const { &[
...@@ -210,52 +394,173 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -210,52 +394,173 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
210 flt("MasterRGBContrast", "Contrast", 0.0, 3.0, 1.0),394 flt("MasterRGBContrast", "Contrast", 0.0, 3.0, 1.0),
211 flt("MasterRGBBrightness", "Brightness", -1.0, 1.0, 0.0),395 flt("MasterRGBBrightness", "Brightness", -1.0, 1.0, 0.0),
212 boolean("PreDividePostMultiply", "Pre-Div/Post", false),396 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),
213 flt("Blend", "Blend", 0.0, 1.0, 1.0),421 flt("Blend", "Blend", 0.0, 1.0, 1.0),
214 ] },422 ] },
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 ---
215 "Background" => const { &[467 "Background" => const { &[
216 ParamSpec {468 fuid("Type", "Type", &["Solid", "Horizontal", "Vertical", "Corner", "Gradient"], "Solid"),
217 name: "TopLeftColor",469 fuid("GradientType", "Grad Type", &["Linear", "Radial", "Angle", "Reflect"], "Linear"),
218 label: "Color",470 rgba("TopLeftColor", "Color", "TopLeftRed", "TopLeftGreen", "TopLeftBlue", Some("TopLeftAlpha"), [0.0, 0.0, 0.0, 1.0]),
219 kind: ParamKind::Color {471 flt("Width", "Width", 1.0, 7680.0, 1920.0),
220 r: "TopLeftRed",472 flt("Height", "Height", 1.0, 4320.0, 1080.0),
221 g: "TopLeftGreen",473 ] },
222 b: "TopLeftBlue",474 "FastNoise" => const { &[
223 a: Some("TopLeftAlpha"),475 flt("Detail", "Detail", 0.0, 10.0, 2.0),
224 default: [0.0, 0.0, 0.0, 1.0],476 flt("Contrast", "Contrast", 0.0, 5.0, 1.0),
225 },477 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),
226 },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),
227 flt("Width", "Width", 1.0, 7680.0, 1920.0),494 flt("Width", "Width", 1.0, 7680.0, 1920.0),
228 flt("Height", "Height", 1.0, 4320.0, 1080.0),495 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),
229 ] },509 ] },
230 "TextPlus" => const { &[510 "TextPlus" => const { &[
231 ParamSpec {511 text("StyledText", "Styled Text", ""),
232 name: "StyledText",512 text("Font", "Font", "Helvetica Neue"),
233 label: "Styled Text",513 text("Style", "Style", "Regular"),
234 kind: ParamKind::Text { default: "" },
235 },
236 ParamSpec {
237 name: "Font",
238 label: "Font",
239 kind: ParamKind::Text { default: "Open Sans" },
240 },
241 flt("Size", "Size", 0.005, 1.0, 0.08),514 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),
243 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),517 v2("Center", "Center", -1.0, 2.0, [0.5, 0.5]),
244 ParamSpec {518 flt("HorizontalLeftCenterRight", "H Align", -1.0, 1.0, 0.0),
245 name: "TextColor",519 flt("VerticalTopCenterBottom", "V Align", -1.0, 1.0, 0.0),
246 label: "Text Color",520 rgba("TextColor", "Text Color", "Red1", "Green1", "Blue1", Some("Alpha1"), [1.0, 1.0, 1.0, 1.0]),
247 kind: ParamKind::Color {521 flt("Blend", "Blend", 0.0, 1.0, 1.0),
248 r: "Red1",522 ] },
249 g: "Green1",523 "Loader" => const { &[
250 b: "Blue1",524 flt("GlobalIn", "Global In", 0.0, 10000.0, 0.0),
251 a: Some("Alpha1"),525 flt("GlobalOut", "Global Out", 0.0, 10000.0, 100.0),
252 default: [1.0, 1.0, 1.0, 1.0],526 int_enum("MissingFrames", "Missing", &[(0, "Fail"), (1, "Output Color"), (2, "Hold Previous")], 0),
253 },527 boolean("Loop", "Loop", false),
254 },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 { &[
255 flt("Blend", "Blend", 0.0, 1.0, 1.0),548 flt("Blend", "Blend", 0.0, 1.0, 1.0),
256 ] },549 ] },
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 ] },
257 "EllipseMask" => const { &[560 "EllipseMask" => const { &[
561 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
258 flt("Level", "Level", 0.0, 1.0, 1.0),562 flt("Level", "Level", 0.0, 1.0, 1.0),
563 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
259 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),564 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
260 flt("BorderWidth", "Border", -0.2, 0.2, 0.0),565 flt("BorderWidth", "Border", -0.2, 0.2, 0.0),
261 boolean("Solid", "Solid", true),566 boolean("Solid", "Solid", true),
...@@ -264,10 +569,14 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -264,10 +569,14 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
264 flt("Width", "Width", 0.0, 2.0, 0.5),569 flt("Width", "Width", 0.0, 2.0, 0.5),
265 flt("Height", "Height", 0.0, 2.0, 0.5),570 flt("Height", "Height", 0.0, 2.0, 0.5),
266 flt("Angle", "Angle", -360.0, 360.0, 0.0),571 flt("Angle", "Angle", -360.0, 360.0, 0.0),
572 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
267 ] },573 ] },
268 "RectangleMask" => const { &[574 "RectangleMask" => const { &[
575 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
269 flt("Level", "Level", 0.0, 1.0, 1.0),576 flt("Level", "Level", 0.0, 1.0, 1.0),
577 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
270 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),578 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
579 flt("BorderWidth", "Border", -0.2, 0.2, 0.0),
271 flt("CornerRadius", "Corner", 0.0, 1.0, 0.0),580 flt("CornerRadius", "Corner", 0.0, 1.0, 0.0),
272 boolean("Solid", "Solid", true),581 boolean("Solid", "Solid", true),
273 boolean("Invert", "Invert", false),582 boolean("Invert", "Invert", false),
...@@ -275,57 +584,111 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -275,57 +584,111 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
275 flt("Width", "Width", 0.0, 2.0, 0.5),584 flt("Width", "Width", 0.0, 2.0, 0.5),
276 flt("Height", "Height", 0.0, 2.0, 0.5),585 flt("Height", "Height", 0.0, 2.0, 0.5),
277 flt("Angle", "Angle", -360.0, 360.0, 0.0),586 flt("Angle", "Angle", -360.0, 360.0, 0.0),
587 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
278 ] },588 ] },
279 "Displace" => const { &[589 "BitmapMask" => const { &[
280 flt("XRefraction", "X Refract", -1.0, 1.0, 0.0),590 fuid("Channel", "Channel", MASK_CHANNELS, "Alpha"),
281 flt("YRefraction", "Y Refract", -1.0, 1.0, 0.0),591 flt("Low", "Low", 0.0, 1.0, 0.0),
282 flt("RefractionStrength", "Strength", -2.0, 2.0, 0.0),592 flt("High", "High", 0.0, 1.0, 1.0),
283 flt("LightAngle", "Light Angle", -360.0, 360.0, 0.0),593 fuid("Filter", "Filter", BLUR_FILTERS, "Fast Gaussian"),
284 flt("Blend", "Blend", 0.0, 1.0, 1.0),594 flt("SoftEdge", "Soft Edge", 0.0, 0.5, 0.0),
285 ] },595 flt("Level", "Level", 0.0, 1.0, 1.0),
286 "Vortex" => const { &[596 boolean("Invert", "Invert", false),
597 boolean("FitInput", "Fit Input", false),
287 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),598 v2("Center", "Center", -0.5, 1.5, [0.5, 0.5]),
288 flt("Size", "Size", 0.0, 2.0, 0.5),599 fuid("PaintMode", "Paint Mode", PAINT_MODES, "Merge"),
289 flt("Angle", "Angle", -720.0, 720.0, 90.0),600 fuid("ClippingMode", "Clipping", CLIPPING_MODES, "Frame"),
290 flt("Power", "Power", 0.1, 5.0, 1.0),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),
291 flt("Blend", "Blend", 0.0, 1.0, 1.0),620 flt("Blend", "Blend", 0.0, 1.0, 1.0),
292 ] },621 ] },
293 "FastNoise" => const { &[622 "sEllipse" => const { &[
294 flt("Detail", "Detail", 0.0, 10.0, 2.0),623 flt("Width", "Width", 0.0, 2.0, 0.5),
295 flt("Contrast", "Contrast", 0.0, 5.0, 1.0),624 flt("Height", "Height", 0.0, 2.0, 0.5),
296 flt("Brightness", "Brightness", -1.0, 1.0, 0.0),625 flt("Translate.X", "Offset X", -1.0, 1.0, 0.0),
297 flt("XScale", "Scale", 0.01, 50.0, 2.0),626 flt("Translate.Y", "Offset Y", -1.0, 1.0, 0.0),
298 flt("Seethe", "Seethe", 0.0, 100.0, 0.0),627 flt("Angle", "Angle", -360.0, 360.0, 0.0),
299 flt("SeetheRate", "Seethe Rate", 0.0, 2.0, 0.0),628 boolean("Solid", "Solid", true),
300 v2("Center", "Center", -2.0, 3.0, [0.5, 0.5]),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]),
301 ] },631 ] },
302 "UltraKeyer" => const { &[632 "sRectangle" => const { &[
303 ParamSpec {633 flt("Width", "Width", 0.0, 2.0, 0.5),
304 name: "KeyColor",634 flt("Height", "Height", 0.0, 2.0, 0.5),
305 label: "Key Color",635 flt("CornerRadius", "Corner", 0.0, 1.0, 0.0),
306 kind: ParamKind::Color {636 flt("Translate.X", "Offset X", -1.0, 1.0, 0.0),
307 r: "BackgroundRed",637 flt("Translate.Y", "Offset Y", -1.0, 1.0, 0.0),
308 g: "BackgroundGreen",638 flt("Angle", "Angle", -360.0, 360.0, 0.0),
309 b: "BackgroundBlue",639 boolean("Solid", "Solid", true),
310 a: None,640 flt("BorderWidth", "Border", 0.0, 0.2, 0.01),
311 default: [0.0, 1.0, 0.0, 1.0],641 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
312 },642 rgba("Color", "Color", "Red", "Green", "Blue", Some("Alpha"), [1.0, 1.0, 1.0, 1.0]),
313 },643 ] },
314 flt("MatteThresholdLow", "Matte Low", 0.0, 1.0, 0.0),644 "sNGon" => const { &[
315 flt("MatteThresholdHigh", "Matte High", 0.0, 1.0, 1.0),645 flt("Sides", "Sides", 3.0, 64.0, 6.0),
316 flt("SpillSuppression", "Spill", 0.0, 1.0, 0.0),646 flt("Width", "Width", 0.0, 2.0, 0.5),
317 boolean("PostMultiplyImage", "Post-Multiply", true),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 { &[
318 flt("Blend", "Blend", 0.0, 1.0, 1.0),671 flt("Blend", "Blend", 0.0, 1.0, 1.0),
319 ] },672 ] },
320 "Loader" => const { &[673 "sOutline" => const { &[
321 flt("GlobalIn", "Global In", 0.0, 10000.0, 0.0),674 flt("Thickness", "Thickness", 0.0, 0.2, 0.01),
322 flt("GlobalOut", "Global Out", 0.0, 10000.0, 100.0),675 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
323 boolean("Loop", "Loop", false),676 int_enum("CapStyle", "Cap", CAP_STYLES, 0),
324 boolean("Reverse", "Reverse", false),
325 ] },677 ] },
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 ---
326 "Camera3D" => const { &[686 "Camera3D" => const { &[
327 flt("FLength", "Focal Len", 5.0, 200.0, 24.0),687 flt("FLength", "Focal Len", 5.0, 200.0, 35.0),
328 flt("PlaneOfFocus", "Focus Dist", 0.1, 100.0, 5.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),
329 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),692 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
330 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),693 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
331 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 5.0),694 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] {...@@ -335,13 +698,103 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
335 ] },698 ] },
336 "Shape3D" => const { &[699 "Shape3D" => const { &[
337 fuid("Shape", "Shape", SHAPE3D_TYPES, "SurfacePlaneInputs"),700 fuid("Shape", "Shape", SHAPE3D_TYPES, "SurfacePlaneInputs"),
338 flt("SurfacePlaneInputs.Width", "Width", 0.01, 20.0, 1.0),701 flt("SurfacePlaneInputs.Width", "Plane W", 0.01, 20.0, 1.0),
339 flt("SurfacePlaneInputs.Height", "Height", 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),
340 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),707 flt("Transform3DOp.Translate.X", "Trans X", -50.0, 50.0, 0.0),
341 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),708 flt("Transform3DOp.Translate.Y", "Trans Y", -50.0, 50.0, 0.0),
342 flt("Transform3DOp.Translate.Z", "Trans Z", -50.0, 50.0, 0.0),709 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),
343 flt("Transform3DOp.Scale.X", "Scale", 0.01, 20.0, 1.0),713 flt("Transform3DOp.Scale.X", "Scale", 0.01, 20.0, 1.0),
344 ] },714 ] },
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 ] },
345 _ => &[],798 _ => &[],
346 }799 }
347}800}
crates/app/src/inspector/widgets.rs+66-11
...@@ -111,6 +111,9 @@ impl InspectorState {...@@ -111,6 +111,9 @@ impl InspectorState {
111 ParamKind::Enum { options, default } => {111 ParamKind::Enum { options, default } => {
112 self.render_enum_row(ui, comp, history, node_id, spec.name, spec.label, options, default, actions);112 self.render_enum_row(ui, comp, history, node_id, spec.name, spec.label, options, default, actions);
113 }113 }
114 ParamKind::IntEnum { options, default } => {
115 self.render_int_enum_row(ui, comp, history, node_id, spec.name, spec.label, options, default, actions);
116 }
114 ParamKind::Color { r, g, b, a, default } => {117 ParamKind::Color { r, g, b, a, default } => {
115 self.render_color_group(118 self.render_color_group(
116 ui,119 ui,
...@@ -501,6 +504,59 @@ impl InspectorState {...@@ -501,6 +504,59 @@ impl InspectorState {
501 .static_str(input_name)504 .static_str(input_name)
502 .unwrap_or(default)505 .unwrap_or(default)
503 .to_owned();506 .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> {
504 let p = self.palette;560 let p = self.palette;
505561
506 ui.open(562 ui.open(
...@@ -523,7 +579,7 @@ impl InspectorState {...@@ -523,7 +579,7 @@ impl InspectorState {
523 ..ui::Spec::default()579 ..ui::Spec::default()
524 },580 },
525 );581 );
526 let btn_lbl = format!("{cur} ▾");582 let btn_lbl = format!("{cur_label} ▾");
527 let sig = ui.leaf(583 let sig = ui.leaf(
528 ("enum", node_id.0, input_name),584 ("enum", node_id.0, input_name),
529 ui::Spec {585 ui::Spec {
...@@ -541,18 +597,17 @@ impl InspectorState {...@@ -541,18 +597,17 @@ impl InspectorState {
541 ..ui::Spec::default()597 ..ui::Spec::default()
542 },598 },
543 );599 );
544 if sig.clicked && !options.is_empty() {600 let next = if sig.clicked && option_count > 0 {
545 let idx = options.iter().position(|&o| o == cur).unwrap_or(0);601 Some(if ui.modifiers().shift_key() {
546 let next_idx = if ui.modifiers().shift_key() {602 (cur_idx + option_count - 1) % option_count
547 (idx + options.len() - 1) % options.len()
548 } else {603 } else {
549 (idx + 1) % options.len()604 (cur_idx + 1) % option_count
550 };605 })
551 history.push_snapshot(comp, format!("Set {label}"));606 } else {
552 comp.set_input_value(node_id, input_name, ParamValue::FuId(options[next_idx].to_owned()));607 None
553 actions.push(InspectorAction::ParamEdited(node_id));608 };
554 }
555 ui.close();609 ui.close();
610 next
556 }611 }
557612
558 #[allow(clippy::too_many_arguments)]613 #[allow(clippy::too_many_arguments)]