VRMC_constraints to VRMC_node_constraint

This commit is contained in:
ousttrue
2021-04-14 17:45:24 +09:00
parent b8334ae645
commit 208311164b
2 changed files with 25 additions and 13 deletions

View File

@@ -2,6 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
namespace UniGLTF.JsonSchema
{
@@ -261,14 +263,21 @@ namespace UniGLTF.JsonSchema
}
}
public void Dump(string indent = "")
public void Dump(StringBuilder sb, string indent = "")
{
Console.WriteLine($"{indent}{JsonPath}: {type}");
sb.AppendLine($"{indent}{JsonPath}: {type}");
foreach (var x in Children())
{
x.Dump(indent + " ");
x.Dump(sb, indent + " ");
}
}
public string Dump()
{
var sb = new StringBuilder();
Dump(sb);
return sb.ToString();
}
}
}

View File

@@ -43,15 +43,15 @@ namespace UniVRM10
"vrm-specification/specification/VRMC_vrm-1.0_draft/schema/VRMC_vrm.schema.json",
"Assets/VRM10/Runtime/Format/Vrm", // dst
// VRMC_constraints
"vrm-specification/specification/VRMC_constraints-1.0_draft/schema/VRMC_constraints.schema.json",
"vrm-specification/specification/VRMC_node_constraint-1.0_draft/schema/VRMC_node_constraint.schema.json",
"Assets/VRM10/Runtime/Format/Constraints", // dst
//
// VRMC_materials_mtoon
"vrm-specification/specification/VRMC_materials_mtoon-1.0_draft/schema/VRMC_materials_mtoon.schema.json",
"Assets/VRM10/Runtime/Format/MaterialsMToon", // dst
//
// VRMC_node_collider
"vrm-specification/specification/VRMC_node_collider_1.0_draft/schema/VRMC_node_collider.json",
"Assets/VRM10/Runtime/Format/NodeCollider", // dst
//
// VRMC_springBone
"vrm-specification/specification/VRMC_springBone-1.0_draft/schema/VRMC_springBone.schema.json",
"Assets/VRM10/Runtime/Format/SpringBone", // dst
};
@@ -61,15 +61,18 @@ namespace UniVRM10
var extensionSchemaPath = new FileInfo(Path.Combine(projectRoot.FullName, args[i]));
var parser = new UniGLTF.JsonSchema.JsonSchemaParser(gltf.Directory, extensionSchemaPath.Directory);
var extensionSchema = parser.Load(extensionSchemaPath, "");
if (debug)
{
extensionSchema.Dump();
continue;
}
var dst = new DirectoryInfo(Path.Combine(projectRoot.FullName, args[i + 1]));
Debug.Log(dst);
GenerateUniGLTFSerialization.Generator.GenerateTo(extensionSchema, dst, clearFolder: true);
if (debug)
{
Debug.Log(extensionSchema.Dump());
}
else
{
GenerateUniGLTFSerialization.Generator.GenerateTo(extensionSchema, dst, clearFolder: true);
}
}
}
}