From 25cf11493aec2e3ba7811e5a7b5c63e2d99a659e Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sun, 1 Nov 2026 07:39:48 +0100 Subject: [PATCH] Keep Essential Graphics instance keys out of nested comps that preserve their frame rate (#1682) --- crates/engine/src/tests/essential_more.rs | 10 ++++++++++ crates/render/src/fx_host.rs | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/essential_more.rs b/crates/engine/src/tests/essential_more.rs index a417d39ff..b3de8359c 100644 --- a/crates/engine/src/tests/essential_more.rs +++ b/crates/engine/src/tests/essential_more.rs @@ -252,6 +252,16 @@ fn one_control_with_targets_of_different_timing_stays_in_step() { } } +#[test] +fn instance_keys_stay_out_of_a_nested_comp_that_preserves_its_frame_rate() { + let (mut s, scene, inner, [a, _], inst) = keyed_instance([(0.0, 100.0), (0.0, 100.0)]); + std::sync::Arc::make_mut(&mut s.project).comp_mut(inner).unwrap().preserve_frame_rate = true; + // The nested time is floored to the nested comp's frames, so only the instance's value goes in. + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.25); + assert!((v - 25.0).abs() < 1e-6, "rendered {v}"); + assert!(pr.keys.is_empty()); +} + /// #1747: through a collapsed precomp, a Text override and a Font override of the same Source /// Text both apply: the Font merges into the overridden text, as `essential::with_overrides` /// does on the flattened path, instead of one entry replacing the other. diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index 655c01980..c5983ceca 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -184,7 +184,7 @@ fn effect_param<'a>(layer: &'a Layer, effect_index: usize, id: &str) -> Option<& /// Whether an instance's keys are in the nested comp's time, so they can go into the comp as they /// are: not with Time Remap, Responsive Design - Time (a stretched precomp with protected -/// regions). +/// regions) or a nested comp that preserves its frame rate (its time is floored to its own frames). fn keys_in_nested_time(ctx: &EvalCtx, layer: &Layer) -> bool { if layer.props.get("timeRemap").is_some() { return false; @@ -192,7 +192,7 @@ fn keys_in_nested_time(ctx: &EvalCtx, layer: &Layer) -> bool { let LayerSource::Comp { item } = layer.source else { return true }; let Some(nc) = ctx.project.comp(item) else { return true }; let responsive = (layer.stretch - 100.0).abs() > 1e-9 && !super::eval::protected_regions(nc).is_empty(); - !responsive + !responsive && !nc.preserve_frame_rate } /// The Essential Properties overrides of a precomp layer, evaluated at the context time.