Skip to content

Commit

Permalink
Merge pull request #600 from ousttrue/probeanchor_to_head
Browse files Browse the repository at this point in the history
set head to SkinnedMeshRenderer.probeAnchor
  • Loading branch information
hiroj authored Nov 16, 2020
2 parents 82de5ea + 9d1531d commit 4544cba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Assets/VRM/UniVRM/Scripts/Format/VRMImporterContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ private void LoadHumanoid()
animator = Root.AddComponent<Animator>();
}
animator.avatar = HumanoidAvatar;

// default としてとりあえず設定する
// https://docs.unity3d.com/ScriptReference/Renderer-probeAnchor.html
var head = animator.GetBoneTransform(HumanBodyBones.Head);
foreach (var smr in animator.GetComponentsInChildren<SkinnedMeshRenderer>())
{
smr.probeAnchor = head;
}
}
#endregion

Expand Down

0 comments on commit 4544cba

Please sign in to comment.