Better implementation of humanoid avatar creation (use hierarchy instead of names)

Ouverte
#911 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp, unity
Domaine
game-dev

Piste de recherche

Commencez par le chemin de création d’avatars humanoïdes à l’exécution dans UnityGLTF et reproduisez le comportement à l’aide des fichiers Rigs.zip joints. Comparez le traitement actuel basé sur les noms avec les règles de hiérarchie et de suffixes .L/.R décrites dans l’issue ; le travail est considéré comme terminé lorsque le rig fourni s’importe correctement sans renommer les bones et que les rigs déjà pris en charge restent utilisables.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Describe the bug 💬

(not a bug but choosing a different issue template does not work)

Humanoid avatar creation has been a pain point for a few people it seems (me included), especially considering there is no way to configure it.

As others have mentioned the way the FBX importer handles this is opaque and undisclosed, but one thing I am certain of is that it does not care about the names of the bones (apart maybe to differentiate left and right bones). It only expects a specific hierarchy.

We should find the hips bone, which is the first bone with three children including two that have respectively a .L and .R suffix.
Then we walk the .L and .R bones which are the legs, first bone is upper leg, seconds lower, third is the foot etc.
The last child of the hips is the spine, walk along it until we find the same pattern as the hips, .L is left arm and .R the right.
If the arms only contain three bones then we skip the shoulder, because it's optional.

You get the idea.

Here's a rig I made without renaming the bones apart from .L and .R suffixes, everything gets assigned automatically correctly:
Image

I have attached both a .glb and .fbx file of the rig.

Steps to reproduce 🔢

Rigs.zip

Files to reproduce the issue ♻

No response

Editor Version 🎲

6000.0

Render Pipeline and version

URP

UnityGLTF Version

2.20.0

Operating System 👩‍💻

Linux

When does this problem happen?
  • Editor Import
  • Runtime Import
  • Editor Export
  • Runtime Export
Additional Info 📜

@XtroTheArctic this is probably of interest to you.

I might make a PR myself and implement this since it's not that big of a change. Maybe we should keep the name dictionary just so other people's rigs that worked don't get broken (although if they do get broken they probably didn't respect the hierarchy that mecanim expects anyway).

Validations 🩹
Langage dominant
C#
Étoiles
2.3k
Forks
539
Merge moyen
3 j 15 h
PR mergées (30 j)
2

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de KhronosGroup/UnityGLTF

Toutes les issues de KhronosGroup/UnityGLTF

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.