Skeletons and Mutable - anticto/Mutable-Documentation GitHub Wiki

Overview

When working with mesh components, the generated mesh will likely have multiple mesh sections from different skeletal meshes merged. Some of those meshes may need additional bones other meshes don’t have. Having a single skeleton with all bones might be an option, but ideally, extra bones should be added to the skeletal meshes that need them.

Merging Skeletons.

Mutable allows participating meshes to have different skeletons as long as they are compatible. This means that the main skeleton of the reference mesh does not need to have all the bones that will be in use. At runtime, Mutable will merge the skeletons of the meshes involved in the generation, only the active ones, and return a Skeletal Mesh with the merged skeleton.

This feature allows for a more modular approach than adding extra bones to an existing skeleton. Still, it has its downsides, including the added cost of merging the skeleton at runtime and the possibility of additional work to adapt the animation to the new skeleton.

Using Linked Anim Graphs to animate the generated meshes.

Linked Anim Graph nodes can run multiple Anim BPs on a single component. This may be useful if you want one of the accessories to play a specific animation. Mutable can establish a correlation between animation instances and merged meshes to be linked to the component's Anim BP. See the animation-related properties of Skeletal Mesh and Table nodes.


Best practices.

Avoid merging complex skeletons.

The skeleton of a character’s head, like a MetaHuman head, may have hundreds, if not thousands, of bones and many additional data structures, such as anim curves. Merging these skeletons may be expensive. A good approach here would be to create a separate mesh component for these meshes.

For example, creating a skeletal mesh for the head and a mesh for the body and its accessories.

Reduce the number of skeletons to merge.

Sometimes, it is worth extending the base skeleton as long as it stays within a reasonable amount of bones.

For example, if a character can have a backpack and all backpacks add the same three bones to the base skeleton, having them in the base skeleton may be a good idea. This way, all backpacks can use the base skeleton, and there’s no need to merge two almost identical skeletons.