From 1bdf003ee116bb2792b8a475931022876ddf414c Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 13 Mar 2023 15:33:23 +0900 Subject: [PATCH 1/2] BvhImporterContext did not create BoxMan and HumanPoseTransfer --- Assets/VRM_Samples/SimpleViewer/ViewerUI.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs index 893d31ead..7987b9f97 100644 --- a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs @@ -225,8 +225,7 @@ namespace VRM.SimpleViewer var context = new UniHumanoid.BvhImporterContext(); context.Parse(path, source); context.Load(); - m_src = context.Root.GetComponent(); - m_src.GetComponent().enabled = false; + m_src = context.Root.GetOrAddComponent(); m_loaded?.EnableBvh(m_src); } From a37ae733f6810bc0bb64857277f60255585c0762 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 13 Mar 2023 15:39:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?AddComponent=E3=80=80HumanPoseTransfer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs | 2 ++ Assets/VRM_Samples/SimpleViewer/ViewerUI.cs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs b/Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs index 8bdafda8f..f50f4f577 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/IO/BvhImporterContext.cs @@ -116,6 +116,8 @@ namespace UniHumanoid AvatarDescription = description; var animator = Root.AddComponent(); animator.avatar = Avatar; + + Root.AddComponent(); } static Transform BuildHierarchy(Transform parent, BvhNode node, float toMeter) diff --git a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs index 7987b9f97..04942584a 100644 --- a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs @@ -225,7 +225,11 @@ namespace VRM.SimpleViewer var context = new UniHumanoid.BvhImporterContext(); context.Parse(path, source); context.Load(); - m_src = context.Root.GetOrAddComponent(); + m_src = context.Root.GetComponent(); + if (m_src == null) + { + throw new ArgumentNullException(); + } m_loaded?.EnableBvh(m_src); }