mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-12 05:24:14 -05:00
* MeshUtility を UniGLTF 下に移動 * Assets/VRM10 を追加 * JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
21 lines
510 B
C#
21 lines
510 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();
|
|
var option = new VrmLib.ExportArgs
|
|
{
|
|
// vrm = false
|
|
};
|
|
var glbBytes10 = exporter10.Export(model, option);
|
|
var glb10 = VrmLib.Glb.Parse(glbBytes10);
|
|
return glb10.ToBytes();
|
|
}
|
|
}
|
|
}
|