From 7d6f835ffe0cccc2467bc80f2824a86d2f4190aa Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 13 Sep 2022 14:39:40 +0900 Subject: [PATCH] UniVRM-0.103.1 --- .../UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs | 4 ++-- Assets/UniGLTF/package.json | 4 ++-- Assets/VRM/Runtime/Format/VRMVersion.cs | 4 ++-- .../VRM.Samples.SimpleViewer.asmdef | 1 + Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs | 19 +++++++++++++++---- Assets/VRM/package.json | 6 +++--- .../VRM10.Samples.VRM10Viewer.asmdef | 4 +++- .../Samples~/VRM10Viewer/VRM10ViewerUI.cs | 5 +++-- Assets/VRM10/package.json | 6 +++--- Assets/VRMShaders/package.json | 2 +- 10 files changed, 35 insertions(+), 20 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs index b6a4b11e72..d5c612ff13 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UniGLTFVersion.cs @@ -5,7 +5,7 @@ public static partial class UniGLTFVersion { public const int MAJOR = 2; public const int MINOR = 39; - public const int PATCH = 0; - public const string VERSION = "2.39.0"; + public const int PATCH = 1; + public const string VERSION = "2.39.1"; } } diff --git a/Assets/UniGLTF/package.json b/Assets/UniGLTF/package.json index 8f6dd6b7e7..577545d6c2 100644 --- a/Assets/UniGLTF/package.json +++ b/Assets/UniGLTF/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.gltf", - "version": "0.103.0", + "version": "0.103.1", "displayName": "UniGLTF", "description": "GLTF importer and exporter", "unity": "2019.4", @@ -11,7 +11,7 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.103.0", + "com.vrmc.vrmshaders": "0.103.1", "com.unity.modules.animation": "1.0.0" } } \ No newline at end of file diff --git a/Assets/VRM/Runtime/Format/VRMVersion.cs b/Assets/VRM/Runtime/Format/VRMVersion.cs index 1a8a981ebf..c20e6375d2 100644 --- a/Assets/VRM/Runtime/Format/VRMVersion.cs +++ b/Assets/VRM/Runtime/Format/VRMVersion.cs @@ -5,7 +5,7 @@ public static partial class VRMVersion { public const int MAJOR = 0; public const int MINOR = 103; - public const int PATCH = 0; - public const string VERSION = "0.103.0"; + public const int PATCH = 1; + public const string VERSION = "0.103.1"; } } diff --git a/Assets/VRM/Samples~/SimpleViewer/VRM.Samples.SimpleViewer.asmdef b/Assets/VRM/Samples~/SimpleViewer/VRM.Samples.SimpleViewer.asmdef index 34e7e556d4..6db561b0be 100644 --- a/Assets/VRM/Samples~/SimpleViewer/VRM.Samples.SimpleViewer.asmdef +++ b/Assets/VRM/Samples~/SimpleViewer/VRM.Samples.SimpleViewer.asmdef @@ -1,5 +1,6 @@ { "name": "VRM.Samples.SimpleViewer", + "rootNamespace": "", "references": [ "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:b7aa47b240b57de44a4b2021c143c9bf", diff --git a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs index b9e034fdc6..41dc1ce84c 100644 --- a/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM/Samples~/SimpleViewer/ViewerUI.cs @@ -327,7 +327,7 @@ private void Start() string[] cmds = System.Environment.GetCommandLineArgs(); if (cmds.Length > 1) { - LoadModelAsync(cmds[1]); + LoadPathAsync(cmds[1]); } m_texts.Start(); @@ -391,10 +391,20 @@ void OnOpenClicked() return; } - LoadModelAsync(path); + LoadPathAsync(path); } - async void LoadModelAsync(string path, byte[] bytes = null) + async void LoadPathAsync(string path) + { + if (!File.Exists(path)) + { + Debug.LogWarning($"{path} not exists"); + return; + } + LoadModelAsync(path, File.ReadAllBytes(path)); + } + + async void LoadModelAsync(string path, byte[] bytes) { var size = bytes != null ? bytes.Length : 0; Debug.Log($"LoadModelAsync: {path}: {size}bytes"); @@ -406,9 +416,10 @@ async void LoadModelAsync(string path, byte[] bytes = null) case ".glb": case ".zip": { - var instance = await GltfUtility.LoadBytesAsync(path, bytes, + var instance = await GltfUtility.LoadAsync(path, GetIAwaitCaller(m_useAsync.isOn), GetGltfMaterialGenerator(m_useUrpMaterial.isOn)); + SetModel(instance); break; } diff --git a/Assets/VRM/package.json b/Assets/VRM/package.json index c92a09cfef..aedebe7243 100644 --- a/Assets/VRM/package.json +++ b/Assets/VRM/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.univrm", - "version": "0.103.0", + "version": "0.103.1", "displayName": "VRM", "description": "VRM importer", "unity": "2019.4", @@ -14,8 +14,8 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.103.0", - "com.vrmc.gltf": "0.103.0", + "com.vrmc.vrmshaders": "0.103.1", + "com.vrmc.gltf": "0.103.1", "com.unity.ugui": "1.0.0" }, "samples": [ diff --git a/Assets/VRM10/Samples~/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef b/Assets/VRM10/Samples~/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef index 1082f824ba..dc15df0862 100644 --- a/Assets/VRM10/Samples~/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef +++ b/Assets/VRM10/Samples~/VRM10Viewer/VRM10.Samples.VRM10Viewer.asmdef @@ -1,10 +1,12 @@ { "name": "VRM10.Samples.VRM10Viewer", + "rootNamespace": "", "references": [ "GUID:b7aa47b240b57de44a4b2021c143c9bf", "GUID:da3e51d19d51a544fa14d43fee843098", "GUID:8d76e605759c3f64a957d63ef96ada7c", - "GUID:e47c917724578cc43b5506c17a27e9a0" + "GUID:e47c917724578cc43b5506c17a27e9a0", + "GUID:1cd941934d098654fa21a13f28346412" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs b/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs index d29896e853..a400bd7972 100644 --- a/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs +++ b/Assets/VRM10/Samples~/VRM10Viewer/VRM10ViewerUI.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading; using UniGLTF; +using UniGLTF.Utils; using UniHumanoid; using UnityEngine; using UnityEngine.UI; @@ -276,7 +277,7 @@ public void UpdatePose(bool useBvh, Animator bvhAnimator) { var controlRig = m_controller.Runtime.ControlRig; - foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones))) + foreach (HumanBodyBones bone in CachedEnum.GetValues()) { if (bone == HumanBodyBones.LastBone) { @@ -300,7 +301,7 @@ public void UpdatePose(bool useBvh, Animator bvhAnimator) if (bone == HumanBodyBones.Hips) { - controlRigBone.position = bvhBone.position * controlRig.InitialHipsHeight; + controlRigBone.localPosition = bvhBone.localPosition * controlRig.InitialHipsHeight; } } else diff --git a/Assets/VRM10/package.json b/Assets/VRM10/package.json index 8b27e6ee92..8f85003f27 100644 --- a/Assets/VRM10/package.json +++ b/Assets/VRM10/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.vrm", - "version": "0.103.0", + "version": "0.103.1", "displayName": "VRM-1.0β", "description": "VRM-1.0β importer", "unity": "2019.4", @@ -14,8 +14,8 @@ "name": "VRM Consortium" }, "dependencies": { - "com.vrmc.vrmshaders": "0.103.0", - "com.vrmc.gltf": "0.103.0" + "com.vrmc.vrmshaders": "0.103.1", + "com.vrmc.gltf": "0.103.1" }, "samples": [ { diff --git a/Assets/VRMShaders/package.json b/Assets/VRMShaders/package.json index 7d1c2af22e..5b9b7b8363 100644 --- a/Assets/VRMShaders/package.json +++ b/Assets/VRMShaders/package.json @@ -1,6 +1,6 @@ { "name": "com.vrmc.vrmshaders", - "version": "0.103.0", + "version": "0.103.1", "displayName": "VRM Shaders", "description": "VRM Shaders", "unity": "2019.4",