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

未关闭
#911 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, unity
领域
game-dev

调研方向

从 UnityGLTF 中运行时 humanoid avatar 创建路径开始,并使用附加的 Rigs.zip 文件复现该行为。将当前基于名称的处理方式与 issue 中描述的 hierarchy 和 .L/.R 后缀规则进行比较;当提供的 rig 无需重命名 bone 即可正确导入,同时现有受支持的 rig 仍可使用时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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 🩹
主要语言
C#
星标
2.3k
派生
539
平均合并
3 天 15 小时
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

KhronosGroup/UnityGLTF 的其他 Issue

查看 KhronosGroup/UnityGLTF 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。