Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animations that end on intervals of 24-frames incorrectly return to their starting frame early #4050

Open
6 of 13 tasks
cpiggott opened this issue Jan 17, 2023 · 1 comment
Open
6 of 13 tasks

Comments

@cpiggott
Copy link
Contributor

Description

Something interesting that I have noted with animation today is that any animations that use 24fps and finish on an interval of 24 have an issue in Model Viewer. I have an animation that is 120 frames @ 24fps and an animation that is slightly longer 124 frames @ 24fps. The one that is 120 frames snaps back to the initial starting point of the animation before the animation completes when looping is turned off, but the animation that is 124 frames will stop at the end of the animation and then stay in place.

First, add the cubeanum.glb to the Model Editor and uncheck "Play" on the animation tab, dragging the slider all the way to the end(5.0 seconds), and the cube will snap back to its original location in the animation, but the animation frame is still at the end.

If you then upload the cubeanim_fixed.glb to Model Editor and do the same, you will see when the animation slider is dragged out to the end of the animation(5.04 seconds), the cube stays in the last frame of the animation and does not snap back. I have tested this with 3-second and 4-second animations as well, with the same breaking result where the animation snaps back to the original keyframe.

Broken: cubeanim.glb
Working: cubeanim_fixed.glb

If you don't want to download these files, create an animation in Blender where the keyframes end at an interval of 24fps.

Live Demo

Repro via Model Editor. I have provided two different GLBs above.

Version

  • model-viewer: Whatever Model-Editor is currently using

Browser Affected

  • Chrome, version: 108.0.5359.124
  • Edge
  • Firefox
  • IE - Did not test
  • Safari

OS

  • Android
  • iOS
  • Linux
  • MacOS
  • Windows

AR

  • WebXR
  • SceneViewer
  • QuickLook
@elalish
Copy link
Collaborator

elalish commented Jan 18, 2023

Yeah, that's not too surprising; I had to fight the three.js animation mixer pretty hard to get it to work this well. Would you mind checking if any of the prior releases worked properly? If so, something may have changed upstream that we have to account for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants