mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-24 18:18:17 -06:00
engine: a keyframe on the out point no longer warns (#2084)
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user