Files
test/source/blender/io
Michael Kowalski c6d61e8586 USD: Support armature and shape key export
New functionality to export armatures and shape keys as USD
skeletons and blend shapes.

Added "Armature", "Only Deform Bones" and "Shape Key" USD export options.

Added USDArmatureWriter class.

Extended USDMeshWriter to write skinned meshes for binding
with skeletons and 'neutral' meshes with blend shape targets.
Specifically, when exporting an armature, a skinned mesh is written
in its pre-modified rest position.  When exporting to blend shapes,
a mesh with shape keys is saved with its vertices in the shape key
basis shape position.

Added USDHierarchyIterator::process_usd_skel() function to
finish processing skeleton and blend shape export after the
writer instances completed writing.  This is necessary because
some of the export operations require processing multiple prims
at once.

Extended USDTransformWriter::do_write() to write transforms
sparsely, to avoid saving redundant transform values when exporting
armatures.

Added a create_skel_roots() function, called on the stage at the
end of the export.  This function attempts to ensure that skinned
prims and skeletons are encapsulated under SkelRoot primitives,
which is required in USD for correct skinning behavior.

When exporting blend shape animations for multiple meshes bound
to a single skeleton, we need to merge the blend shape time samples
of the different meshes into a single animation primitive at the end
of the export.  This requires some tricky book keeping, where the weight
time samples for a given mesh are initially saved by the mesh writer to a
temporary attribute on the mesh and are later copied to the animation
primitive as one of the final steps.

When writing blend shapes and skinned meshes, the pre-modified mesh
is exported.  This is to ensure that the number of blend shape offsets
matches the number of points, and so that the skinned mesh is saved in
its rest position.

Because the pre-modified mesh must be exported, modifiers in addition
to Armature modifiers will not be applied.  This still allows the round trip
UsdSkel -> Blender -> UsdSkel, but some additional setup might be
required to export to UsdSkel when there are multiple modifiers (for
example, applying mirroring modifiers that precede the armature
modifier).

Exporting bendy bones or absolute shape keys isn't currently
supported.

Co-authored-by: Charles Wardlaw <charleswardlaw@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/111931
2024-01-02 15:51:39 +01:00
..