Keyframes: auto-Bezier spatial tangents follow After Effects

Measured against After Effects 26.3 with the original
examples/ae-spatial-tangents.jsx (three paths, ten keys, even and uneven
timing): an auto-Bezier key's out tangent is (next - previous) / 6 and
the in tangent its mirror, whatever the key times; an end key uses its
one neighbour, (neighbour - key) / 6. EffectCraft gave end keys none and
scaled middle tangents by segment length, so paths with auto-Bezier keys
ran up to 28 px from AE's. All ten tangents now match; path samples are
within 0.05 px.

Tests that relied on end keys having no tangent now expect AE's: Spatial
Bezier keeps auto keys' handles (linear keys still get a third), the
motion-path handle is drawn at a sixth, and a straight loopOut path is
compared within 1e-9. docs/fidelity records the method and scores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Katt
2026-10-11 02:44:49 +05:30
co-authored by Claude Opus 5.5
parent 3b4036f536
commit 6240ed646e
7 changed files with 105 additions and 34 deletions
+5 -1
View File
@@ -588,7 +588,11 @@ fn loop_on_two_dimensional_position() {
let mut f = fx();
f.layer_mut(f.a).props.prop_mut(POS).unwrap().keys =
vec![Keyframe::new(secs(0.0), Value::Vec3([0.0, 0.0, 0.0])), Keyframe::new(secs(1.0), Value::Vec3([100.0, 50.0, 0.0]))];
assert_eq!(f.pos("loopOut('offset')", 1.5), [150.0, 75.0, 0.0]);
// The auto-Bezier keys have tangents along the line, so the path is sampled by arc length.
let p = f.pos("loopOut('offset')", 1.5);
for (got, want) in p.into_iter().zip([150.0, 75.0, 0.0]) {
assert_close!(got, want, 1e-9);
}
}
#[test]