mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-25 12:05:08 -05:00
Updated VRMExporter interface
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
2
UniGLTF
2
UniGLTF
Submodule UniGLTF updated: 1d41ff08c2...820d2658e1
Reference in New Issue
Block a user