Page MenuHome

Fails to export shape key in GlTF with apply modifiers
Closed, ArchivedPublic

Description

System Information
Operating system: Windows 10 Home
Graphics card: "Intel HD Graphics 630 and "NVIDIA GeForce GTX 1060"

Blender Version
Broken: v2.81 Alpha Date 2019-09-07 16:22 Hash-abeab4fcad66
Worked: N/A

Short description of error

When exporting with the glTF 2 exporter and select "Apply Modifiers" as well as "Shape Keys", the shape keys are applied and not exported.

Why this is a bug

Shape keys should not be applied if the user has selected "Shape keys" to export, they should be exported even if "Apply Modifiers" was selected. This is because if the user has selected "Shape Keys" under export then they specifically want their shape keys exported.

Exact steps for others to reproduce the error

  1. Open the SuzanneShapeKey.blend file attached. (It was created by following the first 2 minutes and 6 seconds of this tutorial https://www.youtube.com/watch?v=e675Ulc7QL4)
  2. Select "File/Export/GLTF 2.0"
  3. Select "Apply Modifiers" under the general tab
  4. Select format "GLTF Binary" under the general tab (It should be the same for other formats)
  5. Select "Shape Keys" under the animation tab
  6. Click "Export GLTF 2.0"

#The shape keys were not exported. You can verify this in an external tool such as the Godot engine but also by following these steps in Blender:

  1. File/New/General
  2. File/Import/GLTF and then select the GLTF file you had previously exported
  3. Select Suzan under collections
  4. Select the Context. Object Data Tab
  5. You can see there are no shape keys

(ps. I did not mention any other bug reports in above text, I'm not sure why it's saying that I did)

Details

Type
Bug

Event Timeline

Ethan Chandler (Ortus) updated the task description. (Show Details)
Julien DUROURE (julien) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Sep 7 2019, 11:22 PM
Julien DUROURE (julien) lowered the priority of this task from Confirmed, Medium to Confirmed, Low.
Julien DUROURE (julien) raised the priority of this task from Confirmed, Low to Needs Triage by Developer.Sep 7 2019, 11:44 PM

Hello,

Seems to be a limitation of Blender. Same way you can't apply a modifier when there are some shapekeys, you can't export it this way.
(Note: this is also the behaviour of fbx export).

Oh ok... I did some more research and found out that some people use scripts like these (below) to get around this limitation.

https://github.com/naelstrof/ApplyModifierForObjectWithShapeKeys
https://github.com/Menithal/ApplyModifierForObjectWithShapeKeys
https://github.com/iszotic/ApplyModifierForObjectWithShapeKeys

Maybe useful. I believe it creates separate objects for each shape key, applies the modifiers to each of them, then combines the them all as shape keys into one object. I don't know if something like that could be be added into the export code to fix this problem? or if it counts as a feature request and not a bug?

Sorry I'm still kind-of new to Blender and this is my first bug report.

Julien DUROURE (julien) closed this task as Archived.Sep 9 2019, 9:35 AM

Hello,
Probably more a feature request than a bug, because this is the global behaviour of blender to work like that. Closing this, not really linked to glTF specifically.
This needs to be discussed with other developers if some workaround are possible or not.

Thanks !