Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Export morph targets names into mesh.extra #153

Merged
merged 2 commits into from
Feb 19, 2018

Conversation

takahirox
Copy link
Contributor

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#1036

Let's do that so far til morph target names is supported in core (maybe glTF next?) not to lose useful information.

@takahirox takahirox changed the title Export motph targets names into mesh.extra Export morph targets names into mesh.extra Jan 20, 2018
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 = []
Copy link
Contributor

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).

@takahirox
Copy link
Contributor Author

Done, thanks!

@huhtanen
Copy link

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?

@takahirox
Copy link
Contributor Author

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#morph-targets

All primitives are required to list the same number of targets in the same order.

@huhtanen
Copy link

Aha! Thank you for pointing this out.

@takahirox
Copy link
Contributor Author

/ping

@donmccurdy donmccurdy merged commit 59e7c73 into KhronosGroup:master Feb 19, 2018
@donmccurdy
Copy link
Contributor

Looks good thanks! 👏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants