mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 05:54:59 -05:00
21 lines
534 B
C#
21 lines
534 B
C#
using VrmLib;
|
|
|
|
namespace UniVRM10
|
|
{
|
|
public static class ModelExtensions
|
|
{
|
|
public static byte[] ToGlb(this VrmLib.Model model)
|
|
{
|
|
// export vrm-1.0
|
|
var exporter10 = new Vrm10Exporter(_ => false);
|
|
var option = new VrmLib.ExportArgs
|
|
{
|
|
// vrm = false
|
|
};
|
|
exporter10.Export(null, model, null, option);
|
|
var glb10 = UniGLTF.Glb.Parse(exporter10.Storage.ToBytes());
|
|
return glb10.ToBytes();
|
|
}
|
|
}
|
|
}
|