Skip to content

Pausing AnimationAction with LoopPingPong while reversing : wrong keyFrame used #14486

@audifaxdev

Description

@audifaxdev
Description of the problem

I have a GLTF loaded Scene with animation and this is how I prepare the animation action :
action.reset().setEffectiveTimeScale(1).setLoop(LoopPingPong)

By ping round I mean the first part of a PingPong loop.
By pong round I mean the second/reverse part of a PingPong loop.
This issue only happens when pausing while reversing back (Pong).

Indeed, during the PongRound, pausing will cause the animation to use keyFrames from the Ping round instead of Pong. If the animation is at 10% of Pong when paused, the animated 3d object will be paused at 10% of Ping instead causing the object to jump to the wrong state.

In other words :

Say you have a 1 second animation with the PingPong loop mode. It needs 1 second to Ping and 1 second to Pong.

Pausing during Ping is working as intended, however :
Pausing during Pong at 1.2s will pause the object as if it was at .2s of the Ping animation.
Pausing during Pong at 1.5s will pause the object as if it was at .5s of the Ping animation.
Pausing during Pong at 1.8s will pause the object as if it was at .8s of the Ping animation.

Code for reference :

https://github.com/audifaxdev/my3js-starter-kit/tree/bug-pause-ping-pong-anim

Three.js version
  • r94
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions