mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
fix: [ESO] bounds are untransformed when root bone is inconsistent (#440)
Closes: #439
This commit is contained in:
parent
685e690d3a
commit
911dc7bb47
@ -142,7 +142,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
Transform rootBone = null, probeAnchor = null;
|
||||
Bounds bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS;
|
||||
|
||||
FindConsistentSettings(avatarRoot, ref probeAnchor, ref rootBone, ref bounds);
|
||||
FindConsistentSettings(avatarRoot, avatarHips.transform, ref probeAnchor, ref rootBone, ref bounds);
|
||||
|
||||
if (probeAnchor == null)
|
||||
{
|
||||
@ -168,6 +168,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
private static void FindConsistentSettings(
|
||||
GameObject avatarRoot,
|
||||
Transform avatarHips,
|
||||
ref Transform probeAnchor,
|
||||
ref Transform rootBone,
|
||||
ref Bounds bounds
|
||||
@ -210,8 +211,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
if (rootBone != skinnedMeshRenderer.rootBone)
|
||||
{
|
||||
rootBone = null; // inconsistent configuration
|
||||
bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS;
|
||||
rootBone = avatarHips; // inconsistent configuration
|
||||
bounds = TransformBounds(rootBone, ModularAvatarMeshSettings.DEFAULT_BOUNDS);
|
||||
}
|
||||
else if (Vector3.Distance(bounds.center, skinnedMeshRenderer.bounds.center) > 0.01f
|
||||
|| Vector3.Distance(bounds.extents, skinnedMeshRenderer.bounds.extents) > 0.01f)
|
||||
|
Loading…
Reference in New Issue
Block a user