From a0902005f7273da9c3e280e8527648b59cdacbc0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 06:00:56 -0800 Subject: [PATCH] Blend: the setEasing docs list the easing types and say when a blend made without a spine takes easing docs/mcp.md lists the four easingType values. It and the object.blend.setEasing params text say that a blend made without a spine takes easingType and ramp once Replace Spine has given it one, which the set_easing test now checks. --- crates/engine/src/cmd/live/commands.rs | 2 +- crates/engine/src/tests/blendopts.rs | 6 ++++++ docs/mcp.md | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/live/commands.rs b/crates/engine/src/cmd/live/commands.rs index 4cbc5e130f..980983519f 100644 --- a/crates/engine/src/cmd/live/commands.rs +++ b/crates/engine/src/cmd/live/commands.rs @@ -54,7 +54,7 @@ pub fn specs() -> Vec { "Blend Easing", [], None, - "{id? (default: the first selected blend), easingType?: easeIn|easeOut|easeInOut|easeOutIn, ramp?: pct (0..100), colorShift?: pct (-100..100)} set one blend's easing and color shift, as the blend widgets on the canvas do; omitted ones keep their value. easingType and ramp need a blend whose steps follow a spine (a replaced or edited spine, or Align to Path, on a blend not made without a spine); out of range, a hidden or locked blend and a blend with no spine are errors. A value that changes nothing records no undo step → {id, easingType, ramp, colorShift, changed}", + "{id? (default: the first selected blend), easingType?: easeIn|easeOut|easeInOut|easeOutIn, ramp?: pct (0..100), colorShift?: pct (-100..100)} set one blend's easing and color shift, as the blend widgets on the canvas do; omitted ones keep their value. easingType and ramp need a blend whose steps follow a spine (a replaced or edited spine, or Align to Path); a blend made without a spine takes them once Replace Spine has given it one; out of range, a hidden or locked blend and a blend with no spine are errors. A value that changes nothing records no undo step → {id, easingType, ramp, colorShift, changed}", has_doc, blend_set_easing ), diff --git a/crates/engine/src/tests/blendopts.rs b/crates/engine/src/tests/blendopts.rs index a71e835108..93f531d1e8 100644 --- a/crates/engine/src/tests/blendopts.rs +++ b/crates/engine/src/tests/blendopts.rs @@ -481,6 +481,12 @@ fn set_easing_edits_one_blend_and_refuses_what_it_cannot_set() { assert_eq!(depth(&s), d3); s.execute("object.blend.setEasing", &json!({"id": n.0, "colorShift": 10})).unwrap(); assert_eq!(spec(&s, n).1.color_shift, 10.0); + // Replace Spine gives it a spine, and it takes easing from then on. + let path = id_of(&s.execute("path.create", &json!({"d": "M0 320 L200 320"})).unwrap()); + sel(&mut s, &[n, path]); + s.execute("object.blend.replaceSpine", &json!({})).unwrap(); + let r = s.execute("object.blend.setEasing", &json!({"id": n.0, "easingType": "easeOut", "ramp": 30})).unwrap(); + assert_eq!((&r["easingType"], &r["ramp"], &r["changed"]), (&json!("easeOut"), &json!(30.0), &json!(true))); } /// Dragging a blend widget with the Selection tool or the Blend tool is one undo step; a click, a diff --git a/docs/mcp.md b/docs/mcp.md index 2e4536c069..05ec24d69e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8754,9 +8754,10 @@ so its point at `t` moves by (dx, dy), turning a straight spine into a curve (`p `object.blend.setEasing {id?, easingType?, ramp?, colorShift?}` sets one blend's easing and color shift (the first selected blend without `id`) and returns `{id, easingType, ramp, colorShift, changed}`; omitted values are kept. -`ramp` is 0 to 100 and `colorShift` -100 to 100. `easingType` and `ramp` need a blend whose steps follow a spine (a -replaced or edited spine, or `orientation: "path"`) and not made without one (`createSpine: "never"`), as the Blend -panel's Type and Ramp do. A value out of range, a hidden or locked blend and a target that is not a blend are errors, +`easingType` is `easeIn`, `easeOut`, `easeInOut` or `easeOutIn`, `ramp` is 0 to 100 and `colorShift` -100 to 100. +`easingType` and `ramp` need a blend whose steps follow a spine (a replaced or edited spine, or +`orientation: "path"`), as the Blend panel's Type and Ramp do. A blend made without a spine +(`createSpine: "never"`) takes them once Replace Spine has given it one. A value out of range, a hidden or locked blend and a target that is not a blend are errors, and a call that changes nothing records no undo step (`changed: false`). With one blend selected that has a spine, the Selection and Blend tools show the same values as widgets 16 px above and below the spine's halfway point (where the boxes of three or more other visible objects hold that