Updated VRMExporter interface

This commit is contained in:
ousttrue
2018-07-19 18:37:48 +09:00
parent 2ae5bd2a96
commit ba0c210c5b
3 changed files with 7 additions and 17 deletions

View File

@@ -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);

View File

@@ -12,7 +12,7 @@ namespace VRM
public VRMExporter(glTF_VRM gltf) : base(gltf)
{ }
public static glTF Export(GameObject go, string path = null, Action<glTF_VRM> 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;

Submodule UniGLTF updated: 1d41ff08c2...820d2658e1