From e4d879fd5cf9d2dccde2df420a11de781e61fce9 Mon Sep 17 00:00:00 2001 From: SteamSmith <341182916+SteamSmith@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:49:39 -0500 Subject: [PATCH 1/2] feat(bake): Auto-rebake treats the skew map as a bake input Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/auto_rebake.rs | 3 ++- crates/engine/tests/auto_rebake.rs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/auto_rebake.rs b/crates/engine/src/auto_rebake.rs index 039a3878..ef8e7714 100644 --- a/crates/engine/src/auto_rebake.rs +++ b/crates/engine/src/auto_rebake.rs @@ -2,7 +2,7 @@ //! //! The map is chosen with `bake.autoRebake`. From then on, [`Session::auto_rebake_due`] names the //! texture sets whose bake inputs (the set's bake settings except the list of maps, the low poly, -//! the high polys and the cage) differ from those of their last bake of that map. +//! the high polys, the cage and the skew map) differ from those of their last bake of that map. //! The apps poll it each frame and bake the due sets in the background; `bake.autoRebake.run` //! does the same thing once, blocking, for agents and scripts. //! @@ -71,6 +71,7 @@ impl Session { (Arc::as_ptr(&m.mesh) as usize).hash(&mut h); } self.bake_meshes.cage.as_ref().map(|c| Arc::as_ptr(&c.mesh) as usize).hash(&mut h); + (self.bake_meshes.skew.is_some(), self.bake_meshes.skew_rev).hash(&mut h); Some(h.finish()) } diff --git a/crates/engine/tests/auto_rebake.rs b/crates/engine/tests/auto_rebake.rs index c4fe8644..bae2c1bd 100644 --- a/crates/engine/tests/auto_rebake.rs +++ b/crates/engine/tests/auto_rebake.rs @@ -90,3 +90,20 @@ fn a_set_without_the_map_baked_is_left_alone() { execute(&mut s, "bake.settings", &json!({ "maxFrontal": 0.3 })).unwrap(); assert!(due(&mut s).is_empty(), "Auto-rebake keeps a bake up to date, it doesn't start one"); } + +#[test] +fn painting_or_clearing_the_skew_map_is_a_change() { + let (mut s, dir) = baked_session(); + execute(&mut s, "bake.autoRebake", &json!({ "map": "height" })).unwrap(); + assert!(due(&mut s).is_empty()); + execute(&mut s, "bake.skew.set", &json!({ "value": 0.5 })).unwrap(); + assert_eq!(due(&mut s), [0], "a skew map is a bake input"); + execute(&mut s, "bake.autoRebake.run", &json!({ "cpu": true })).unwrap(); + assert!(due(&mut s).is_empty()); + execute(&mut s, "bake.skew.paint", &json!({ "points": [[0.5, 0.5]], "size": 32 })).unwrap(); + assert_eq!(due(&mut s), [0], "so is a stroke painted into it"); + execute(&mut s, "bake.autoRebake.run", &json!({ "cpu": true })).unwrap(); + execute(&mut s, "bake.skew.clear", &Value::Null).unwrap(); + assert_eq!(due(&mut s), [0], "and so is taking it away"); + let _ = std::fs::remove_dir_all(dir); +} From 0f50eea9085495a4a759ac8cdb59d228dd7e54a0 Mon Sep 17 00:00:00 2001 From: SteamSmith <341182916+SteamSmith@users.noreply.github.com> Date: Mon, 2 Nov 2026 01:24:39 -0500 Subject: [PATCH 2/2] test: use the Auto-rebake test helper's new signature Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/tests/auto_rebake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/tests/auto_rebake.rs b/crates/engine/tests/auto_rebake.rs index 2cabe682..000b8441 100644 --- a/crates/engine/tests/auto_rebake.rs +++ b/crates/engine/tests/auto_rebake.rs @@ -120,7 +120,7 @@ fn a_set_without_the_map_baked_is_left_alone() { #[test] fn painting_or_clearing_the_skew_map_is_a_change() { - let (mut s, dir) = baked_session(); + let (mut s, dir) = baked_session("skew"); execute(&mut s, "bake.autoRebake", &json!({ "map": "height" })).unwrap(); assert!(due(&mut s).is_empty()); execute(&mut s, "bake.skew.set", &json!({ "value": 0.5 })).unwrap();