Add experimental expoter option. Enable error checks for glTF

This commit is contained in:
yutopp 2019-01-15 17:56:44 +09:00
parent 8479c7c9b2
commit da2f7b8490
2 changed files with 6 additions and 3 deletions

View File

@ -503,7 +503,8 @@ namespace UniGLTF
string json;
if (UseUniJSONSerializer)
{
json = JsonSchema.FromType(GetType()).Serialize(this);
var c = new JsonSchemaValidationContext(this);
json = JsonSchema.FromType(GetType()).Serialize(this, c);
}
else
{

View File

@ -24,6 +24,8 @@ namespace VRM
public bool PoseFreeze = true;
public bool UseExperimentalExporter = true;
public IEnumerable<string> CanExport()
{
if (Source == null)
@ -250,7 +252,7 @@ namespace VRM
}
void Export(string path, List<GameObject> destroy)
{
{
var target = Source;
if (IsPrefab(target))
{
@ -277,7 +279,7 @@ namespace VRM
vrm.extensions.VRM.meta.title = Title;
vrm.extensions.VRM.meta.author = Author;
var bytes = vrm.ToGlbBytes();
var bytes = vrm.ToGlbBytes(UseExperimentalExporter);
File.WriteAllBytes(path, bytes);
Debug.LogFormat("Export elapsed {0}", sw.Elapsed);
}