engine: a keyframe on the out point no longer warns (#2084)

This commit is contained in:
Madhav Agarwal
2026-10-22 18:41:26 +05:30
parent 9a51a05e1b
commit 3f4ffdc0fc
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -179,7 +179,9 @@ pub(crate) fn key_time(layer: &Layer, frame_rate: FrameRate, p: &Value, param: &
pub(crate) fn key_timing(layer: &Layer, t: Tick) -> Value {
let ct = layer.comp_time(t);
let mut out = json!({"time": t.seconds(), "layerTime": t.seconds(), "compTime": ct.seconds()});
if !layer.is_active_at(ct) {
// A key exactly on the out point ends a fade normally: it is outside the half-open visible
// range, but it is not a caller mistake, so it does not warn (#2084).
if ct < layer.in_point || ct > layer.out_point {
out["warning"] = json!(format!(
"Keyframe at comp time {} s is outside the layer's active range [{} s, {} s).",
ct.seconds(),
+4 -1
View File
@@ -57,7 +57,10 @@ fn default_layer_times_are_preserved_and_outside_keys_warn() {
assert!(selected.get("warning").is_some());
let moved = s.execute("keys.set", json!({"layer": layer, "path": "transform/opacity", "time": 15.3, "newTime": 9.5, "timeBase": "layer"})).unwrap();
assert_seconds(&moved["compTime"], 20.0);
assert!(moved.get("warning").is_some(), "out point is exclusive");
assert!(moved.get("warning").is_none(), "a key on the out point is accepted");
let past = s.execute("prop.addKey", json!({"layer": layer, "path": "transform/rotation", "time": 20.1, "timeBase": "comp", "value": 45})).unwrap();
assert_seconds(&past["compTime"], 20.1);
assert!(past.get("warning").is_some(), "a key past the out point warns");
}
#[test]