From 8032697c9938ce704ef5d52256288a178a07b3e9 Mon Sep 17 00:00:00 2001 From: Rebornim <250083243+Rebornim@users.noreply.github.com> Date: Fri, 27 Nov 2026 06:41:17 +0000 Subject: [PATCH] Switch the channel off on the layer the Manage channels test reads The test read the set's bottom layer but switched roughness off on the selected one, so it stopped at its own precondition instead of checking textureSet.channels. --- crates/engine/src/set_cmds.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/set_cmds.rs b/crates/engine/src/set_cmds.rs index 24089c24..25fbee83 100644 --- a/crates/engine/src/set_cmds.rs +++ b/crates/engine/src/set_cmds.rs @@ -476,8 +476,9 @@ mod tests { fn channels_applied_to_every_set_keep_the_channels_a_layer_switched_off() { let mut s = Session::new_project("t", texturecraft_geom::primitives::material_ball(), "builtin:material_ball", None, 128).unwrap(); crate::execute(&mut s, "layer.add.fill", &json!({})).unwrap(); - let layer = s.doc.project.texture_sets[0].stack[0]; - crate::execute(&mut s, "layer.blend", &json!({"channel": "roughness", "enabled": false})).unwrap(); + let layer = s.selected_layer().unwrap(); + // Switched off, as layer.blend {enabled: false} leaves it + s.doc.project.layer_mut(layer).unwrap().channels.remove(&Channel::Roughness); let layer_has_roughness = |s: &Session| s.doc.project.layer(layer).is_ok_and(|l| l.channels.contains_key(&Channel::Roughness)); assert!(!layer_has_roughness(&s));