From 168b4bce6963a7037ba63649efbfc0bd23bac46f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 7 Jun 2018 16:29:42 +0900 Subject: [PATCH] Update UniGLTF. Add sparse accessor experiment to VRMExporter --- Scripts/Format/VRMExporter.cs | 8 +++++++- Scripts/Format/VRMImporter.cs | 4 ++-- UniGLTF | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Scripts/Format/VRMExporter.cs b/Scripts/Format/VRMExporter.cs index abdc32d42..7c749ebe6 100644 --- a/Scripts/Format/VRMExporter.cs +++ b/Scripts/Format/VRMExporter.cs @@ -16,7 +16,13 @@ namespace VRM { var gltf = new glTF_VRM(); gltf.asset.generator = string.Format("UniVRM-{0}.{1}", VRMVersion.MAJOR, VRMVersion.MINOR); - using (var exporter = new VRMExporter(gltf)) + using (var exporter = new VRMExporter(gltf) + { +#if VRM_EXPORTER_USE_SPARSE + // experimental + UseSparseAccessorForBlendShape=true +#endif + }) { _Export(gltf, exporter, go); diff --git a/Scripts/Format/VRMImporter.cs b/Scripts/Format/VRMImporter.cs index 18b8ca90a..cd79f8e14 100644 --- a/Scripts/Format/VRMImporter.cs +++ b/Scripts/Format/VRMImporter.cs @@ -78,8 +78,8 @@ namespace VRM public static CreateMaterialFunc GetMaterialFunc(List materials) { - var CreateDefault = gltfImporter.CreateMaterialFuncFromShader(Shader.Find("VRM/UnlitTexture")); - var CreateZWrite = gltfImporter.CreateMaterialFuncFromShader(Shader.Find("VRM/UnlitTransparentZWrite")); + var CreateDefault = gltfImporter.CreateMaterialFuncFromShader(new ShaderStore("VRM/UnlitTexture")); + var CreateZWrite = gltfImporter.CreateMaterialFuncFromShader(new ShaderStore("VRM/UnlitTransparentZWrite")); CreateMaterialFunc fallback = (ctx, i) => { var vrm = ctx.GLTF as glTF_VRM; diff --git a/UniGLTF b/UniGLTF index c8b19d3b8..ea5b240c0 160000 --- a/UniGLTF +++ b/UniGLTF @@ -1 +1 @@ -Subproject commit c8b19d3b8332cadff434a58646610abe2618f3c8 +Subproject commit ea5b240c079de93a36acc6ae187a488f6c2b7f01