Skip to content

Commit

Permalink
Merge pull request #2014 from ousttrue/fix/simple_viewer
Browse files Browse the repository at this point in the history
[sample] SimpleViewer を修復(BvhImporterContext の挙動変更に追随)
  • Loading branch information
ousttrue authored Mar 13, 2023
2 parents e0ec1be + a37ae73 commit 2ba557c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public void Load()
AvatarDescription = description;
var animator = Root.AddComponent<Animator>();
animator.avatar = Avatar;

Root.AddComponent<HumanPoseTransfer>();
}

static Transform BuildHierarchy(Transform parent, BvhNode node, float toMeter)
Expand Down
5 changes: 4 additions & 1 deletion Assets/VRM_Samples/SimpleViewer/ViewerUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ private void LoadMotion(string path, string source)
context.Parse(path, source);
context.Load();
m_src = context.Root.GetComponent<HumanPoseTransfer>();
m_src.GetComponent<Renderer>().enabled = false;
if (m_src == null)
{
throw new ArgumentNullException();
}
m_loaded?.EnableBvh(m_src);
}

Expand Down

0 comments on commit 2ba557c

Please sign in to comment.