From ba0c210c5b66eb45a59b5c7a453319dde80abc09 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 19 Jul 2018 18:37:48 +0900 Subject: [PATCH] Updated VRMExporter interface --- Scripts/Format/Editor/VRMExporterMenu.cs | 10 +++++----- Scripts/Format/VRMExporter.cs | 12 +----------- UniGLTF | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Scripts/Format/Editor/VRMExporterMenu.cs b/Scripts/Format/Editor/VRMExporterMenu.cs index 0d11ad553..06d80313f 100644 --- a/Scripts/Format/Editor/VRMExporterMenu.cs +++ b/Scripts/Format/Editor/VRMExporterMenu.cs @@ -101,12 +101,12 @@ namespace VRM var sw = System.Diagnostics.Stopwatch.StartNew(); - VRMExporter.Export(target, path, gltf => { + var vrm = VRMExporter.Export(target); + vrm.extensions.VRM.meta.title = Title; + vrm.extensions.VRM.meta.author = Author; - gltf.extensions.VRM.meta.title = Title; - gltf.extensions.VRM.meta.author = Author; - - }); + var bytes = vrm.ToGlbBytes(); + File.WriteAllBytes(path, bytes); Debug.LogFormat("Export elapsed {0}", sw.Elapsed); diff --git a/Scripts/Format/VRMExporter.cs b/Scripts/Format/VRMExporter.cs index 49c5e7f59..23984bace 100644 --- a/Scripts/Format/VRMExporter.cs +++ b/Scripts/Format/VRMExporter.cs @@ -12,7 +12,7 @@ namespace VRM public VRMExporter(glTF_VRM gltf) : base(gltf) { } - public static glTF Export(GameObject go, string path = null, Action callback=null) + public static glTF_VRM Export(GameObject go) { var gltf = new glTF_VRM(); gltf.asset.generator = string.Format("UniVRM-{0}.{1}", VRMVersion.MAJOR, VRMVersion.MINOR); @@ -25,16 +25,6 @@ namespace VRM }) { _Export(gltf, exporter, go); - - if (callback != null) - { - callback(gltf); - } - - if (!string.IsNullOrEmpty(path)) - { - exporter.WriteTo(path); - } } return gltf; diff --git a/UniGLTF b/UniGLTF index 1d41ff08c..820d2658e 160000 --- a/UniGLTF +++ b/UniGLTF @@ -1 +1 @@ -Subproject commit 1d41ff08c25707e9b789997368bac2971f2cd78e +Subproject commit 820d2658e149156b226f4137a0c94bfc93e3f305