Exports all morph targets that are part of an gameobject's mesh.
Unity gives access to Morph Targets (blendshapes) via the
SkinnedMeshRenderer. We use that to gain access to the Mesh
that we export, and we loop through to get all blendshapes that
are on that Mesh.
We only export the final "frame" of the blendshape, as that is the
one that defines what the blendshape should look like at 100%
weight (given that glTF only supports a single frame of a blendshape).
Added an explicit Target object to the schema.
This was necessary due to covariant issues that couldn't be resolved
with a .NET 2.5 project (possibly solveable with a 4.x project type,
but Unity wouldn't let me change the .NET target). Mesh defines
Targets effectively as List<Dictionary<string, int>>, but we are
unable to convert that to IEnumerable<IEnumerable<string, int>> for
export. Given that, it was solveable by just creating an explicit
type that defines the three properties. The downside of this approach
is that these properties get camelCased out as opposed to being
UPPERCASE like the other attributes.
Added the ability to set the name for an accessor.
I didn't add this to every possible ExportData...only the ones that
were in the codepath that morph targets use. Given that there is no
way to store the name of a morph target anywhere else, we're storing
it as the name of the accessor for each attribute.
Exports all morph targets that are part of an
gameobject
's mesh.Added an explicit
Target
object to the schema.Added the ability to set the name for an accessor.