Avatar Importing: mudanças entre as edições

De TriLib
Ir para navegação Ir para pesquisar
Sem resumo de edição
Sem resumo de edição
 
Linha 3: Linha 3:
TriLib allows importing characters to use as Unity Avatars.
TriLib allows importing characters to use as Unity Avatars.


 
To achieve this, TriLib uses classes that inherit the <code>HumanoidAvatarMapper</code> class, which are responsible for mapping the character bones with Unity Avatar Humanoid Muscles.
 
To achieve this, TriLib uses classes that inherit the [https://ricardoreis.net/trilib/trilib2/docs/class_tri_lib_core_1_1_mappers_1_1_humanoid_avatar_mapper.html HumanoidAvatarMapper] class, which are responsible for mapping the character bones with Unity Avatar Humanoid Muscles.


TriLib comes with the Mixamo and Biped Humanoid Avatar Mapper, which contains the settings to load characters rigged in Mixamo or created using 3Ds Max Biped, among other standard bone hierarchies.
TriLib comes with the Mixamo and Biped Humanoid Avatar Mapper, which contains the settings to load characters rigged in Mixamo or created using 3Ds Max Biped, among other standard bone hierarchies.


You can easily include your bone-mapping schemes by inheriting the [https://ricardoreis.net/trilib/trilib2/docs/class_tri_lib_core_1_1_mappers_1_1_by_name_humanoid_avatar_mapper.html ByNameHumanoidAvatarMapper] class or simply creating an instance from the class in your Assets and manually adding name-mapping.
You can easily include your bone-mapping schemes by inheriting the <code>ByNameHumanoidAvatarMapper</code> class or simply creating an instance from the class in your Assets and manually adding name-mapping.
 
 


If you have a different bone-hierarchy and you don't want to build one Avatar Mapper programatically, you can use the Mixamo and Biped Avatar Mapper as a template.
If you have a different bone-hierarchy and you don't want to build one Avatar Mapper programatically, you can use the Mixamo and Biped Avatar Mapper as a template.


Just click with the right mouse button in your "Project Explorer" inside Unity and select "Create->TriLib->Mappers->Humanoid-> Mixamo and Biped by Name Humanoid Avatar Mapper".
Just click with the right mouse button in your "Project Explorer" inside Unity and select "'''Create->TriLib->Mappers->Humanoid-> Mixamo and Biped by Name Humanoid Avatar Mapper'''".


[[Arquivo:By Name Avatar Humanoid Avatar Mapper Editor.png|alt=]]
[[Arquivo:By Name Avatar Humanoid Avatar Mapper Editor.png|alt=]]


When creating the Avatar Mapper, you can set up the name matching by editing the generated Prefab.
When creating the Avatar Mapper, you can set up the name matching by editing the generated Prefab:  
 
The highlights are:


1) This is the list of the bones name-matching.
1) This is the list of the bones name-matching.
Linha 30: Linha 24:




You can then use the generated Prefab into your AssetLoaderOptions.AvatarMapper field.
 
You can then use the generated Prefab into your <code>AssetLoaderOptions.AvatarMapper</code> field.


Here is a sample with all bone names accepted by the Mixamo and Biped Humanoid Avatar Mapper:
Here is a sample with all bone names accepted by the Mixamo and Biped Humanoid Avatar Mapper:

Edição atual tal como às 08h57min de 18 de maio de 2024

TriLib allows importing characters to use as Unity Avatars.

To achieve this, TriLib uses classes that inherit the HumanoidAvatarMapper class, which are responsible for mapping the character bones with Unity Avatar Humanoid Muscles.

TriLib comes with the Mixamo and Biped Humanoid Avatar Mapper, which contains the settings to load characters rigged in Mixamo or created using 3Ds Max Biped, among other standard bone hierarchies.

You can easily include your bone-mapping schemes by inheriting the ByNameHumanoidAvatarMapper class or simply creating an instance from the class in your Assets and manually adding name-mapping.

If you have a different bone-hierarchy and you don't want to build one Avatar Mapper programatically, you can use the Mixamo and Biped Avatar Mapper as a template.

Just click with the right mouse button in your "Project Explorer" inside Unity and select "Create->TriLib->Mappers->Humanoid-> Mixamo and Biped by Name Humanoid Avatar Mapper".

When creating the Avatar Mapper, you can set up the name matching by editing the generated Prefab:

1) This is the list of the bones name-matching.

2) The "Human Bone" dropdown lets you select the Unity Humanoid Bone to be mapped on the given item.

3) The "Bone Names" list lets you add multiple Transform names to be matched when TriLib is trying to find the right Transform for the given item.


You can then use the generated Prefab into your AssetLoaderOptions.AvatarMapper field.

Here is a sample with all bone names accepted by the Mixamo and Biped Humanoid Avatar Mapper:

Notes:

  • Your model must be in T-Pose or Star-Pose.
  • Only FBX and GLTF file formats work as Avatars.


You can test your Avatars at:

https://ricardoreis.net/trilib/trilib2demo/avatarloader/