diff --git a/packages/dev/core/src/Animations/animatable.core.ts b/packages/dev/core/src/Animations/animatable.core.ts index e831c66c558..9177f4ce8d7 100644 --- a/packages/dev/core/src/Animations/animatable.core.ts +++ b/packages/dev/core/src/Animations/animatable.core.ts @@ -283,8 +283,9 @@ export class Animatable { /** * Jump directly to a given frame * @param frame defines the frame to jump to + * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default) */ - public goToFrame(frame: number): void { + public goToFrame(frame: number, useWeight = false): void { const runtimeAnimations = this._runtimeAnimations; if (runtimeAnimations[0]) { @@ -295,7 +296,7 @@ export class Animatable { } for (let index = 0; index < runtimeAnimations.length; index++) { - runtimeAnimations[index].goToFrame(frame, this._weight); + runtimeAnimations[index].goToFrame(frame, useWeight ? this._weight : -1); } this._goToFrame = frame; diff --git a/packages/dev/core/src/Animations/animationGroup.ts b/packages/dev/core/src/Animations/animationGroup.ts index d28921d3766..8d6782208b6 100644 --- a/packages/dev/core/src/Animations/animationGroup.ts +++ b/packages/dev/core/src/Animations/animationGroup.ts @@ -850,16 +850,17 @@ export class AnimationGroup implements IDisposable { /** * Goes to a specific frame in this animation group. Note that the animation group must be in playing or paused status * @param frame the frame number to go to + * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default) * @returns the animationGroup */ - public goToFrame(frame: number): AnimationGroup { + public goToFrame(frame: number, useWeight = false): AnimationGroup { if (!this._isStarted) { return this; } for (let index = 0; index < this._animatables.length; index++) { const animatable = this._animatables[index]; - animatable.goToFrame(frame); + animatable.goToFrame(frame, useWeight); } return this;