atteneder/glTFast

Stretch-and-squash implicit XZ scale changes not visible in Unity (but fine in MSFT 3D Builder)

Closed this issue · 1 comments

Describe the bug
Stretch and squash animation not imported as expected.
Expected:

  • to see horizontal axes (Unity's XZ) to scale out as the vertical (Unity Y) scale is reduced by the animation.
    Actual:
  • no change to the horizontal seen as vertical scales.
    Validation of expectation:
  • Microsoft 3D Builder importing the same file shows the horizontal scale.

Zip file includes video demonstrating difference, GLB file and blender source (can provide export settings used if needed).
This has an Action animation called "Hop" that scales the blender Z axis. It also has a "Maintain Volume" constraint which causes Blender's XY scale to change inversely proportionally to the Blender Z scale changes.
The fact that the MSFT tool sees presents the horizontal scale changes implies it's in the GLB. However Unity's does nothing with this..

Ran the file through the glTF Validator as instructed. No errors.

Files

For-bug-report.zip

To Reproduce
Steps to reproduce the behavior:

  1. Load the GLB file in an empty Unity project.
  2. In the "Project" tab, select the imported file
  3. Switch the "Animation" type to "Legacy".
  4. Press "Apply"
  5. Open Window | Animation | Animation
  6. Ensure the little target icon below the frame number "Filter by selection" is not selected (so you can see all timelines in the animation).
  7. Add prefab to an empty scene.
  8. Select the in-scene instance
  9. The animation should appear in the "Animation" window.
  10. Ensure "Preview" is selected in the "Animation" window.
  11. Move the time cursor to frame 2 (point of lowest Y scale where the XZ scale should be greatest).
  12. Observe lack of XZ scale change
  13. This correlates with lack of change if you switch the "Animation" window's to showing the the "Curves" (near bottom).

Expected behavior
Expect to see the XZ scale of the capsule mesh change.
This is seen in Blender (due to the "Maintain Volume" constraint).
This is seen in MSFT "3D Builder" GLB viewer (implying info is in the GLB).
It is not see in runtime nor Editor-time import.

Screenshots

20240423-gltfast-lacks-scale-xz.mp4

Desktop:

  • glTFast version:
    • Unity 2020.3.48 with glTFast 4.8.3 -- used in actual project.
    • Unity 2022.3.7 with Unity glTFast 6.3.0 -- reproduction with latest glTFast.
  • Unity Editor version 2022.3.7f1
  • Render Pipeline and version:
    • Unity 2020.3.48 with URP 10.10.1
    • Unity 2022.3.7 with built-in (and presumably URP)
  • Platform: Windows Editor

Additional context

Hi,

I've tested the glb asset in three alternative viewers:

  1. Khronos Sample Viewer (reference implementation)
  2. Don's glTF Viewer
  3. Gestaltor
  4. Blender (re-imported the glb)

None of them showed the squash'n'stretch effect, so I'm inclined to contradict you and say the the X/Z axis are not animated at all in the glTF (or have a static value). Maintain Volume also not a feature of the glTF core spec. Now it could be that the Microsoft 3D builder does it, but as far as I see not in alignment with the glTF specification.

Closing this now, but feel free to correct me if I missed something or post further questions.

Thanks