Keep Essential Graphics instance keys out of nested comps that preserve their frame rate (#1682)

This commit is contained in:
MarekSpodBiedry
2026-11-01 07:39:48 +01:00
parent ec51e388fe
commit 25cf11493a
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -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.
+2 -2
View File
@@ -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.