donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.3k stars 145 forks source link

Resampling should include morph target animations #290

Closed hybridherbst closed 1 year ago

hybridherbst commented 2 years ago

Describe the bug Seems that resampling is missing some condition for removing/keeping keyframes. The attached animation breaks after resampling.

To Reproduce Steps to reproduce the behavior:

  1. Download pfc-head-resampling-issue.zip
  2. Run gltf-transform resample pfc-head-resampling-issue.glb out.glb
  3. Watch both the original and the result in https://sandbox.babylonjs.com/

Expected behavior Resampled animation looks the same as the original animation but might be smaller file size. Actual: resampled animation is smaller but looks very different / wrong; mesh breaks in some places.

Additional context Original vs. Resampled 210714-162338589 210714-162407417

donmccurdy commented 2 years ago

Next release will have a fix (https://github.com/donmccurdy/glTF-Transform/commit/ab96756c12ddc52ed3f1f648fc0b1023cabbe543) to at least skip these samplers during the resampling process and not break anything. I'll need to do some more work to get the resampling right for morph targets.

donmccurdy commented 1 year ago

Fix upcoming in https://github.com/donmccurdy/glTF-Transform/pull/934.