From 698628c5c73f5223a06e5a5dcc5e46da6c59abe6 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sun, 8 Nov 2026 16:42:13 +0100 Subject: [PATCH] Footage cache (#3271): ID Matte's Use Coverage stays animatable, as in After Effects After Effects 2026 reports ID Matte's Use Coverage as able to vary over time and take an expression (Aux. Channel and 3D Channel Extract's 3D Channel can't), so it is animatable again. ID Matte now reads the coverage channel whether Use Coverage is on or off: what a frame reads still doesn't depend on a value that moves. A test checks the need is the same both ways and which ID Matte parameters are static. --- crates/effects/src/channel3d.rs | 27 +++++++++++++++++++-------- docs/footage.md | 3 +-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/crates/effects/src/channel3d.rs b/crates/effects/src/channel3d.rs index 728cbc903..146c98bdf 100644 --- a/crates/effects/src/channel3d.rs +++ b/crates/effects/src/channel3d.rs @@ -50,7 +50,7 @@ const CHANNEL_PARAMS: [(&str, &[&str]); 5] = [ ("ec.3d.channelextract", &["channel"]), ("ec.3d.cryptomatte", &["layer", "layerName"]), ("ec.3d.extractor", &["red", "green", "blue", "alpha"]), - ("ec.3d.idmatte", &["auxChannel", "useCoverage"]), + ("ec.3d.idmatte", &["auxChannel"]), ("ec.3d.identifier", &["channelType"]), ]; @@ -87,13 +87,9 @@ pub fn aux_needs(id: &str, params: &crate::Params) -> Option> { _ => vec![find(&["R"]), find(&["G"]), find(&["B"])], }, "ec.3d.depthmatte" | "ec.3d.depthoffield" | "ec.3d.fog3d" => vec![find(&DEPTH_NAMES)], - "ec.3d.idmatte" => { - let mut v = vec![ids(params.e("auxChannel"))]; - if params.b("useCoverage") { - v.push(find(&COVERAGE_NAMES)); - } - v - } + // (Use Coverage can be animated, as in After Effects: its channel is read whatever its + // value, so the need doesn't change over time) + "ec.3d.idmatte" => vec![ids(params.e("auxChannel")), find(&COVERAGE_NAMES)], "ec.3d.identifier" => vec![ids(params.e("channelType"))], "ec.3d.cryptomatte" => vec![AuxLookup::Crypto { name: params.s("layerName").to_string(), index: params.e("layer") as usize }], // (an empty name reads the layer's own channel) @@ -851,6 +847,21 @@ mod tests; #[cfg(test)] mod aux_need_tests { + /// #3271: ID Matte's Use Coverage can be animated (as in After Effects): the coverage channel + /// is read whether it is on or off, so what a frame reads doesn't depend on it. + #[test] + fn id_matte_reads_coverage_either_way() { + let spec = crate::find("ec.3d.idmatte").expect("an effect"); + let mut params = crate::Params { values: spec.params.iter().map(|p| (p.id.to_string(), p.default.clone())).collect() }; + let off = super::aux_needs("ec.3d.idmatte", ¶ms); + params.values.insert("useCoverage".into(), effectcraft_keyframe::Value::Bool(true)); + let on = super::aux_needs("ec.3d.idmatte", ¶ms); + assert_eq!(off, on); + assert_eq!(on.map(|v| v.len()), Some(2), "the ID channel and the coverage channel"); + assert!(!super::selects_channels("ec.3d.idmatte", "useCoverage"), "animatable"); + assert!(super::selects_channels("ec.3d.idmatte", "auxChannel"), "static"); + } + /// #3271: every effect that reads its layer's channels says which (else a frame would read /// all of them, or none). #[test] diff --git a/docs/footage.md b/docs/footage.md index 55da1f772..31db3e89b 100644 --- a/docs/footage.md +++ b/docs/footage.md @@ -134,8 +134,7 @@ file at once wait for one decode. Once no enabled effect reads the item any more go back to the picture's channels alone. The parameters that pick channels (EXtractoR's Red, Green, Blue and Alpha, Cryptomatte's Layer -and Layer Name, 3D Channel Extract's 3D Channel, ID Matte's Aux. Channel and Use Coverage, -IDentifier's Channel Type) can't be animated, as in After Effects, where they have no +and Layer Name, 3D Channel Extract's 3D Channel, ID Matte's Aux. Channel, IDentifier's Channel Type) can't be animated, as in After Effects, where they have no stopwatch either: they take no keyframes and no expression. A document that animated one opens with its first value.