Rig Mesh Transfer Tool

From Resonite Wiki
Revision as of 18:27, 11 February 2024 by PJB (talk | contribs) (Created page with "Category: Tools thumb|The Rig Mesh Transfer Tool The '''Rig Mesh Transfer Tool''' is a Tool for transferring meshes between rigs. It allows you to automatically update an existing object (such as an Avatar) with a new imported model, updating bone and blend shape information as necessary. == Where To Get The Tool == The Rig Mesh Transfer Tool may be found in Resonite Essentials. ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The Rig Mesh Transfer Tool

The Rig Mesh Transfer Tool is a Tool for transferring meshes between rigs. It allows you to automatically update an existing object (such as an Avatar) with a new imported model, updating bone and blend shape information as necessary.


Where To Get The Tool

The Rig Mesh Transfer Tool may be found in Resonite Essentials.

Using The Tool

Context menu showing options being described below
Rig Mesh Transfer Tool context menu

While equipped, your secondary action button will select an object to act as a "source". This should be the new version of the model you want to transfer from.

Selected Mesh: Test Avatar
HUD element showing selected object

The selected source mesh is visible in the corner of your screen while the tool is equipped. It can be cleared by using the "Clear source" Context menu button.

After a source mesh has been selected, you can use the primary action on a different object to transfer the meshes and bones.

Possible Issues

In the simplest of cases, the tool should be able to do everything automatically. However if there are more complex differences between the source and target (such as new or renamed meshes) the tool may need some babysitting.

The tool does not transfer or create materials on the target mesh. If the source mesh has new materials, these will not be rendered until you manually add to the SkinnedMeshRenderer's Materials list.

The tool can generally not nicely handle new meshes in the source (see below). If you're trying to add a new mesh like a clothing item, you may want to manually create a new Slot with a matching name and SkinnedMeshRenderer on the target, before using the tool.

Similarly, the tool will try to update all meshes on the target, so if you intentionally have a mesh on the target that does not exist on the source, it will probably get corrupted.

Transfer Algorithm

This is a detailed overview of the algorithm used by the tool in its operation. This may be useful to properly understand and diagnose the transfer process if something doesn't work.

First, the algorithm creates a map between the source and target armature bones. This is done by looking at the bones in both objects' Rigs, and bones are matched by name. If both objects have a VRIK, the solver bone references can also be used as a fallback match (this allows mapping between different armatures that both following the Humanoid Rig Requirements for IK).

Second, the algorithm goes over all the SkinnedMeshRenderers in the target and tries to match them to a component on the source. This is first matched by exact name, but otherwise falls back to picking the mesh with the closest vertex count. The new mesh asset is copied from the source, blend weights are synchronized, and bones are linked to the armature.

Third, if the target has a VRIKAvatar and VisemeAnalyzer, visemes are set up again on the target.

Finally, the target's Rig is updated to contain all bones.

See Also