Shapekeys exported named like "Morph 0".
With glTF-Blender-Exporter i can myself name to shapekeys. Its very convenient.
FYI, glTF-Blender-Exporter accomplished this by setting mesh.extras.targetNames on the mesh instance:
glTF has no proper mechanism for naming morph targets, but this workaround is accepted in a few tools.
^Probably the importer could use the same properties.
Thanks for the reply. I'm trying to make Makehuman models into a ingame character generator for Godot. And it turned out about 200 shape keys. Without names, it's a nightmare.
glTF-Blender-Exporter has some errors when exporting.
Animated characters not good. Some of the verticles (around 5 pieces from 14 000), standing to the random side. In the blender all fine. The weights are painted correctly.
glTF-Blender-IO work good, all verticles in their places. But can't naming shapekeys.
Sorry for my english.
For sure! I agree with this feature request, I'm just adding more information for others to weigh in. :)
@Lexpartizan, here's a temporary workaround:
Before exporting, put this in the text editor and run it
import bpy
for m in bpy.data.meshes:
target_names = [kb.name
for kb in (m.shape_keys.key_blocks if m.shape_keys else [])
if kb != kb.relative_key]
if target_names:
m['targetNames'] = target_names
then when you export make sure the General > Custom Properties box is ticked.
@Lexpartizan, here's a temporary workaround:
Before exporting, put this in the text editor and run it
then when you export make sure the General > Custom Properties box is ticked.
Thank you very much, it helped me a lot!
OK, added it on my TODO list for importer
Importer can now read extras data to name shapeKeys ( b3a78e0 )
@julienduroure :+1:
Do you think the extras.targetNames property should take precedence over getting the names from the accessors in the first primitive's morph targets?
@scurest Seems _extras.targetNames_ is already used in some other few tools.
I am ok to change it if there are some more used conventions
No, what I mean is that the importer already uses those accessor names to set keyblock names
and since it does this after it sets from extras.targetNames, the accessor names currently take priority over extras.targetNames. Do you think it should be the other way around?
Ah, you're right, my test cases didn't have default weights for shape keys, so it was not overwritten. Will change it
Hello, I am wondering on the status of getting this in the exporter. I would really appreciate having this functionality built into the blender 2.80 exporter.
Also, @scurest thank you for the work around script.
Importer part: targetNames has now priority in any cases
could also really use the ability to export shape key names, preferably without the user having to run a script in blender first! :) thanks for the great work
I'll work on exporter implementation.
Opened https://github.com/KhronosGroup/glTF-Blender-IO/pull/491, tests and/or reviews welcome. :)
Most helpful comment
Importer part: targetNames has now priority in any cases