Exporting Maya Blendshapes and Skinning to glTF

This article provides an overview of how Maya glTF exporters translate proprietary rigging and deformation data into standard glTF 2.0 assets. It covers the conversion of Maya's skinCluster nodes into glTF skins, joint indices, and inverse bind matrices, explains how blendShape deformers are transformed into morph targets and animated weight tracks, and details how the export pipeline aligns evaluation order to maintain visual fidelity across real-time 3D runtimes.

Skeletal Skinning Conversion

Maya handles skeletal deformation using the skinCluster node, which associates vertices on a mesh with joint influences and corresponding weights. During export, the glTF exporter translates this structure into the standard glTF skin element and per-vertex mesh attributes.

  1. Joint Hierarchy and References: The exporter traverses Maya's DAG (Directed Acyclic Graph) to identify joints bound to the skin cluster. These are mapped to an array of indices pointing to specific nodes within the glTF scene hierarchy.
  2. Inverse Bind Matrices: In Maya, the bind pose of each joint is recorded to calculate vertex offsets relative to joint movement. The exporter retrieves the joint's world-space inverse bind transformation matrix, flattens it, and serializes it into a dedicated buffer accessor referenced by the inverseBindMatrices property of the skin.
  3. Vertex Attributes (JOINTS_0 and WEIGHTS_0): For every vertex, the exporter extracts the joint indices and corresponding influence values from the skin cluster. glTF requires that weights per set sum to 1.0. Typically, glTF uses up to four influences per vertex stored in JOINTS_0 and WEIGHTS_0. If a vertex has more than four influences, the exporter either prunes the smallest weights and renormalizes the top four, or writes secondary attribute sets (JOINTS_1 and WEIGHTS_1) if the export configuration allows extended influences.

Blendshape Weights and Morph Targets

Maya defines shape modifications through blendShape deformers, which store target shapes as delta offsets relative to a base mesh. The glTF format handles these deformations using morph targets.

  1. Delta Calculations: Rather than exporting complete duplicate meshes, the glTF exporter calculates the difference (delta) between the neutral base geometry and each target geometry. These deltas are stored as arrays of morph targets under the mesh's primitives definition, containing delta positions (POSITION), delta normals (NORMAL), and delta tangents (TANGENT).
  2. Mesh Default Weights: The initial weight values defined in the Maya blendShape node are assigned to the root weights array of the glTF mesh object.
  3. Weight Animations: When blendshape weights are animated via keyframes in Maya, the exporter maps the anim curves to glTF animation samplers. These animations target the weights property of the node referencing the mesh, rather than the mesh data itself, using linear or cubic spline interpolation matching Maya's tangent settings.

Deformation Pipeline and Order of Operations

A critical challenge during export is preserving the correct order of evaluation. In Maya, deformation order is determined by the construction history upstream of the mesh shape.

The glTF 2.0 specification strictly dictates that morph targets must be calculated first, followed by skeletal skinning:

\[\text{Final Position} = \sum (\text{Joint Matrix} \times \text{Joint Weight}) \times (\text{Base Position} + \sum (\text{Target Delta} \times \text{Target Weight}))\]

Because of this fixed standard, the Maya glTF exporter expects the Maya scene's deformation order to feature the blendShape node before the skinCluster node. If a Maya asset has the skin cluster evaluated before the blendshape in its node history, the exporter may either reorder the data or warn the user, as failing to adhere to the morph-then-skin pipeline results in broken silhouettes and inaccurate deformations in target real-time engines.