From 208311164be0e75b16f093acb01b2d181a68c0ab Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 14 Apr 2021 17:45:24 +0900 Subject: [PATCH] VRMC_constraints to VRMC_node_constraint --- .../Editor/JsonSchema/JsonSchemaSource.cs | 15 +++++++++--- Assets/VRM10/Editor/GeneratorMenu.cs | 23 +++++++++++-------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs b/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs index 5835f4c68..447553bee 100644 --- a/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs +++ b/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs @@ -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(); + } } } diff --git a/Assets/VRM10/Editor/GeneratorMenu.cs b/Assets/VRM10/Editor/GeneratorMenu.cs index 9224a69aa..cdc20e1d1 100644 --- a/Assets/VRM10/Editor/GeneratorMenu.cs +++ b/Assets/VRM10/Editor/GeneratorMenu.cs @@ -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); + } } } }