KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.5k stars 319 forks source link

Shape keys marked as "Relative To" non-basis shapekeys are exported wrongly. #1403

Open chemicalcrux opened 3 years ago

chemicalcrux commented 3 years ago

Describe the bug If a shape key is set to be Relative To a non-Basis shape key, turning it on should only apply the deformation that would go from the Relative To shape key to itself. See below for a visual example.

Exporting to .gltf doesn't preserve this behavior.

To Reproduce Steps to reproduce the behavior:

These are probably excessively detailed!

  1. Delete the camera and light (they're just clutter)
  2. Add a Basis shape key to the cube
  3. Add another shape key, Key 1, and, with it selected, go into Edit Mode and raise the top face of the cube
  4. Go back into Object Mode.
  5. Set the influence of Key 1 to 1. The top of the cube should rise
  6. Click New Shape from Mix to create a new shape key, Key 2
  7. Set the influence of Key 2 to 1. Note how this further raises the cube's top face.
  8. Set the Relative To property of Key 2 to Key 1. The cube should now go back to how it looked at step 6.
  9. Go into Edit Mode and pull out one of the side faces of the cube.

At this point, turning on Key 1 but not Key 2 should raise the top of the cube, turning on Key 2 but not Key 1 should move the side of the cube, and turning on both should raise the top and the side of the cube.

  1. Export this cube as an .fbx and as a .glb/.gltf (same behavior with both options).
  2. Import the .fbx file
  3. Try turning on Key 1 and Key 2. They should behave exactly as they did on the cube you just created.
  4. Import the .glb file
  5. Try turning on Key 2. The cube's top and side will both move.

Expected behavior Key 2 should only make the cube's side move. This should mirror the behavior of the FBX exporter, which modifies the shape keys so that they keep working properly.

Screenshots

From left to right: Both keys off, Key 1 on, Key 2 on, both keys on. Key 2 is marked as relative to Key 1.

Expected behavior:

image

GLTF behavior:

image

.blend file/ .gltf Here's the original .blend file, plus the resulting FBX and GLTF files.

shape-key-bug.zip

Version

Additional context The FBX exporter doesn't actually preserve the Relative To property, since I don't think that concept exists outside of Blender.

julienduroure commented 3 years ago

This blender feature is not yet implemented in glTF exporter. Setting this ticket as "enhancement"