-
Notifications
You must be signed in to change notification settings - Fork 189
Export morph targets names into mesh.extra #153
Conversation
if export_settings['gltf_morph']: | ||
if blender_mesh.shape_keys is not None: | ||
morph_max = len(blender_mesh.shape_keys.key_blocks) - 1 | ||
if morph_max > 0: | ||
weights = [] | ||
targetNames = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the variable name to target_names
here for consistency? (But exporting mesh['extras']['targetNames']
i agree with).
Done, thanks! |
How should the names be used in case of multiple primitives? In our case there's three primitives in a single mesh and only one of them has morph targets. Therefore, should the morph target names be per primitive, instead of being global per mesh? Mesh morph weights appear to have similar problem, so maybe I'm mis-interpreting the spec? |
|
Aha! Thank you for pointing this out. |
/ping |
Looks good thanks! 👏 |
glTF 2.0 doesn't have morph target names in core spec.
But storing them into
mesh.extra
is suggested in glTF spec issue thread KhronosGroup/glTF#1036Let's do that so far til morph target names is supported in core (maybe glTF next?) not to lose useful information.