Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AvatarBuilder.BuildHumanAvatar には隠れたボーン名 HumanTrait.BoneName が必用 #1800

Merged
merged 4 commits into from
Sep 15, 2022

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue commented Sep 14, 2022

fixed #1799

HumanBodyBones.ToString != HumanTrait.BoneName であることに注意(指のみ。Space)。

分かりにくいので変数名、関数名をくどい感じにしました。

コード整理したら HumanBodyBones => HumanTrait.BoneName になった。
要するに Dictionary<HumanBodyBones, string>

HumanBodyBones.ToString != HumanTrait.BoneName であることに注意(指のみ。Space)
@ousttrue ousttrue added this to the v0.104 milestone Sep 14, 2022
@ousttrue ousttrue requested review from notargs and removed request for Santarh September 14, 2022 17:47
notargs
notargs previously approved these changes Sep 15, 2022
Copy link
Contributor

@notargs notargs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメント以外はLGTM 👍

cashedHumanTraitBoneName[i] = boneNames[i].Replace(" ", "");
}
}
// HumanTrait.BoneName 呼び出し毎にGCが発生
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントが雑になってわかりにくくなってる?

@ousttrue
Copy link
Contributor Author

コメント増量。

@@ -9,6 +9,7 @@

namespace UniHumanoid
{
// TODO: BoneLimit.cs に分ける(v0.104以降)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff が分かりにくくなるので、あとで

// * HumanTrait.BoneName
// * traitName.Replace
// * Enum.Parse
//
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HumanTrait.BoneName が問題の根源

traitName => (HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), traitName.Replace(" ", "")),
traitName => traitName);

// 逆引き
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enum.Parse がGC出ると書いた手前、逆引きもキャッシュすることにした

Copy link
Contributor

@notargs notargs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ousttrue ousttrue merged commit 3077d21 into vrm-c:master Sep 15, 2022
@ousttrue ousttrue deleted the fix/bone_trait_name branch January 24, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ロードすると humanoid アバターに指ボーンが含まれない
2 participants