From ee7c51740dcf224339b3b971a716502676cbce02 Mon Sep 17 00:00:00 2001 From: Valentin Klein Date: Fri, 6 Nov 2026 17:18:58 +0100 Subject: [PATCH] effects: Write-on and Stroke Brush Size goes up to 200 px (#2980) (#3021) After Effects 2026 accepts 0 to 200 for Brush Size of both effects (a script setting 201 is refused with "out of range 0 to 200"); the range here ended at 50. The slider keeps its 0 to 50 travel; larger values are typed. Co-authored-by: Claude Sonnet 5.5 --- crates/effects/src/generate3/registry.rs | 4 ++-- crates/effects/src/generate3/tests.rs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/effects/src/generate3/registry.rs b/crates/effects/src/generate3/registry.rs index 06c2b35fb..f3e08c2d5 100644 --- a/crates/effects/src/generate3/registry.rs +++ b/crates/effects/src/generate3/registry.rs @@ -83,7 +83,7 @@ pub fn specs() -> Vec { check("allMasks", "All Masks", false), check("strokeSequentially", "Stroke Sequentially", true), p("color", "Color", col(1.0, 1.0, 1.0), ParamUi::Color), - p("brushSize", "Brush Size", num(2.0), slider(0.0, 50.0, 0.0, 50.0, 1)), + p("brushSize", "Brush Size", num(2.0), slider(0.0, 200.0, 0.0, 50.0, 1)), p("brushHardness", "Brush Hardness", num(75.0), pct()), p("opacity", "Opacity", num(100.0), pct()), p("start", "Start", num(0.0), pct()), @@ -132,7 +132,7 @@ pub fn specs() -> Vec { vec![ p("brushPosition", "Brush Position", pt(0.5, 0.5), ParamUi::Point), p("color", "Color", col(1.0, 1.0, 1.0), ParamUi::Color), - p("brushSize", "Brush Size", num(6.0), slider(0.0, 50.0, 0.0, 50.0, 1)), + p("brushSize", "Brush Size", num(6.0), slider(0.0, 200.0, 0.0, 50.0, 1)), p("brushHardness", "Brush Hardness", num(75.0), pct()), p("brushOpacity", "Brush Opacity", num(100.0), pct()), p("strokeLength", "Stroke Length (secs)", num(0.0), slider(0.0, 30.0, 0.0, 30.0, 1)), diff --git a/crates/effects/src/generate3/tests.rs b/crates/effects/src/generate3/tests.rs index deb0d7dda..be7c14ed7 100644 --- a/crates/effects/src/generate3/tests.rs +++ b/crates/effects/src/generate3/tests.rs @@ -197,6 +197,22 @@ fn write_on_and_glue_gun_draw_at_brush() { assert_eq!(g.img.get(0, 0), src.get(0, 0)); } +/// #2980: Brush Size of Write-on and Stroke goes up to 200 px as in After Effects (read back from +/// After Effects 2026: setting 201 is refused with "out of range 0 to 200"), and a brush that +/// wide paints that wide. +#[test] +fn brush_size_goes_up_to_200() { + for id in ["ec.generate.writeon", "ec.generate.stroke"] { + let spec = crate::find(id).unwrap(); + let size = spec.params.iter().find(|p| p.id == "brushSize").unwrap(); + assert!(matches!(size.ui, ParamUi::Slider { min, max, .. } if min == 0.0 && max == 200.0), "{id}: {:?}", size.ui); + } + let set = [("brushSize", num(120.0)), ("brushHardness", num(100.0)), ("brushPosition", Value::Vec2([128.0, 128.0]))]; + let wide = run("ec.generate.writeon", &set, Image::new(256, 256)); + assert!(wide.img.get(128 + 55, 128)[3] > 0.9, "radius 60 reaches 55 px from the centre"); + assert!(wide.img.get(128 + 70, 128)[3] == 0.0); +} + /// #536: an animated Brush Position draws a stroke that stays (Stroke Length 0), expires /// after Stroke Length, and lays its dabs Brush Spacing seconds apart. #[test]