Fix single keyframe animations. (#14344)

# Objective

For clips with more than one curve, only the first was being applied if
there is only one keyframe in it.

## Solution

Continue!
This commit is contained in:
Al M. 2024-07-22 11:44:27 -07:00 committed by GitHub
parent 420f7f72dc
commit e06f4d4083
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

4
crates/bevy_animation/src/lib.rs Normal file → Executable file
View file

@ -875,12 +875,12 @@ impl AnimationTargetContext<'_> {
// Some curves have only one keyframe used to set a transform
if curve.keyframe_timestamps.len() == 1 {
self.apply_single_keyframe(curve, weight);
return;
continue;
}
// Find the current keyframe
let Some(step_start) = curve.find_current_keyframe(seek_time) else {
return;
continue;
};
let timestamp_start = curve.keyframe_timestamps[step_start];