mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 14:29:52 -05:00
32 lines
1018 B
C#
32 lines
1018 B
C#
using UniGLTF;
|
|
using UnityEngine;
|
|
|
|
namespace VRM
|
|
{
|
|
public static class TestVrm0X
|
|
{
|
|
public static RuntimeGltfInstance LoadBytesAsBuiltInRP(byte[] bytes)
|
|
{
|
|
return VrmUtility.LoadBytesAsync(
|
|
"",
|
|
bytes,
|
|
awaitCaller: new ImmediateCaller(),
|
|
materialGeneratorCallback: x => new BuiltInVrmMaterialDescriptorGenerator(x)
|
|
).Result;
|
|
}
|
|
|
|
public static RuntimeGltfInstance LoadPathAsBuiltInRP(string path)
|
|
{
|
|
return VrmUtility.LoadAsync(
|
|
path,
|
|
awaitCaller: new ImmediateCaller(),
|
|
materialGeneratorCallback: x => new BuiltInVrmMaterialDescriptorGenerator(x)
|
|
).Result;
|
|
}
|
|
|
|
public static byte[] ExportAsBuiltInRP(GameObject gameObject, VRMExportSettings exportSettings)
|
|
{
|
|
return VRMEditorExporter.Export(gameObject, null, exportSettings, new BuiltInVrmMaterialExporter());
|
|
}
|
|
}
|
|
} |