Skip to content

Commit

Permalink
Fix makeAdditiveAnimation (#15099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popov72 committed May 14, 2024
1 parent e2fb481 commit f2599a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/dev/core/src/Animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export class Animation {
for (let index = startIndex; index <= endIndex; index++) {
let key = animation._keys[index];

if (clippedKeys) {
if (clippedKeys || options.cloneOriginalAnimation) {
key = {
frame: key.frame,
value: key.value.clone ? key.value.clone() : key.value,
Expand All @@ -481,11 +481,13 @@ export class Animation {
interpolation: key.interpolation,
lockedTangent: key.lockedTangent,
};
if (startFrame === Number.MAX_VALUE) {
startFrame = key.frame;
if (clippedKeys) {
if (startFrame === Number.MAX_VALUE) {
startFrame = key.frame;
}
key.frame -= startFrame;
clippedKeys.push(key);
}
key.frame -= startFrame;
clippedKeys.push(key);
}

// If this key was duplicated to create a frame 0 key, skip it because its value has already been updated
Expand Down

0 comments on commit f2599a5

Please sign in to comment.