MsgPack と Json を共用にするための Generics ListTreeNode を 単純な型 JsonNode で置き換え

This commit is contained in:
ousttrue 2021-02-09 15:15:38 +09:00
parent 8c8f39059a
commit c2ffda92dc
38 changed files with 346 additions and 495 deletions

View File

@ -86,7 +86,7 @@ namespace UniGLTF.JsonSchema
}
}
JsonSchemaSource Parse(ListTreeNode<JsonValue> json, string jsonPath)
JsonSchemaSource Parse(JsonNode json, string jsonPath)
{
var source = new JsonSchemaSource
{
@ -294,13 +294,13 @@ namespace UniGLTF.JsonSchema
return source;
}
void ParseStringEnum(ref JsonSchemaSource source, ListTreeNode<JsonValue> json)
void ParseStringEnum(ref JsonSchemaSource source, JsonNode json)
{
source.enumStringValues = json.ArrayItems().Select(x => x.GetString()).ToArray();
source.type = JsonSchemaType.EnumString;
}
void ParseAnyOfAsEnum(ref JsonSchemaSource source, ListTreeNode<JsonValue> json)
void ParseAnyOfAsEnum(ref JsonSchemaSource source, JsonNode json)
{
List<int> values = new List<int>();
List<string> stringValues = new List<string>();
@ -378,7 +378,7 @@ namespace UniGLTF.JsonSchema
throw new NotImplementedException();
}
JsonSchemaSource AllOf(ListTreeNode<JsonValue> json, string jsonPath)
JsonSchemaSource AllOf(JsonNode json, string jsonPath)
{
string refValue = null;
int count = 0;

View File

@ -60,7 +60,7 @@ namespace UniGLTF.JsonSchema.Schemas
{
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new $1[parsed.GetArrayCount()];
int i=0;
@ -81,7 +81,7 @@ public static $0 $2(ListTreeNode<JsonValue> parsed)
else
{
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new $1();
foreach(var x in parsed.ArrayItems())

View File

@ -59,7 +59,7 @@ namespace UniGLTF.JsonSchema.Schemas
writer.Used.Add(callName);
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new $0();

View File

@ -18,7 +18,7 @@ namespace UniGLTF
var itemCallName = callName + "_ITEM";
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new $1[parsed.GetArrayCount()];
int i=0;

View File

@ -7,7 +7,7 @@ using UnityEngine;
namespace UniGLTF
{
/// <summary>
/// Generate deserializer from ListTreeNode<JsonValue> to glTF using type reflection
/// Generate deserializer from JsonNode to glTF using type reflection
/// </summary>
public static class DeserializerGenerator
{

View File

@ -22,7 +22,7 @@ namespace UniGLTF
{
var itemCallName = callName + "_ITEM";
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new List<$1>();
foreach(var x in parsed.ArrayItems())

View File

@ -43,7 +43,7 @@ namespace UniGLTF
public override void GenerateDeserializer(StreamWriter writer, string parentName)
{
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new $0();

View File

@ -18,7 +18,7 @@ namespace UniGLTF
var itemCallName = callName + "_ITEM";
writer.Write(@"
public static $0 $2(ListTreeNode<JsonValue> parsed)
public static $0 $2(JsonNode parsed)
{
var value = new Dictionary<string, $1>();
foreach(var kv in parsed.ObjectItems())

View File

@ -392,7 +392,7 @@ namespace UniGLTF
return false;
}
static void Traverse(this glTF self, ListTreeNode<JsonValue> node, JsonFormatter f, Utf8String parentKey)
static void Traverse(this glTF self, JsonNode node, JsonFormatter f, Utf8String parentKey)
{
if (node.IsMap())
{

View File

@ -24,7 +24,7 @@ namespace UniGLTF
[ItemJsonSchema(Minimum = 0)]
public int texCoord;
static IEnumerable<float> DeserializeFloat2(ListTreeNode<JsonValue> json)
static IEnumerable<float> DeserializeFloat2(JsonNode json)
{
if (json.Value.ValueType == ValueNodeType.Array)
{
@ -35,7 +35,7 @@ namespace UniGLTF
}
}
static glTF_KHR_texture_transform Deserialize(ListTreeNode<JsonValue> json)
static glTF_KHR_texture_transform Deserialize(JsonNode json)
{
var t = new glTF_KHR_texture_transform();

View File

@ -117,13 +117,13 @@ namespace UniGLTF
///
/// パース済みの JSONの部分 を保持する
///
/// ListTreeNode<JsonValue> がJsonの部分を参照できる。
/// JsonNode がJsonの部分を参照できる。
///
/// </summary>
public class glTFExtensionImport : glTFExtension
{
readonly ListTreeNode<JsonValue> m_json;
public glTFExtensionImport(ListTreeNode<JsonValue> json)
readonly JsonNode m_json;
public glTFExtensionImport(JsonNode json)
{
m_json = json;
}
@ -134,7 +134,7 @@ namespace UniGLTF
return "import: " + Encoding.UTF8.GetString(bytes.Array, bytes.Offset, bytes.Count);
}
public IEnumerable<KeyValuePair<ListTreeNode<JsonValue>, ListTreeNode<JsonValue>>> ObjectItems()
public IEnumerable<KeyValuePair<JsonNode, JsonNode>> ObjectItems()
{
if (m_json.Value.ValueType == ValueNodeType.Object)
{

View File

@ -18,7 +18,7 @@ namespace UniGLTF
public static readonly Utf8String ExtraNameUtf8 = Utf8String.From(ExtraName);
static List<string> Deserialize(ListTreeNode<JsonValue> json)
static List<string> Deserialize(JsonNode json)
{
var targetNames = new List<string>();
if (json.Value.ValueType == ValueNodeType.Array)

View File

@ -9,7 +9,7 @@ public static class GltfDeserializer
{
public static glTF Deserialize(ListTreeNode<JsonValue> parsed)
public static glTF Deserialize(JsonNode parsed)
{
var value = new glTF();
@ -116,7 +116,7 @@ public static glTF Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static glTFAssets Deserialize_gltf_asset(ListTreeNode<JsonValue> parsed)
public static glTFAssets Deserialize_gltf_asset(JsonNode parsed)
{
var value = new glTFAssets();
@ -158,7 +158,7 @@ public static glTFAssets Deserialize_gltf_asset(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<UniGLTF.glTFBuffer> Deserialize_gltf_buffers(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFBuffer> Deserialize_gltf_buffers(JsonNode parsed)
{
var value = new List<glTFBuffer>();
foreach(var x in parsed.ArrayItems())
@ -167,7 +167,7 @@ public static List<UniGLTF.glTFBuffer> Deserialize_gltf_buffers(ListTreeNode<Jso
}
return value;
}
public static glTFBuffer Deserialize_gltf_buffers_LIST(ListTreeNode<JsonValue> parsed)
public static glTFBuffer Deserialize_gltf_buffers_LIST(JsonNode parsed)
{
var value = new glTFBuffer();
@ -204,7 +204,7 @@ public static glTFBuffer Deserialize_gltf_buffers_LIST(ListTreeNode<JsonValue> p
return value;
}
public static List<UniGLTF.glTFBufferView> Deserialize_gltf_bufferViews(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFBufferView> Deserialize_gltf_bufferViews(JsonNode parsed)
{
var value = new List<glTFBufferView>();
foreach(var x in parsed.ArrayItems())
@ -213,7 +213,7 @@ public static List<UniGLTF.glTFBufferView> Deserialize_gltf_bufferViews(ListTree
}
return value;
}
public static glTFBufferView Deserialize_gltf_bufferViews_LIST(ListTreeNode<JsonValue> parsed)
public static glTFBufferView Deserialize_gltf_bufferViews_LIST(JsonNode parsed)
{
var value = new glTFBufferView();
@ -265,7 +265,7 @@ public static glTFBufferView Deserialize_gltf_bufferViews_LIST(ListTreeNode<Json
return value;
}
public static List<UniGLTF.glTFAccessor> Deserialize_gltf_accessors(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFAccessor> Deserialize_gltf_accessors(JsonNode parsed)
{
var value = new List<glTFAccessor>();
foreach(var x in parsed.ArrayItems())
@ -274,7 +274,7 @@ public static List<UniGLTF.glTFAccessor> Deserialize_gltf_accessors(ListTreeNode
}
return value;
}
public static glTFAccessor Deserialize_gltf_accessors_LIST(ListTreeNode<JsonValue> parsed)
public static glTFAccessor Deserialize_gltf_accessors_LIST(JsonNode parsed)
{
var value = new glTFAccessor();
@ -346,7 +346,7 @@ public static glTFAccessor Deserialize_gltf_accessors_LIST(ListTreeNode<JsonValu
return value;
}
public static Single[] Deserialize_gltf_accessors__max(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_accessors__max(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -357,7 +357,7 @@ public static Single[] Deserialize_gltf_accessors__max(ListTreeNode<JsonValue> p
return value;
}
public static Single[] Deserialize_gltf_accessors__min(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_accessors__min(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -368,7 +368,7 @@ public static Single[] Deserialize_gltf_accessors__min(ListTreeNode<JsonValue> p
return value;
}
public static glTFSparse Deserialize_gltf_accessors__sparse(ListTreeNode<JsonValue> parsed)
public static glTFSparse Deserialize_gltf_accessors__sparse(JsonNode parsed)
{
var value = new glTFSparse();
@ -405,7 +405,7 @@ public static glTFSparse Deserialize_gltf_accessors__sparse(ListTreeNode<JsonVal
return value;
}
public static glTFSparseIndices Deserialize_gltf_accessors__sparse_indices(ListTreeNode<JsonValue> parsed)
public static glTFSparseIndices Deserialize_gltf_accessors__sparse_indices(JsonNode parsed)
{
var value = new glTFSparseIndices();
@ -442,7 +442,7 @@ public static glTFSparseIndices Deserialize_gltf_accessors__sparse_indices(ListT
return value;
}
public static glTFSparseValues Deserialize_gltf_accessors__sparse_values(ListTreeNode<JsonValue> parsed)
public static glTFSparseValues Deserialize_gltf_accessors__sparse_values(JsonNode parsed)
{
var value = new glTFSparseValues();
@ -474,7 +474,7 @@ public static glTFSparseValues Deserialize_gltf_accessors__sparse_values(ListTre
return value;
}
public static List<UniGLTF.glTFTexture> Deserialize_gltf_textures(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFTexture> Deserialize_gltf_textures(JsonNode parsed)
{
var value = new List<glTFTexture>();
foreach(var x in parsed.ArrayItems())
@ -483,7 +483,7 @@ public static List<UniGLTF.glTFTexture> Deserialize_gltf_textures(ListTreeNode<J
}
return value;
}
public static glTFTexture Deserialize_gltf_textures_LIST(ListTreeNode<JsonValue> parsed)
public static glTFTexture Deserialize_gltf_textures_LIST(JsonNode parsed)
{
var value = new glTFTexture();
@ -520,7 +520,7 @@ public static glTFTexture Deserialize_gltf_textures_LIST(ListTreeNode<JsonValue>
return value;
}
public static List<UniGLTF.glTFTextureSampler> Deserialize_gltf_samplers(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFTextureSampler> Deserialize_gltf_samplers(JsonNode parsed)
{
var value = new List<glTFTextureSampler>();
foreach(var x in parsed.ArrayItems())
@ -529,7 +529,7 @@ public static List<UniGLTF.glTFTextureSampler> Deserialize_gltf_samplers(ListTre
}
return value;
}
public static glTFTextureSampler Deserialize_gltf_samplers_LIST(ListTreeNode<JsonValue> parsed)
public static glTFTextureSampler Deserialize_gltf_samplers_LIST(JsonNode parsed)
{
var value = new glTFTextureSampler();
@ -576,7 +576,7 @@ public static glTFTextureSampler Deserialize_gltf_samplers_LIST(ListTreeNode<Jso
return value;
}
public static List<UniGLTF.glTFImage> Deserialize_gltf_images(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFImage> Deserialize_gltf_images(JsonNode parsed)
{
var value = new List<glTFImage>();
foreach(var x in parsed.ArrayItems())
@ -585,7 +585,7 @@ public static List<UniGLTF.glTFImage> Deserialize_gltf_images(ListTreeNode<JsonV
}
return value;
}
public static glTFImage Deserialize_gltf_images_LIST(ListTreeNode<JsonValue> parsed)
public static glTFImage Deserialize_gltf_images_LIST(JsonNode parsed)
{
var value = new glTFImage();
@ -627,7 +627,7 @@ public static glTFImage Deserialize_gltf_images_LIST(ListTreeNode<JsonValue> par
return value;
}
public static List<UniGLTF.glTFMaterial> Deserialize_gltf_materials(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFMaterial> Deserialize_gltf_materials(JsonNode parsed)
{
var value = new List<glTFMaterial>();
foreach(var x in parsed.ArrayItems())
@ -636,7 +636,7 @@ public static List<UniGLTF.glTFMaterial> Deserialize_gltf_materials(ListTreeNode
}
return value;
}
public static glTFMaterial Deserialize_gltf_materials_LIST(ListTreeNode<JsonValue> parsed)
public static glTFMaterial Deserialize_gltf_materials_LIST(JsonNode parsed)
{
var value = new glTFMaterial();
@ -703,7 +703,7 @@ public static glTFMaterial Deserialize_gltf_materials_LIST(ListTreeNode<JsonValu
return value;
}
public static glTFPbrMetallicRoughness Deserialize_gltf_materials__pbrMetallicRoughness(ListTreeNode<JsonValue> parsed)
public static glTFPbrMetallicRoughness Deserialize_gltf_materials__pbrMetallicRoughness(JsonNode parsed)
{
var value = new glTFPbrMetallicRoughness();
@ -750,7 +750,7 @@ public static glTFPbrMetallicRoughness Deserialize_gltf_materials__pbrMetallicRo
return value;
}
public static glTFMaterialBaseColorTextureInfo Deserialize_gltf_materials__pbrMetallicRoughness_baseColorTexture(ListTreeNode<JsonValue> parsed)
public static glTFMaterialBaseColorTextureInfo Deserialize_gltf_materials__pbrMetallicRoughness_baseColorTexture(JsonNode parsed)
{
var value = new glTFMaterialBaseColorTextureInfo();
@ -782,7 +782,7 @@ public static glTFMaterialBaseColorTextureInfo Deserialize_gltf_materials__pbrMe
return value;
}
public static Single[] Deserialize_gltf_materials__pbrMetallicRoughness_baseColorFactor(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_materials__pbrMetallicRoughness_baseColorFactor(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -793,7 +793,7 @@ public static Single[] Deserialize_gltf_materials__pbrMetallicRoughness_baseColo
return value;
}
public static glTFMaterialMetallicRoughnessTextureInfo Deserialize_gltf_materials__pbrMetallicRoughness_metallicRoughnessTexture(ListTreeNode<JsonValue> parsed)
public static glTFMaterialMetallicRoughnessTextureInfo Deserialize_gltf_materials__pbrMetallicRoughness_metallicRoughnessTexture(JsonNode parsed)
{
var value = new glTFMaterialMetallicRoughnessTextureInfo();
@ -825,7 +825,7 @@ public static glTFMaterialMetallicRoughnessTextureInfo Deserialize_gltf_material
return value;
}
public static glTFMaterialNormalTextureInfo Deserialize_gltf_materials__normalTexture(ListTreeNode<JsonValue> parsed)
public static glTFMaterialNormalTextureInfo Deserialize_gltf_materials__normalTexture(JsonNode parsed)
{
var value = new glTFMaterialNormalTextureInfo();
@ -862,7 +862,7 @@ public static glTFMaterialNormalTextureInfo Deserialize_gltf_materials__normalTe
return value;
}
public static glTFMaterialOcclusionTextureInfo Deserialize_gltf_materials__occlusionTexture(ListTreeNode<JsonValue> parsed)
public static glTFMaterialOcclusionTextureInfo Deserialize_gltf_materials__occlusionTexture(JsonNode parsed)
{
var value = new glTFMaterialOcclusionTextureInfo();
@ -899,7 +899,7 @@ public static glTFMaterialOcclusionTextureInfo Deserialize_gltf_materials__occlu
return value;
}
public static glTFMaterialEmissiveTextureInfo Deserialize_gltf_materials__emissiveTexture(ListTreeNode<JsonValue> parsed)
public static glTFMaterialEmissiveTextureInfo Deserialize_gltf_materials__emissiveTexture(JsonNode parsed)
{
var value = new glTFMaterialEmissiveTextureInfo();
@ -931,7 +931,7 @@ public static glTFMaterialEmissiveTextureInfo Deserialize_gltf_materials__emissi
return value;
}
public static Single[] Deserialize_gltf_materials__emissiveFactor(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_materials__emissiveFactor(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -942,7 +942,7 @@ public static Single[] Deserialize_gltf_materials__emissiveFactor(ListTreeNode<J
return value;
}
public static List<UniGLTF.glTFMesh> Deserialize_gltf_meshes(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFMesh> Deserialize_gltf_meshes(JsonNode parsed)
{
var value = new List<glTFMesh>();
foreach(var x in parsed.ArrayItems())
@ -951,7 +951,7 @@ public static List<UniGLTF.glTFMesh> Deserialize_gltf_meshes(ListTreeNode<JsonVa
}
return value;
}
public static glTFMesh Deserialize_gltf_meshes_LIST(ListTreeNode<JsonValue> parsed)
public static glTFMesh Deserialize_gltf_meshes_LIST(JsonNode parsed)
{
var value = new glTFMesh();
@ -988,7 +988,7 @@ public static glTFMesh Deserialize_gltf_meshes_LIST(ListTreeNode<JsonValue> pars
return value;
}
public static List<UniGLTF.glTFPrimitives> Deserialize_gltf_meshes__primitives(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFPrimitives> Deserialize_gltf_meshes__primitives(JsonNode parsed)
{
var value = new List<glTFPrimitives>();
foreach(var x in parsed.ArrayItems())
@ -997,7 +997,7 @@ public static List<UniGLTF.glTFPrimitives> Deserialize_gltf_meshes__primitives(L
}
return value;
}
public static glTFPrimitives Deserialize_gltf_meshes__primitives_LIST(ListTreeNode<JsonValue> parsed)
public static glTFPrimitives Deserialize_gltf_meshes__primitives_LIST(JsonNode parsed)
{
var value = new glTFPrimitives();
@ -1044,7 +1044,7 @@ public static glTFPrimitives Deserialize_gltf_meshes__primitives_LIST(ListTreeNo
return value;
}
public static glTFAttributes Deserialize_gltf_meshes__primitives__attributes(ListTreeNode<JsonValue> parsed)
public static glTFAttributes Deserialize_gltf_meshes__primitives__attributes(JsonNode parsed)
{
var value = new glTFAttributes();
@ -1096,7 +1096,7 @@ public static glTFAttributes Deserialize_gltf_meshes__primitives__attributes(Lis
return value;
}
public static List<UniGLTF.gltfMorphTarget> Deserialize_gltf_meshes__primitives__targets(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.gltfMorphTarget> Deserialize_gltf_meshes__primitives__targets(JsonNode parsed)
{
var value = new List<gltfMorphTarget>();
foreach(var x in parsed.ArrayItems())
@ -1105,7 +1105,7 @@ public static List<UniGLTF.gltfMorphTarget> Deserialize_gltf_meshes__primitives_
}
return value;
}
public static gltfMorphTarget Deserialize_gltf_meshes__primitives__targets_LIST(ListTreeNode<JsonValue> parsed)
public static gltfMorphTarget Deserialize_gltf_meshes__primitives__targets_LIST(JsonNode parsed)
{
var value = new gltfMorphTarget();
@ -1132,7 +1132,7 @@ public static gltfMorphTarget Deserialize_gltf_meshes__primitives__targets_LIST(
return value;
}
public static Single[] Deserialize_gltf_meshes__weights(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_meshes__weights(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1143,7 +1143,7 @@ public static Single[] Deserialize_gltf_meshes__weights(ListTreeNode<JsonValue>
return value;
}
public static List<UniGLTF.glTFNode> Deserialize_gltf_nodes(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFNode> Deserialize_gltf_nodes(JsonNode parsed)
{
var value = new List<glTFNode>();
foreach(var x in parsed.ArrayItems())
@ -1152,7 +1152,7 @@ public static List<UniGLTF.glTFNode> Deserialize_gltf_nodes(ListTreeNode<JsonVal
}
return value;
}
public static glTFNode Deserialize_gltf_nodes_LIST(ListTreeNode<JsonValue> parsed)
public static glTFNode Deserialize_gltf_nodes_LIST(JsonNode parsed)
{
var value = new glTFNode();
@ -1224,7 +1224,7 @@ public static glTFNode Deserialize_gltf_nodes_LIST(ListTreeNode<JsonValue> parse
return value;
}
public static Int32[] Deserialize_gltf_nodes__children(ListTreeNode<JsonValue> parsed)
public static Int32[] Deserialize_gltf_nodes__children(JsonNode parsed)
{
var value = new Int32[parsed.GetArrayCount()];
int i=0;
@ -1235,7 +1235,7 @@ public static Int32[] Deserialize_gltf_nodes__children(ListTreeNode<JsonValue> p
return value;
}
public static Single[] Deserialize_gltf_nodes__matrix(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_nodes__matrix(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1246,7 +1246,7 @@ public static Single[] Deserialize_gltf_nodes__matrix(ListTreeNode<JsonValue> pa
return value;
}
public static Single[] Deserialize_gltf_nodes__translation(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_nodes__translation(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1257,7 +1257,7 @@ public static Single[] Deserialize_gltf_nodes__translation(ListTreeNode<JsonValu
return value;
}
public static Single[] Deserialize_gltf_nodes__rotation(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_nodes__rotation(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1268,7 +1268,7 @@ public static Single[] Deserialize_gltf_nodes__rotation(ListTreeNode<JsonValue>
return value;
}
public static Single[] Deserialize_gltf_nodes__scale(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_nodes__scale(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1279,7 +1279,7 @@ public static Single[] Deserialize_gltf_nodes__scale(ListTreeNode<JsonValue> par
return value;
}
public static Single[] Deserialize_gltf_nodes__weights(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_gltf_nodes__weights(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1290,7 +1290,7 @@ public static Single[] Deserialize_gltf_nodes__weights(ListTreeNode<JsonValue> p
return value;
}
public static List<UniGLTF.glTFSkin> Deserialize_gltf_skins(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFSkin> Deserialize_gltf_skins(JsonNode parsed)
{
var value = new List<glTFSkin>();
foreach(var x in parsed.ArrayItems())
@ -1299,7 +1299,7 @@ public static List<UniGLTF.glTFSkin> Deserialize_gltf_skins(ListTreeNode<JsonVal
}
return value;
}
public static glTFSkin Deserialize_gltf_skins_LIST(ListTreeNode<JsonValue> parsed)
public static glTFSkin Deserialize_gltf_skins_LIST(JsonNode parsed)
{
var value = new glTFSkin();
@ -1341,7 +1341,7 @@ public static glTFSkin Deserialize_gltf_skins_LIST(ListTreeNode<JsonValue> parse
return value;
}
public static Int32[] Deserialize_gltf_skins__joints(ListTreeNode<JsonValue> parsed)
public static Int32[] Deserialize_gltf_skins__joints(JsonNode parsed)
{
var value = new Int32[parsed.GetArrayCount()];
int i=0;
@ -1352,7 +1352,7 @@ public static Int32[] Deserialize_gltf_skins__joints(ListTreeNode<JsonValue> par
return value;
}
public static List<UniGLTF.gltfScene> Deserialize_gltf_scenes(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.gltfScene> Deserialize_gltf_scenes(JsonNode parsed)
{
var value = new List<gltfScene>();
foreach(var x in parsed.ArrayItems())
@ -1361,7 +1361,7 @@ public static List<UniGLTF.gltfScene> Deserialize_gltf_scenes(ListTreeNode<JsonV
}
return value;
}
public static gltfScene Deserialize_gltf_scenes_LIST(ListTreeNode<JsonValue> parsed)
public static gltfScene Deserialize_gltf_scenes_LIST(JsonNode parsed)
{
var value = new gltfScene();
@ -1393,7 +1393,7 @@ public static gltfScene Deserialize_gltf_scenes_LIST(ListTreeNode<JsonValue> par
return value;
}
public static Int32[] Deserialize_gltf_scenes__nodes(ListTreeNode<JsonValue> parsed)
public static Int32[] Deserialize_gltf_scenes__nodes(JsonNode parsed)
{
var value = new Int32[parsed.GetArrayCount()];
int i=0;
@ -1404,7 +1404,7 @@ public static Int32[] Deserialize_gltf_scenes__nodes(ListTreeNode<JsonValue> par
return value;
}
public static List<UniGLTF.glTFAnimation> Deserialize_gltf_animations(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFAnimation> Deserialize_gltf_animations(JsonNode parsed)
{
var value = new List<glTFAnimation>();
foreach(var x in parsed.ArrayItems())
@ -1413,7 +1413,7 @@ public static List<UniGLTF.glTFAnimation> Deserialize_gltf_animations(ListTreeNo
}
return value;
}
public static glTFAnimation Deserialize_gltf_animations_LIST(ListTreeNode<JsonValue> parsed)
public static glTFAnimation Deserialize_gltf_animations_LIST(JsonNode parsed)
{
var value = new glTFAnimation();
@ -1450,7 +1450,7 @@ public static glTFAnimation Deserialize_gltf_animations_LIST(ListTreeNode<JsonVa
return value;
}
public static List<UniGLTF.glTFAnimationChannel> Deserialize_gltf_animations__channels(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFAnimationChannel> Deserialize_gltf_animations__channels(JsonNode parsed)
{
var value = new List<glTFAnimationChannel>();
foreach(var x in parsed.ArrayItems())
@ -1459,7 +1459,7 @@ public static List<UniGLTF.glTFAnimationChannel> Deserialize_gltf_animations__ch
}
return value;
}
public static glTFAnimationChannel Deserialize_gltf_animations__channels_LIST(ListTreeNode<JsonValue> parsed)
public static glTFAnimationChannel Deserialize_gltf_animations__channels_LIST(JsonNode parsed)
{
var value = new glTFAnimationChannel();
@ -1491,7 +1491,7 @@ public static glTFAnimationChannel Deserialize_gltf_animations__channels_LIST(Li
return value;
}
public static glTFAnimationTarget Deserialize_gltf_animations__channels__target(ListTreeNode<JsonValue> parsed)
public static glTFAnimationTarget Deserialize_gltf_animations__channels__target(JsonNode parsed)
{
var value = new glTFAnimationTarget();
@ -1523,7 +1523,7 @@ public static glTFAnimationTarget Deserialize_gltf_animations__channels__target(
return value;
}
public static List<UniGLTF.glTFAnimationSampler> Deserialize_gltf_animations__samplers(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFAnimationSampler> Deserialize_gltf_animations__samplers(JsonNode parsed)
{
var value = new List<glTFAnimationSampler>();
foreach(var x in parsed.ArrayItems())
@ -1532,7 +1532,7 @@ public static List<UniGLTF.glTFAnimationSampler> Deserialize_gltf_animations__sa
}
return value;
}
public static glTFAnimationSampler Deserialize_gltf_animations__samplers_LIST(ListTreeNode<JsonValue> parsed)
public static glTFAnimationSampler Deserialize_gltf_animations__samplers_LIST(JsonNode parsed)
{
var value = new glTFAnimationSampler();
@ -1569,7 +1569,7 @@ public static glTFAnimationSampler Deserialize_gltf_animations__samplers_LIST(Li
return value;
}
public static List<UniGLTF.glTFCamera> Deserialize_gltf_cameras(ListTreeNode<JsonValue> parsed)
public static List<UniGLTF.glTFCamera> Deserialize_gltf_cameras(JsonNode parsed)
{
var value = new List<glTFCamera>();
foreach(var x in parsed.ArrayItems())
@ -1578,7 +1578,7 @@ public static List<UniGLTF.glTFCamera> Deserialize_gltf_cameras(ListTreeNode<Jso
}
return value;
}
public static glTFCamera Deserialize_gltf_cameras_LIST(ListTreeNode<JsonValue> parsed)
public static glTFCamera Deserialize_gltf_cameras_LIST(JsonNode parsed)
{
var value = new glTFCamera();
@ -1620,7 +1620,7 @@ public static glTFCamera Deserialize_gltf_cameras_LIST(ListTreeNode<JsonValue> p
return value;
}
public static glTFOrthographic Deserialize_gltf_cameras__orthographic(ListTreeNode<JsonValue> parsed)
public static glTFOrthographic Deserialize_gltf_cameras__orthographic(JsonNode parsed)
{
var value = new glTFOrthographic();
@ -1662,7 +1662,7 @@ public static glTFOrthographic Deserialize_gltf_cameras__orthographic(ListTreeNo
return value;
}
public static glTFPerspective Deserialize_gltf_cameras__perspective(ListTreeNode<JsonValue> parsed)
public static glTFPerspective Deserialize_gltf_cameras__perspective(JsonNode parsed)
{
var value = new glTFPerspective();
@ -1704,7 +1704,7 @@ public static glTFPerspective Deserialize_gltf_cameras__perspective(ListTreeNode
return value;
}
public static List<System.String> Deserialize_gltf_extensionsUsed(ListTreeNode<JsonValue> parsed)
public static List<System.String> Deserialize_gltf_extensionsUsed(JsonNode parsed)
{
var value = new List<String>();
foreach(var x in parsed.ArrayItems())
@ -1713,7 +1713,7 @@ public static List<System.String> Deserialize_gltf_extensionsUsed(ListTreeNode<J
}
return value;
}
public static List<System.String> Deserialize_gltf_extensionsRequired(ListTreeNode<JsonValue> parsed)
public static List<System.String> Deserialize_gltf_extensionsRequired(JsonNode parsed)
{
var value = new List<String>();
foreach(var x in parsed.ArrayItems())

View File

@ -5,19 +5,19 @@ namespace UniJSON
{
public static class StringExtensions
{
public static ListTreeNode<JsonValue> ParseAsJson(this string json)
public static JsonNode ParseAsJson(this string json)
{
return JsonParser.Parse(json);
}
public static ListTreeNode<JsonValue> ParseAsJson(this Utf8String json)
public static JsonNode ParseAsJson(this Utf8String json)
{
return JsonParser.Parse(json);
}
public static ListTreeNode<JsonValue> ParseAsJson(this byte[] bytes)
public static JsonNode ParseAsJson(this byte[] bytes)
{
return JsonParser.Parse(new Utf8String(bytes));
}
public static ListTreeNode<JsonValue> ParseAsJson(this ArraySegment<byte> bytes)
public static JsonNode ParseAsJson(this ArraySegment<byte> bytes)
{
return JsonParser.Parse(new Utf8String(bytes));
}

View File

@ -1,53 +0,0 @@
using System;
using System.Reflection;
namespace UniJSON
{
struct GenericConstructor<T, U>
where T : IListTreeItem, IValue<T>
{
static V[] ArrayCreator<V>(ListTreeNode<T> src)
{
if (!src.IsArray())
{
throw new ArgumentException("value is not array");
}
var count = src.GetArrayCount();
return new V[count];
}
static Func<ListTreeNode<T>, U> GetCreator()
{
var t = typeof(U);
if (t.IsArray)
{
var mi = typeof(GenericConstructor<T, U>).GetMethod("ArrayCreator",
BindingFlags.NonPublic | BindingFlags.Static);
var g = mi.MakeGenericMethod(t.GetElementType());
return GenericInvokeCallFactory.StaticFunc<ListTreeNode<T>, U>(g);
}
{
return _s =>
{
return Activator.CreateInstance<U>();
};
}
}
delegate U Creator(ListTreeNode<T> src);
static Creator s_creator;
public U Create(ListTreeNode<T> src)
{
if (s_creator == null)
{
var d = GetCreator();
s_creator = new Creator(d);
}
return s_creator(src);
}
}
}

View File

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 6121925cab5acc54bbb0e0e213783394
timeCreated: 1549447177
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,26 +0,0 @@
using System.Collections.Generic;
namespace UniJSON
{
public interface ITreeNode<T, U>
where T : ITreeNode<T, U>
{
bool IsValid { get; }
bool HasParent { get; }
T Parent { get; }
IEnumerable<T> Children { get; }
int ValueIndex { get; }
U Value { get; }
void SetValue(U value);
}
public interface IListTreeItem
{
int ParentIndex { get; }
int ChildCount { get; }
void SetChildCount(int count);
}
}

View File

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: baf3ade828d6e4c429d402b486911774
timeCreated: 1545735557
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -17,27 +17,4 @@ namespace UniJSON
Infinity,
MinusInfinity,
}
public interface IValue<T>
{
T New(ArraySegment<byte> bytes, ValueNodeType valueType, int parentIndex);
T Key(Utf8String key, int parentIndex);
ValueNodeType ValueType { get; }
ArraySegment<Byte> Bytes { get; }
void SetBytesCount(int count);
Boolean GetBoolean();
String GetString();
Utf8String GetUtf8String();
SByte GetSByte();
Int16 GetInt16();
Int32 GetInt32();
Int64 GetInt64();
Byte GetByte();
UInt16 GetUInt16();
UInt32 GetUInt32();
UInt64 GetUInt64();
Single GetSingle();
Double GetDouble();
U GetValue<U>();
}
}

View File

@ -15,8 +15,7 @@ namespace UniJSON
public JsonDiffType DiffType;
public string Msg;
public static JsonDiff Create<T>(ListTreeNode<T> node, JsonDiffType diffType, string msg)
where T: IListTreeItem, IValue<T>
public static JsonDiff Create(JsonNode node, JsonDiffType diffType, string msg)
{
return new JsonDiff
{

View File

@ -278,7 +278,7 @@ namespace UniJSON
Value(x.ToString("yyyy-MM-ddTHH:mm:ssZ"));
}
public void Value(ListTreeNode<JsonValue> node)
public void Value(JsonNode node)
{
CommaCheck();
m_w.Write(node.Value.Bytes);

View File

@ -64,7 +64,7 @@ namespace UniJSON
/// <param name="valueType"></param>
/// <param name="parentIndex"></param>
/// <returns></returns>
static ListTreeNode<JsonValue> ParsePrimitive(ListTreeNode<JsonValue> tree, Utf8String segment, ValueNodeType valueType)
static JsonNode ParsePrimitive(JsonNode tree, Utf8String segment, ValueNodeType valueType)
{
int i = 1;
for (; i < segment.ByteLength; ++i)
@ -82,7 +82,7 @@ namespace UniJSON
return tree.AddValue(segment.Subbytes(0, i).Bytes, valueType);
}
static ListTreeNode<JsonValue> ParseString(ListTreeNode<JsonValue> tree, Utf8String segment)
static JsonNode ParseString(JsonNode tree, Utf8String segment)
{
int pos;
if (segment.TrySearchAscii((Byte)'"', 1, out pos))
@ -95,7 +95,7 @@ namespace UniJSON
}
}
static ListTreeNode<JsonValue> ParseArray(ListTreeNode<JsonValue> tree, Utf8String segment)
static JsonNode ParseArray(JsonNode tree, Utf8String segment)
{
var array = tree.AddValue(segment.Bytes, ValueNodeType.Array);
@ -159,7 +159,7 @@ namespace UniJSON
return array;
}
static ListTreeNode<JsonValue> ParseObject(ListTreeNode<JsonValue> tree, Utf8String segment)
static JsonNode ParseObject(JsonNode tree, Utf8String segment)
{
var obj = tree.AddValue(segment.Bytes, ValueNodeType.Object);
@ -248,7 +248,7 @@ namespace UniJSON
return obj;
}
public static ListTreeNode<JsonValue> Parse(ListTreeNode<JsonValue> tree, Utf8String segment)
public static JsonNode Parse(JsonNode tree, Utf8String segment)
{
// skip white space
int pos;
@ -284,14 +284,14 @@ namespace UniJSON
}
}
public static ListTreeNode<JsonValue> Parse(String json)
public static JsonNode Parse(String json)
{
return Parse(Utf8String.From(json));
}
public static ListTreeNode<JsonValue> Parse(Utf8String json)
public static JsonNode Parse(Utf8String json)
{
return Parse(default(ListTreeNode<JsonValue>), json);
return Parse(default(JsonNode), json);
}
}
}

View File

@ -37,8 +37,7 @@ namespace UniJSON
};
}
public static JsonPointer Create<T>(ListTreeNode<T> node)
where T : IListTreeItem, IValue<T>
public static JsonPointer Create(JsonNode node)
{
return new JsonPointer
{
@ -79,8 +78,7 @@ namespace UniJSON
return sb.ToString();
}
static Utf8String GetKeyFromParent<T>(ListTreeNode<T> json)
where T : IListTreeItem, IValue<T>
static Utf8String GetKeyFromParent(JsonNode json)
{
var parent = json.Parent;
if (parent.IsArray())

View File

@ -3,7 +3,7 @@
namespace UniJSON
{
public struct JsonValue : IListTreeItem, IValue<JsonValue>
public struct JsonValue
{
public Utf8String Segment;
public ArraySegment<Byte> Bytes { get { return Segment.Bytes; } }

View File

@ -6,8 +6,7 @@ using System.Text;
namespace UniJSON
{
public struct ListTreeNode<T> : ITreeNode<ListTreeNode<T>, T>
where T : IListTreeItem, IValue<T>
public struct JsonNode
{
public override int GetHashCode()
{
@ -16,12 +15,12 @@ namespace UniJSON
public override bool Equals(object obj)
{
if (!(obj is ListTreeNode<T>))
if (!(obj is JsonNode))
{
return false;
}
var rhs = (ListTreeNode<T>)obj;
var rhs = (JsonNode)obj;
if ((Value.ValueType == ValueNodeType.Integer || Value.ValueType == ValueNodeType.Null)
&& (rhs.Value.ValueType == ValueNodeType.Integer || rhs.Value.ValueType == ValueNodeType.Number))
@ -198,7 +197,7 @@ namespace UniJSON
return string.Join("", ToString(indent, 0).ToArray());
}
public IEnumerable<JsonDiff> Diff(ListTreeNode<T> rhs, JsonPointer path = default(JsonPointer))
public IEnumerable<JsonDiff> Diff(JsonNode rhs, JsonPointer path = default(JsonPointer))
{
switch (Value.ValueType)
{
@ -228,7 +227,7 @@ namespace UniJSON
foreach (var kv in l)
{
ListTreeNode<T> x;
JsonNode x;
if (r.TryGetValue(kv.Key, out x))
{
r.Remove(kv.Key);
@ -291,7 +290,7 @@ namespace UniJSON
/// <summary>
/// Whole tree nodes
/// </summary>
List<T> m_Values;
List<JsonValue> m_Values;
public bool IsValid
{
get
@ -313,26 +312,26 @@ namespace UniJSON
}
}
public ListTreeNode<T> Prev
public JsonNode Prev
{
get
{
return new ListTreeNode<T>(m_Values, ValueIndex - 1);
return new JsonNode(m_Values, ValueIndex - 1);
}
}
public T Value
public JsonValue Value
{
get
{
if (m_Values == null)
{
return default(T);
return default;
}
return m_Values[ValueIndex];
}
}
public void SetValue(T value)
public void SetValue(JsonValue value)
{
m_Values[ValueIndex] = value;
}
@ -343,7 +342,7 @@ namespace UniJSON
get { return Value.ChildCount; }
}
public IEnumerable<ListTreeNode<T>> Children
public IEnumerable<JsonNode> Children
{
get
{
@ -353,13 +352,13 @@ namespace UniJSON
if (m_Values[i].ParentIndex == ValueIndex)
{
++count;
yield return new ListTreeNode<T>(m_Values, i);
yield return new JsonNode(m_Values, i);
}
}
}
}
public ListTreeNode<T> this[String key]
public JsonNode this[String key]
{
get
{
@ -367,7 +366,7 @@ namespace UniJSON
}
}
public ListTreeNode<T> this[Utf8String key]
public JsonNode this[Utf8String key]
{
get
{
@ -375,7 +374,7 @@ namespace UniJSON
}
}
public ListTreeNode<T> this[int index]
public JsonNode this[int index]
{
get
{
@ -390,7 +389,7 @@ namespace UniJSON
return Value.ParentIndex >= 0 && Value.ParentIndex < m_Values.Count;
}
}
public ListTreeNode<T> Parent
public JsonNode Parent
{
get
{
@ -402,33 +401,33 @@ namespace UniJSON
{
throw new IndexOutOfRangeException();
}
return new ListTreeNode<T>(m_Values, Value.ParentIndex);
return new JsonNode(m_Values, Value.ParentIndex);
}
}
public ListTreeNode(List<T> values, int index = 0) : this()
public JsonNode(List<JsonValue> values, int index = 0) : this()
{
m_Values = values;
_valueIndex = index;
}
#region JsonPointer
public ListTreeNode<T> AddKey(Utf8String key)
public JsonNode AddKey(Utf8String key)
{
return AddValue(default(T).Key(key, ValueIndex));
return AddValue(default(JsonValue).Key(key, ValueIndex));
}
public ListTreeNode<T> AddValue(ArraySegment<byte> bytes, ValueNodeType valueType)
public JsonNode AddValue(ArraySegment<byte> bytes, ValueNodeType valueType)
{
return AddValue(default(T).New(bytes, valueType, ValueIndex));
return AddValue(default(JsonValue).New(bytes, valueType, ValueIndex));
}
public ListTreeNode<T> AddValue(T value)
public JsonNode AddValue(JsonValue value)
{
if (m_Values == null)
{
// initialize empty tree
m_Values = new List<T>();
m_Values = new List<JsonValue>();
_valueIndex = -1;
}
else
@ -437,7 +436,7 @@ namespace UniJSON
}
var index = m_Values.Count;
m_Values.Add(value);
return new ListTreeNode<T>(m_Values, index);
return new JsonNode(m_Values, index);
}
void IncrementChildCount()

View File

@ -7,21 +7,19 @@ namespace UniJSON
{
public static class ListTreeNodeArrayExtensions
{
public static IEnumerable<ListTreeNode<T>> ArrayItems<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static IEnumerable<JsonNode> ArrayItems(this JsonNode self)
{
if (!self.IsArray()) throw new DeserializationException("is not array");
return self.Children;
}
[Obsolete("Use GetArrayItem(index)")]
public static ListTreeNode<T> GetArrrayItem<T>(this ListTreeNode<T> self, int index)
where T : IListTreeItem, IValue<T>
public static JsonNode GetArrrayItem(this JsonNode self, int index)
{
return GetArrayItem(self, index);
}
public static ListTreeNode<T> GetArrayItem<T>(this ListTreeNode<T> self, int index)
where T : IListTreeItem, IValue<T>
public static JsonNode GetArrayItem(this JsonNode self, int index)
{
int i = 0;
foreach (var v in self.ArrayItems())
@ -34,15 +32,13 @@ namespace UniJSON
throw new KeyNotFoundException();
}
public static int GetArrayCount<T>(this ListTreeNode<T> self)
where T : IListTreeItem, IValue<T>
public static int GetArrayCount(this JsonNode self)
{
if (!self.IsArray()) throw new DeserializationException("is not array");
return self.Children.Count();
}
public static int IndexOf<T>(this ListTreeNode<T> self, ListTreeNode<T> child)
where T : IListTreeItem, IValue<T>
public static int IndexOf(this JsonNode self, JsonNode child)
{
int i = 0;
foreach (var v in self.ArrayItems())

View File

@ -6,27 +6,27 @@ namespace UniJSON
public static class ListTreeNodeExtensions
{
#region IValue
public static bool IsNull<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsNull(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Null;
}
public static bool IsBoolean<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsBoolean(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Boolean;
}
public static bool IsString<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsString(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.String;
}
public static bool IsInteger<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsInteger(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Integer;
}
public static bool IsFloat<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsFloat(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Number
|| self.Value.ValueType == ValueNodeType.NaN
@ -34,41 +34,41 @@ namespace UniJSON
|| self.Value.ValueType == ValueNodeType.MinusInfinity;
}
public static bool IsArray<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsArray(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Array;
}
public static bool IsMap<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static bool IsMap(this JsonNode self)
{
return self.Value.ValueType == ValueNodeType.Object;
}
public static bool GetBoolean<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetBoolean(); }
public static string GetString<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetString(); }
public static Utf8String GetUtf8String<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetUtf8String(); }
public static sbyte GetSByte<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetSByte(); }
public static short GetInt16<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetInt16(); }
public static int GetInt32<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetInt32(); }
public static long GetInt64<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetInt64(); }
public static byte GetByte<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetByte(); }
public static ushort GetUInt16<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetUInt16(); }
public static uint GetUInt32<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetUInt32(); }
public static ulong GetUInt64<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetUInt64(); }
public static float GetSingle<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetSingle(); }
public static double GetDouble<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T> { return self.Value.GetDouble(); }
public static bool GetBoolean(this JsonNode self) { return self.Value.GetBoolean(); }
public static string GetString(this JsonNode self) { return self.Value.GetString(); }
public static Utf8String GetUtf8String(this JsonNode self) { return self.Value.GetUtf8String(); }
public static sbyte GetSByte(this JsonNode self) { return self.Value.GetSByte(); }
public static short GetInt16(this JsonNode self) { return self.Value.GetInt16(); }
public static int GetInt32(this JsonNode self) { return self.Value.GetInt32(); }
public static long GetInt64(this JsonNode self) { return self.Value.GetInt64(); }
public static byte GetByte(this JsonNode self) { return self.Value.GetByte(); }
public static ushort GetUInt16(this JsonNode self) { return self.Value.GetUInt16(); }
public static uint GetUInt32(this JsonNode self) { return self.Value.GetUInt32(); }
public static ulong GetUInt64(this JsonNode self) { return self.Value.GetUInt64(); }
public static float GetSingle(this JsonNode self) { return self.Value.GetSingle(); }
public static double GetDouble(this JsonNode self) { return self.Value.GetDouble(); }
/// <summary>
/// for UnitTest. Use explicit GetT() or Deserialize(ref T)
/// </summary>
/// <returns></returns>
public static object GetValue<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static object GetValue(this JsonNode self)
{
return self.Value.GetValue<object>();
}
#endregion
public static IEnumerable<ListTreeNode<T>> Traverse<T>(this ListTreeNode<T> self) where T : IListTreeItem, IValue<T>
public static IEnumerable<JsonNode> Traverse(this JsonNode self)
{
yield return self;
if (self.IsArray())

View File

@ -7,40 +7,36 @@ namespace UniJSON
{
public static class ListTreeNodeJsonPointerExtensions
{
public static void SetValue<T>(this ListTreeNode<T> self,
public static void SetValue(this JsonNode self,
Utf8String jsonPointer, ArraySegment<Byte> bytes)
where T: IListTreeItem, IValue<T>
{
foreach (var node in self.GetNodes(jsonPointer))
{
node.SetValue(default(T).New(
node.SetValue(default(JsonValue).New(
bytes,
ValueNodeType.Boolean,
node.Value.ParentIndex));
}
}
public static void RemoveValue<T>(this ListTreeNode<T> self, Utf8String jsonPointer)
where T : IListTreeItem, IValue<T>
public static void RemoveValue(this JsonNode self, Utf8String jsonPointer)
{
foreach (var node in self.GetNodes(new JsonPointer(jsonPointer)))
{
if (node.Parent.IsMap())
{
node.Prev.SetValue(default(T)); // remove key
node.Prev.SetValue(default(JsonValue)); // remove key
}
node.SetValue(default(T)); // remove
node.SetValue(default(JsonValue)); // remove
}
}
public static JsonPointer Pointer<T>(this ListTreeNode<T> self)
where T: IListTreeItem, IValue<T>
public static JsonPointer Pointer(this JsonNode self)
{
return JsonPointer.Create(self);
}
public static IEnumerable<ListTreeNode<T>> Path<T>(this ListTreeNode<T> self)
where T : IListTreeItem, IValue<T>
public static IEnumerable<JsonNode> Path(this JsonNode self)
{
if (self.HasParent)
{
@ -52,9 +48,8 @@ namespace UniJSON
yield return self;
}
public static IEnumerable<ListTreeNode<T>> GetNodes<T>(this ListTreeNode<T> self,
public static IEnumerable<JsonNode> GetNodes(this JsonNode self,
JsonPointer jsonPointer)
where T : IListTreeItem, IValue<T>
{
if (jsonPointer.Path.Count == 0)
{
@ -102,7 +97,7 @@ namespace UniJSON
}
else
{
ListTreeNode<T> child;
JsonNode child;
try
{
child = self.ObjectItems().First(x => x.Key.GetUtf8String() == jsonPointer[0]).Value;
@ -128,9 +123,8 @@ namespace UniJSON
}
}
public static IEnumerable<ListTreeNode<T>> GetNodes<T>(this ListTreeNode<T> self,
Utf8String jsonPointer)
where T : IListTreeItem, IValue<T>
public static IEnumerable<JsonNode> GetNodes(this JsonNode self,
Utf8String jsonPointer)
{
return self.GetNodes(new JsonPointer(jsonPointer));
}

View File

@ -7,8 +7,7 @@ namespace UniJSON
{
public static class IValueNodeObjectExtensions
{
public static IEnumerable<KeyValuePair<ListTreeNode<T>, ListTreeNode<T>>> ObjectItems<T>(this ListTreeNode<T> self)
where T : IListTreeItem, IValue<T>
public static IEnumerable<KeyValuePair<JsonNode, JsonNode>> ObjectItems(this JsonNode self)
{
if (!self.IsMap()) throw new DeserializationException("is not object");
var it = self.Children.GetEnumerator();
@ -17,19 +16,17 @@ namespace UniJSON
var key = it.Current;
it.MoveNext();
yield return new KeyValuePair<ListTreeNode<T>, ListTreeNode<T>>(key, it.Current);
yield return new KeyValuePair<JsonNode, JsonNode>(key, it.Current);
}
}
public static int GetObjectCount<T>(this ListTreeNode<T> self)
where T : IListTreeItem, IValue<T>
public static int GetObjectCount(this JsonNode self)
{
if (!self.IsMap()) throw new DeserializationException("is not object");
return self.Children.Count() / 2;
}
public static string GetObjectValueOrDefault<T>(this ListTreeNode<T> self, String key, string defualtValue)
where T : IListTreeItem, IValue<T>
public static string GetObjectValueOrDefault(this JsonNode self, String key, string defualtValue)
{
try
{
@ -41,15 +38,12 @@ namespace UniJSON
}
}
public static ListTreeNode<T> GetObjectItem<T>(this ListTreeNode<T> self, String key)
where T : IListTreeItem, IValue<T>
public static JsonNode GetObjectItem(this JsonNode self, String key)
{
return self.GetObjectItem(Utf8String.From(key));
}
public static ListTreeNode<T> GetObjectItem<T>(this ListTreeNode<T> self, Utf8String key)
where T : IListTreeItem, IValue<T>
public static JsonNode GetObjectItem(this JsonNode self, Utf8String key)
{
foreach (var kv in self.ObjectItems())
{
@ -61,21 +55,18 @@ namespace UniJSON
throw new KeyNotFoundException();
}
public static bool ContainsKey<T>(this ListTreeNode<T> self, Utf8String key)
where T : IListTreeItem, IValue<T>
public static bool ContainsKey(this JsonNode self, Utf8String key)
{
return self.ObjectItems().Any(x => x.Key.GetUtf8String() == key);
}
public static bool ContainsKey<T>(this ListTreeNode<T> self, String key)
where T : IListTreeItem, IValue<T>
public static bool ContainsKey(this JsonNode self, String key)
{
var ukey = Utf8String.From(key);
return self.ContainsKey(ukey);
}
public static Utf8String KeyOf<T>(this ListTreeNode<T> self, ListTreeNode<T> node)
where T : IListTreeItem, IValue<T>
public static Utf8String KeyOf(this JsonNode self, JsonNode node)
{
foreach (var kv in self.ObjectItems())
{

View File

@ -9,7 +9,7 @@ namespace VRM.Samples
{
public static class JsonExtensions
{
public static void SetValue<T>(this ListTreeNode<JsonValue> node, string key, T value)
public static void SetValue<T>(this JsonNode node, string key, T value)
{
var f = new JsonFormatter();
f.Serialize(value);

View File

@ -11,7 +11,7 @@ public static class VrmDeserializer
{
public static glTF_VRM_extensions Deserialize(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_extensions Deserialize(JsonNode parsed)
{
var value = new glTF_VRM_extensions();
@ -63,7 +63,7 @@ public static glTF_VRM_extensions Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static glTF_VRM_Meta Deserialize_vrm_meta(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_Meta Deserialize_vrm_meta(JsonNode parsed)
{
var value = new glTF_VRM_Meta();
@ -140,7 +140,7 @@ public static glTF_VRM_Meta Deserialize_vrm_meta(ListTreeNode<JsonValue> parsed)
return value;
}
public static glTF_VRM_Humanoid Deserialize_vrm_humanoid(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_Humanoid Deserialize_vrm_humanoid(JsonNode parsed)
{
var value = new glTF_VRM_Humanoid();
@ -197,7 +197,7 @@ public static glTF_VRM_Humanoid Deserialize_vrm_humanoid(ListTreeNode<JsonValue>
return value;
}
public static List<VRM.glTF_VRM_HumanoidBone> Deserialize_vrm_humanoid_humanBones(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_HumanoidBone> Deserialize_vrm_humanoid_humanBones(JsonNode parsed)
{
var value = new List<glTF_VRM_HumanoidBone>();
foreach(var x in parsed.ArrayItems())
@ -206,7 +206,7 @@ public static List<VRM.glTF_VRM_HumanoidBone> Deserialize_vrm_humanoid_humanBone
}
return value;
}
public static glTF_VRM_HumanoidBone Deserialize_vrm_humanoid_humanBones_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_HumanoidBone Deserialize_vrm_humanoid_humanBones_LIST(JsonNode parsed)
{
var value = new glTF_VRM_HumanoidBone();
@ -253,7 +253,7 @@ public static glTF_VRM_HumanoidBone Deserialize_vrm_humanoid_humanBones_LIST(Lis
return value;
}
public static Vector3 Deserialize_vrm_humanoid_humanBones__min(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_humanoid_humanBones__min(JsonNode parsed)
{
var value = new Vector3();
@ -280,7 +280,7 @@ public static Vector3 Deserialize_vrm_humanoid_humanBones__min(ListTreeNode<Json
return value;
}
public static Vector3 Deserialize_vrm_humanoid_humanBones__max(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_humanoid_humanBones__max(JsonNode parsed)
{
var value = new Vector3();
@ -307,7 +307,7 @@ public static Vector3 Deserialize_vrm_humanoid_humanBones__max(ListTreeNode<Json
return value;
}
public static Vector3 Deserialize_vrm_humanoid_humanBones__center(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_humanoid_humanBones__center(JsonNode parsed)
{
var value = new Vector3();
@ -334,7 +334,7 @@ public static Vector3 Deserialize_vrm_humanoid_humanBones__center(ListTreeNode<J
return value;
}
public static glTF_VRM_Firstperson Deserialize_vrm_firstPerson(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_Firstperson Deserialize_vrm_firstPerson(JsonNode parsed)
{
var value = new glTF_VRM_Firstperson();
@ -386,7 +386,7 @@ public static glTF_VRM_Firstperson Deserialize_vrm_firstPerson(ListTreeNode<Json
return value;
}
public static Vector3 Deserialize_vrm_firstPerson_firstPersonBoneOffset(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_firstPerson_firstPersonBoneOffset(JsonNode parsed)
{
var value = new Vector3();
@ -413,7 +413,7 @@ public static Vector3 Deserialize_vrm_firstPerson_firstPersonBoneOffset(ListTree
return value;
}
public static List<VRM.glTF_VRM_MeshAnnotation> Deserialize_vrm_firstPerson_meshAnnotations(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_MeshAnnotation> Deserialize_vrm_firstPerson_meshAnnotations(JsonNode parsed)
{
var value = new List<glTF_VRM_MeshAnnotation>();
foreach(var x in parsed.ArrayItems())
@ -422,7 +422,7 @@ public static List<VRM.glTF_VRM_MeshAnnotation> Deserialize_vrm_firstPerson_mesh
}
return value;
}
public static glTF_VRM_MeshAnnotation Deserialize_vrm_firstPerson_meshAnnotations_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_MeshAnnotation Deserialize_vrm_firstPerson_meshAnnotations_LIST(JsonNode parsed)
{
var value = new glTF_VRM_MeshAnnotation();
@ -444,7 +444,7 @@ public static glTF_VRM_MeshAnnotation Deserialize_vrm_firstPerson_meshAnnotation
return value;
}
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalInner(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalInner(JsonNode parsed)
{
var value = new glTF_VRM_DegreeMap();
@ -471,7 +471,7 @@ public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalInn
return value;
}
public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalInner_curve(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalInner_curve(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -482,7 +482,7 @@ public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalInner_curve(L
return value;
}
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalOuter(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalOuter(JsonNode parsed)
{
var value = new glTF_VRM_DegreeMap();
@ -509,7 +509,7 @@ public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtHorizontalOut
return value;
}
public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalOuter_curve(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalOuter_curve(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -520,7 +520,7 @@ public static Single[] Deserialize_vrm_firstPerson_lookAtHorizontalOuter_curve(L
return value;
}
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalDown(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalDown(JsonNode parsed)
{
var value = new glTF_VRM_DegreeMap();
@ -547,7 +547,7 @@ public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalDown(
return value;
}
public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalDown_curve(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalDown_curve(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -558,7 +558,7 @@ public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalDown_curve(List
return value;
}
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalUp(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalUp(JsonNode parsed)
{
var value = new glTF_VRM_DegreeMap();
@ -585,7 +585,7 @@ public static glTF_VRM_DegreeMap Deserialize_vrm_firstPerson_lookAtVerticalUp(Li
return value;
}
public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalUp_curve(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalUp_curve(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -596,7 +596,7 @@ public static Single[] Deserialize_vrm_firstPerson_lookAtVerticalUp_curve(ListTr
return value;
}
public static glTF_VRM_BlendShapeMaster Deserialize_vrm_blendShapeMaster(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_BlendShapeMaster Deserialize_vrm_blendShapeMaster(JsonNode parsed)
{
var value = new glTF_VRM_BlendShapeMaster();
@ -613,7 +613,7 @@ public static glTF_VRM_BlendShapeMaster Deserialize_vrm_blendShapeMaster(ListTre
return value;
}
public static List<VRM.glTF_VRM_BlendShapeGroup> Deserialize_vrm_blendShapeMaster_blendShapeGroups(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_BlendShapeGroup> Deserialize_vrm_blendShapeMaster_blendShapeGroups(JsonNode parsed)
{
var value = new List<glTF_VRM_BlendShapeGroup>();
foreach(var x in parsed.ArrayItems())
@ -622,7 +622,7 @@ public static List<VRM.glTF_VRM_BlendShapeGroup> Deserialize_vrm_blendShapeMaste
}
return value;
}
public static glTF_VRM_BlendShapeGroup Deserialize_vrm_blendShapeMaster_blendShapeGroups_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_BlendShapeGroup Deserialize_vrm_blendShapeMaster_blendShapeGroups_LIST(JsonNode parsed)
{
var value = new glTF_VRM_BlendShapeGroup();
@ -659,7 +659,7 @@ public static glTF_VRM_BlendShapeGroup Deserialize_vrm_blendShapeMaster_blendSha
return value;
}
public static List<VRM.glTF_VRM_BlendShapeBind> Deserialize_vrm_blendShapeMaster_blendShapeGroups__binds(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_BlendShapeBind> Deserialize_vrm_blendShapeMaster_blendShapeGroups__binds(JsonNode parsed)
{
var value = new List<glTF_VRM_BlendShapeBind>();
foreach(var x in parsed.ArrayItems())
@ -668,7 +668,7 @@ public static List<VRM.glTF_VRM_BlendShapeBind> Deserialize_vrm_blendShapeMaster
}
return value;
}
public static glTF_VRM_BlendShapeBind Deserialize_vrm_blendShapeMaster_blendShapeGroups__binds_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_BlendShapeBind Deserialize_vrm_blendShapeMaster_blendShapeGroups__binds_LIST(JsonNode parsed)
{
var value = new glTF_VRM_BlendShapeBind();
@ -695,7 +695,7 @@ public static glTF_VRM_BlendShapeBind Deserialize_vrm_blendShapeMaster_blendShap
return value;
}
public static List<VRM.glTF_VRM_MaterialValueBind> Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_MaterialValueBind> Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues(JsonNode parsed)
{
var value = new List<glTF_VRM_MaterialValueBind>();
foreach(var x in parsed.ArrayItems())
@ -704,7 +704,7 @@ public static List<VRM.glTF_VRM_MaterialValueBind> Deserialize_vrm_blendShapeMas
}
return value;
}
public static glTF_VRM_MaterialValueBind Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_MaterialValueBind Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues_LIST(JsonNode parsed)
{
var value = new glTF_VRM_MaterialValueBind();
@ -731,7 +731,7 @@ public static glTF_VRM_MaterialValueBind Deserialize_vrm_blendShapeMaster_blendS
return value;
}
public static Single[] Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues__targetValue(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_blendShapeMaster_blendShapeGroups__materialValues__targetValue(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -742,7 +742,7 @@ public static Single[] Deserialize_vrm_blendShapeMaster_blendShapeGroups__materi
return value;
}
public static glTF_VRM_SecondaryAnimation Deserialize_vrm_secondaryAnimation(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_SecondaryAnimation Deserialize_vrm_secondaryAnimation(JsonNode parsed)
{
var value = new glTF_VRM_SecondaryAnimation();
@ -764,7 +764,7 @@ public static glTF_VRM_SecondaryAnimation Deserialize_vrm_secondaryAnimation(Lis
return value;
}
public static List<VRM.glTF_VRM_SecondaryAnimationGroup> Deserialize_vrm_secondaryAnimation_boneGroups(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_SecondaryAnimationGroup> Deserialize_vrm_secondaryAnimation_boneGroups(JsonNode parsed)
{
var value = new List<glTF_VRM_SecondaryAnimationGroup>();
foreach(var x in parsed.ArrayItems())
@ -773,7 +773,7 @@ public static List<VRM.glTF_VRM_SecondaryAnimationGroup> Deserialize_vrm_seconda
}
return value;
}
public static glTF_VRM_SecondaryAnimationGroup Deserialize_vrm_secondaryAnimation_boneGroups_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_SecondaryAnimationGroup Deserialize_vrm_secondaryAnimation_boneGroups_LIST(JsonNode parsed)
{
var value = new glTF_VRM_SecondaryAnimationGroup();
@ -830,7 +830,7 @@ public static glTF_VRM_SecondaryAnimationGroup Deserialize_vrm_secondaryAnimatio
return value;
}
public static Vector3 Deserialize_vrm_secondaryAnimation_boneGroups__gravityDir(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_secondaryAnimation_boneGroups__gravityDir(JsonNode parsed)
{
var value = new Vector3();
@ -857,7 +857,7 @@ public static Vector3 Deserialize_vrm_secondaryAnimation_boneGroups__gravityDir(
return value;
}
public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__bones(ListTreeNode<JsonValue> parsed)
public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__bones(JsonNode parsed)
{
var value = new Int32[parsed.GetArrayCount()];
int i=0;
@ -868,7 +868,7 @@ public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__bones(ListT
return value;
}
public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__colliderGroups(ListTreeNode<JsonValue> parsed)
public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__colliderGroups(JsonNode parsed)
{
var value = new Int32[parsed.GetArrayCount()];
int i=0;
@ -879,7 +879,7 @@ public static Int32[] Deserialize_vrm_secondaryAnimation_boneGroups__colliderGro
return value;
}
public static List<VRM.glTF_VRM_SecondaryAnimationColliderGroup> Deserialize_vrm_secondaryAnimation_colliderGroups(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_SecondaryAnimationColliderGroup> Deserialize_vrm_secondaryAnimation_colliderGroups(JsonNode parsed)
{
var value = new List<glTF_VRM_SecondaryAnimationColliderGroup>();
foreach(var x in parsed.ArrayItems())
@ -888,7 +888,7 @@ public static List<VRM.glTF_VRM_SecondaryAnimationColliderGroup> Deserialize_vrm
}
return value;
}
public static glTF_VRM_SecondaryAnimationColliderGroup Deserialize_vrm_secondaryAnimation_colliderGroups_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_SecondaryAnimationColliderGroup Deserialize_vrm_secondaryAnimation_colliderGroups_LIST(JsonNode parsed)
{
var value = new glTF_VRM_SecondaryAnimationColliderGroup();
@ -910,7 +910,7 @@ public static glTF_VRM_SecondaryAnimationColliderGroup Deserialize_vrm_secondary
return value;
}
public static List<VRM.glTF_VRM_SecondaryAnimationCollider> Deserialize_vrm_secondaryAnimation_colliderGroups__colliders(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_SecondaryAnimationCollider> Deserialize_vrm_secondaryAnimation_colliderGroups__colliders(JsonNode parsed)
{
var value = new List<glTF_VRM_SecondaryAnimationCollider>();
foreach(var x in parsed.ArrayItems())
@ -919,7 +919,7 @@ public static List<VRM.glTF_VRM_SecondaryAnimationCollider> Deserialize_vrm_seco
}
return value;
}
public static glTF_VRM_SecondaryAnimationCollider Deserialize_vrm_secondaryAnimation_colliderGroups__colliders_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_SecondaryAnimationCollider Deserialize_vrm_secondaryAnimation_colliderGroups__colliders_LIST(JsonNode parsed)
{
var value = new glTF_VRM_SecondaryAnimationCollider();
@ -941,7 +941,7 @@ public static glTF_VRM_SecondaryAnimationCollider Deserialize_vrm_secondaryAnima
return value;
}
public static Vector3 Deserialize_vrm_secondaryAnimation_colliderGroups__colliders__offset(ListTreeNode<JsonValue> parsed)
public static Vector3 Deserialize_vrm_secondaryAnimation_colliderGroups__colliders__offset(JsonNode parsed)
{
var value = new Vector3();
@ -968,7 +968,7 @@ public static Vector3 Deserialize_vrm_secondaryAnimation_colliderGroups__collide
return value;
}
public static List<VRM.glTF_VRM_Material> Deserialize_vrm_materialProperties(ListTreeNode<JsonValue> parsed)
public static List<VRM.glTF_VRM_Material> Deserialize_vrm_materialProperties(JsonNode parsed)
{
var value = new List<glTF_VRM_Material>();
foreach(var x in parsed.ArrayItems())
@ -977,7 +977,7 @@ public static List<VRM.glTF_VRM_Material> Deserialize_vrm_materialProperties(Lis
}
return value;
}
public static glTF_VRM_Material Deserialize_vrm_materialProperties_LIST(ListTreeNode<JsonValue> parsed)
public static glTF_VRM_Material Deserialize_vrm_materialProperties_LIST(JsonNode parsed)
{
var value = new glTF_VRM_Material();
@ -1030,7 +1030,7 @@ public static glTF_VRM_Material Deserialize_vrm_materialProperties_LIST(ListTree
}
public static Dictionary<String, Single> Deserialize_vrm_materialProperties__floatProperties(ListTreeNode<JsonValue> parsed)
public static Dictionary<String, Single> Deserialize_vrm_materialProperties__floatProperties(JsonNode parsed)
{
var value = new Dictionary<string, Single>();
foreach(var kv in parsed.ObjectItems())
@ -1041,7 +1041,7 @@ public static Dictionary<String, Single> Deserialize_vrm_materialProperties__flo
}
public static Dictionary<String, Single[]> Deserialize_vrm_materialProperties__vectorProperties(ListTreeNode<JsonValue> parsed)
public static Dictionary<String, Single[]> Deserialize_vrm_materialProperties__vectorProperties(JsonNode parsed)
{
var value = new Dictionary<string, Single[]>();
foreach(var kv in parsed.ObjectItems())
@ -1051,7 +1051,7 @@ public static Dictionary<String, Single[]> Deserialize_vrm_materialProperties__v
return value;
}
public static Single[] Deserialize_vrm_materialProperties__vectorProperties_DICT(ListTreeNode<JsonValue> parsed)
public static Single[] Deserialize_vrm_materialProperties__vectorProperties_DICT(JsonNode parsed)
{
var value = new Single[parsed.GetArrayCount()];
int i=0;
@ -1063,7 +1063,7 @@ public static Single[] Deserialize_vrm_materialProperties__vectorProperties_DICT
}
public static Dictionary<String, Int32> Deserialize_vrm_materialProperties__textureProperties(ListTreeNode<JsonValue> parsed)
public static Dictionary<String, Int32> Deserialize_vrm_materialProperties__textureProperties(JsonNode parsed)
{
var value = new Dictionary<string, Int32>();
foreach(var kv in parsed.ObjectItems())
@ -1074,7 +1074,7 @@ public static Dictionary<String, Int32> Deserialize_vrm_materialProperties__text
}
public static Dictionary<String, Boolean> Deserialize_vrm_materialProperties__keywordMap(ListTreeNode<JsonValue> parsed)
public static Dictionary<String, Boolean> Deserialize_vrm_materialProperties__keywordMap(JsonNode parsed)
{
var value = new Dictionary<string, Boolean>();
foreach(var kv in parsed.ObjectItems())
@ -1085,7 +1085,7 @@ public static Dictionary<String, Boolean> Deserialize_vrm_materialProperties__ke
}
public static Dictionary<String, String> Deserialize_vrm_materialProperties__tagMap(ListTreeNode<JsonValue> parsed)
public static Dictionary<String, String> Deserialize_vrm_materialProperties__tagMap(JsonNode parsed)
{
var value = new Dictionary<string, String>();
foreach(var kv in parsed.ObjectItems())

View File

@ -28,7 +28,7 @@ public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_constraints extens
}
public static VRMC_constraints Deserialize(ListTreeNode<JsonValue> parsed)
public static VRMC_constraints Deserialize(JsonNode parsed)
{
var value = new VRMC_constraints();
@ -65,7 +65,7 @@ public static VRMC_constraints Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static PositionConstraint Deserialize_Position(ListTreeNode<JsonValue> parsed)
public static PositionConstraint Deserialize_Position(JsonNode parsed)
{
var value = new PositionConstraint();
@ -117,7 +117,7 @@ public static PositionConstraint Deserialize_Position(ListTreeNode<JsonValue> pa
return value;
}
public static bool[] Deserialize_FreezeAxes(ListTreeNode<JsonValue> parsed)
public static bool[] Deserialize_FreezeAxes(JsonNode parsed)
{
var value = new bool[parsed.GetArrayCount()];
int i=0;
@ -128,7 +128,7 @@ public static bool[] Deserialize_FreezeAxes(ListTreeNode<JsonValue> parsed)
return value;
}
public static RotationConstraint Deserialize_Rotation(ListTreeNode<JsonValue> parsed)
public static RotationConstraint Deserialize_Rotation(JsonNode parsed)
{
var value = new RotationConstraint();
@ -180,7 +180,7 @@ public static RotationConstraint Deserialize_Rotation(ListTreeNode<JsonValue> pa
return value;
}
public static AimConstraint Deserialize_Aim(ListTreeNode<JsonValue> parsed)
public static AimConstraint Deserialize_Aim(JsonNode parsed)
{
var value = new AimConstraint();
@ -242,7 +242,7 @@ public static AimConstraint Deserialize_Aim(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_AimVector(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_AimVector(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -253,7 +253,7 @@ public static float[] Deserialize_AimVector(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_UpVector(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_UpVector(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;

View File

@ -28,7 +28,7 @@ public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_materials_mtoon ex
}
public static VRMC_materials_mtoon Deserialize(ListTreeNode<JsonValue> parsed)
public static VRMC_materials_mtoon Deserialize(JsonNode parsed)
{
var value = new VRMC_materials_mtoon();
@ -170,7 +170,7 @@ public static VRMC_materials_mtoon Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_ShadeFactor(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_ShadeFactor(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -181,7 +181,7 @@ public static float[] Deserialize_ShadeFactor(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_RimFactor(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_RimFactor(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -192,7 +192,7 @@ public static float[] Deserialize_RimFactor(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_OutlineFactor(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_OutlineFactor(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;

View File

@ -28,7 +28,7 @@ public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_node_collider exte
}
public static VRMC_node_collider Deserialize(ListTreeNode<JsonValue> parsed)
public static VRMC_node_collider Deserialize(JsonNode parsed)
{
var value = new VRMC_node_collider();
@ -55,7 +55,7 @@ public static VRMC_node_collider Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<ColliderShape> Deserialize_Shapes(ListTreeNode<JsonValue> parsed)
public static List<ColliderShape> Deserialize_Shapes(JsonNode parsed)
{
var value = new List<ColliderShape>();
foreach(var x in parsed.ArrayItems())
@ -65,7 +65,7 @@ public static List<ColliderShape> Deserialize_Shapes(ListTreeNode<JsonValue> par
return value;
}
public static ColliderShape Deserialize_Shapes_ITEM(ListTreeNode<JsonValue> parsed)
public static ColliderShape Deserialize_Shapes_ITEM(JsonNode parsed)
{
var value = new ColliderShape();
@ -97,7 +97,7 @@ public static ColliderShape Deserialize_Shapes_ITEM(ListTreeNode<JsonValue> pars
return value;
}
public static ColliderShapeSphere Deserialize_Sphere(ListTreeNode<JsonValue> parsed)
public static ColliderShapeSphere Deserialize_Sphere(JsonNode parsed)
{
var value = new ColliderShapeSphere();
@ -119,7 +119,7 @@ public static ColliderShapeSphere Deserialize_Sphere(ListTreeNode<JsonValue> par
return value;
}
public static float[] Deserialize_Offset(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_Offset(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -130,7 +130,7 @@ public static float[] Deserialize_Offset(ListTreeNode<JsonValue> parsed)
return value;
}
public static ColliderShapeCapsule Deserialize_Capsule(ListTreeNode<JsonValue> parsed)
public static ColliderShapeCapsule Deserialize_Capsule(JsonNode parsed)
{
var value = new ColliderShapeCapsule();
@ -157,7 +157,7 @@ public static ColliderShapeCapsule Deserialize_Capsule(ListTreeNode<JsonValue> p
return value;
}
public static float[] Deserialize_Tail(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_Tail(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;

View File

@ -28,7 +28,7 @@ public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_springBone extensi
}
public static VRMC_springBone Deserialize(ListTreeNode<JsonValue> parsed)
public static VRMC_springBone Deserialize(JsonNode parsed)
{
var value = new VRMC_springBone();
@ -55,7 +55,7 @@ public static VRMC_springBone Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<Spring> Deserialize_Springs(ListTreeNode<JsonValue> parsed)
public static List<Spring> Deserialize_Springs(JsonNode parsed)
{
var value = new List<Spring>();
foreach(var x in parsed.ArrayItems())
@ -65,7 +65,7 @@ public static List<Spring> Deserialize_Springs(ListTreeNode<JsonValue> parsed)
return value;
}
public static Spring Deserialize_Springs_ITEM(ListTreeNode<JsonValue> parsed)
public static Spring Deserialize_Springs_ITEM(JsonNode parsed)
{
var value = new Spring();
@ -92,7 +92,7 @@ public static Spring Deserialize_Springs_ITEM(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<SpringBoneJoint> Deserialize_Joints(ListTreeNode<JsonValue> parsed)
public static List<SpringBoneJoint> Deserialize_Joints(JsonNode parsed)
{
var value = new List<SpringBoneJoint>();
foreach(var x in parsed.ArrayItems())
@ -102,7 +102,7 @@ public static List<SpringBoneJoint> Deserialize_Joints(ListTreeNode<JsonValue> p
return value;
}
public static SpringBoneJoint Deserialize_Joints_ITEM(ListTreeNode<JsonValue> parsed)
public static SpringBoneJoint Deserialize_Joints_ITEM(JsonNode parsed)
{
var value = new SpringBoneJoint();
@ -159,7 +159,7 @@ public static SpringBoneJoint Deserialize_Joints_ITEM(ListTreeNode<JsonValue> pa
return value;
}
public static float[] Deserialize_GravityDir(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_GravityDir(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -170,7 +170,7 @@ public static float[] Deserialize_GravityDir(ListTreeNode<JsonValue> parsed)
return value;
}
public static int[] Deserialize_Colliders(ListTreeNode<JsonValue> parsed)
public static int[] Deserialize_Colliders(JsonNode parsed)
{
var value = new int[parsed.GetArrayCount()];
int i=0;

View File

@ -28,7 +28,7 @@ public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_vrm extension)
}
public static VRMC_vrm Deserialize(ListTreeNode<JsonValue> parsed)
public static VRMC_vrm Deserialize(JsonNode parsed)
{
var value = new VRMC_vrm();
@ -70,7 +70,7 @@ public static VRMC_vrm Deserialize(ListTreeNode<JsonValue> parsed)
return value;
}
public static Meta Deserialize_Meta(ListTreeNode<JsonValue> parsed)
public static Meta Deserialize_Meta(JsonNode parsed)
{
var value = new Meta();
@ -167,7 +167,7 @@ public static Meta Deserialize_Meta(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<string> Deserialize_Authors(ListTreeNode<JsonValue> parsed)
public static List<string> Deserialize_Authors(JsonNode parsed)
{
var value = new List<string>();
foreach(var x in parsed.ArrayItems())
@ -177,7 +177,7 @@ public static List<string> Deserialize_Authors(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<string> Deserialize_References(ListTreeNode<JsonValue> parsed)
public static List<string> Deserialize_References(JsonNode parsed)
{
var value = new List<string>();
foreach(var x in parsed.ArrayItems())
@ -187,7 +187,7 @@ public static List<string> Deserialize_References(ListTreeNode<JsonValue> parsed
return value;
}
public static Humanoid Deserialize_Humanoid(ListTreeNode<JsonValue> parsed)
public static Humanoid Deserialize_Humanoid(JsonNode parsed)
{
var value = new Humanoid();
@ -204,7 +204,7 @@ public static Humanoid Deserialize_Humanoid(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBones Deserialize_HumanBones(ListTreeNode<JsonValue> parsed)
public static HumanBones Deserialize_HumanBones(JsonNode parsed)
{
var value = new HumanBones();
@ -491,7 +491,7 @@ public static HumanBones Deserialize_HumanBones(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Hips(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Hips(JsonNode parsed)
{
var value = new HumanBone();
@ -508,7 +508,7 @@ public static HumanBone Deserialize_Hips(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Spine(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Spine(JsonNode parsed)
{
var value = new HumanBone();
@ -525,7 +525,7 @@ public static HumanBone Deserialize_Spine(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Chest(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Chest(JsonNode parsed)
{
var value = new HumanBone();
@ -542,7 +542,7 @@ public static HumanBone Deserialize_Chest(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_UpperChest(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_UpperChest(JsonNode parsed)
{
var value = new HumanBone();
@ -559,7 +559,7 @@ public static HumanBone Deserialize_UpperChest(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Neck(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Neck(JsonNode parsed)
{
var value = new HumanBone();
@ -576,7 +576,7 @@ public static HumanBone Deserialize_Neck(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Head(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Head(JsonNode parsed)
{
var value = new HumanBone();
@ -593,7 +593,7 @@ public static HumanBone Deserialize_Head(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftEye(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftEye(JsonNode parsed)
{
var value = new HumanBone();
@ -610,7 +610,7 @@ public static HumanBone Deserialize_LeftEye(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_RightEye(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightEye(JsonNode parsed)
{
var value = new HumanBone();
@ -627,7 +627,7 @@ public static HumanBone Deserialize_RightEye(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_Jaw(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_Jaw(JsonNode parsed)
{
var value = new HumanBone();
@ -644,7 +644,7 @@ public static HumanBone Deserialize_Jaw(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftUpperLeg(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftUpperLeg(JsonNode parsed)
{
var value = new HumanBone();
@ -661,7 +661,7 @@ public static HumanBone Deserialize_LeftUpperLeg(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftLowerLeg(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftLowerLeg(JsonNode parsed)
{
var value = new HumanBone();
@ -678,7 +678,7 @@ public static HumanBone Deserialize_LeftLowerLeg(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftFoot(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftFoot(JsonNode parsed)
{
var value = new HumanBone();
@ -695,7 +695,7 @@ public static HumanBone Deserialize_LeftFoot(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftToes(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftToes(JsonNode parsed)
{
var value = new HumanBone();
@ -712,7 +712,7 @@ public static HumanBone Deserialize_LeftToes(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_RightUpperLeg(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightUpperLeg(JsonNode parsed)
{
var value = new HumanBone();
@ -729,7 +729,7 @@ public static HumanBone Deserialize_RightUpperLeg(ListTreeNode<JsonValue> parsed
return value;
}
public static HumanBone Deserialize_RightLowerLeg(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightLowerLeg(JsonNode parsed)
{
var value = new HumanBone();
@ -746,7 +746,7 @@ public static HumanBone Deserialize_RightLowerLeg(ListTreeNode<JsonValue> parsed
return value;
}
public static HumanBone Deserialize_RightFoot(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightFoot(JsonNode parsed)
{
var value = new HumanBone();
@ -763,7 +763,7 @@ public static HumanBone Deserialize_RightFoot(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_RightToes(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightToes(JsonNode parsed)
{
var value = new HumanBone();
@ -780,7 +780,7 @@ public static HumanBone Deserialize_RightToes(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftShoulder(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftShoulder(JsonNode parsed)
{
var value = new HumanBone();
@ -797,7 +797,7 @@ public static HumanBone Deserialize_LeftShoulder(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftUpperArm(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftUpperArm(JsonNode parsed)
{
var value = new HumanBone();
@ -814,7 +814,7 @@ public static HumanBone Deserialize_LeftUpperArm(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftLowerArm(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftLowerArm(JsonNode parsed)
{
var value = new HumanBone();
@ -831,7 +831,7 @@ public static HumanBone Deserialize_LeftLowerArm(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftHand(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftHand(JsonNode parsed)
{
var value = new HumanBone();
@ -848,7 +848,7 @@ public static HumanBone Deserialize_LeftHand(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_RightShoulder(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightShoulder(JsonNode parsed)
{
var value = new HumanBone();
@ -865,7 +865,7 @@ public static HumanBone Deserialize_RightShoulder(ListTreeNode<JsonValue> parsed
return value;
}
public static HumanBone Deserialize_RightUpperArm(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightUpperArm(JsonNode parsed)
{
var value = new HumanBone();
@ -882,7 +882,7 @@ public static HumanBone Deserialize_RightUpperArm(ListTreeNode<JsonValue> parsed
return value;
}
public static HumanBone Deserialize_RightLowerArm(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightLowerArm(JsonNode parsed)
{
var value = new HumanBone();
@ -899,7 +899,7 @@ public static HumanBone Deserialize_RightLowerArm(ListTreeNode<JsonValue> parsed
return value;
}
public static HumanBone Deserialize_RightHand(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightHand(JsonNode parsed)
{
var value = new HumanBone();
@ -916,7 +916,7 @@ public static HumanBone Deserialize_RightHand(ListTreeNode<JsonValue> parsed)
return value;
}
public static HumanBone Deserialize_LeftThumbProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftThumbProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -933,7 +933,7 @@ public static HumanBone Deserialize_LeftThumbProximal(ListTreeNode<JsonValue> pa
return value;
}
public static HumanBone Deserialize_LeftThumbIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftThumbIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -950,7 +950,7 @@ public static HumanBone Deserialize_LeftThumbIntermediate(ListTreeNode<JsonValue
return value;
}
public static HumanBone Deserialize_LeftThumbDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftThumbDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -967,7 +967,7 @@ public static HumanBone Deserialize_LeftThumbDistal(ListTreeNode<JsonValue> pars
return value;
}
public static HumanBone Deserialize_LeftIndexProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftIndexProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -984,7 +984,7 @@ public static HumanBone Deserialize_LeftIndexProximal(ListTreeNode<JsonValue> pa
return value;
}
public static HumanBone Deserialize_LeftIndexIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftIndexIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1001,7 +1001,7 @@ public static HumanBone Deserialize_LeftIndexIntermediate(ListTreeNode<JsonValue
return value;
}
public static HumanBone Deserialize_LeftIndexDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftIndexDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1018,7 +1018,7 @@ public static HumanBone Deserialize_LeftIndexDistal(ListTreeNode<JsonValue> pars
return value;
}
public static HumanBone Deserialize_LeftMiddleProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftMiddleProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1035,7 +1035,7 @@ public static HumanBone Deserialize_LeftMiddleProximal(ListTreeNode<JsonValue> p
return value;
}
public static HumanBone Deserialize_LeftMiddleIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftMiddleIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1052,7 +1052,7 @@ public static HumanBone Deserialize_LeftMiddleIntermediate(ListTreeNode<JsonValu
return value;
}
public static HumanBone Deserialize_LeftMiddleDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftMiddleDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1069,7 +1069,7 @@ public static HumanBone Deserialize_LeftMiddleDistal(ListTreeNode<JsonValue> par
return value;
}
public static HumanBone Deserialize_LeftRingProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftRingProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1086,7 +1086,7 @@ public static HumanBone Deserialize_LeftRingProximal(ListTreeNode<JsonValue> par
return value;
}
public static HumanBone Deserialize_LeftRingIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftRingIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1103,7 +1103,7 @@ public static HumanBone Deserialize_LeftRingIntermediate(ListTreeNode<JsonValue>
return value;
}
public static HumanBone Deserialize_LeftRingDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftRingDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1120,7 +1120,7 @@ public static HumanBone Deserialize_LeftRingDistal(ListTreeNode<JsonValue> parse
return value;
}
public static HumanBone Deserialize_LeftLittleProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftLittleProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1137,7 +1137,7 @@ public static HumanBone Deserialize_LeftLittleProximal(ListTreeNode<JsonValue> p
return value;
}
public static HumanBone Deserialize_LeftLittleIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftLittleIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1154,7 +1154,7 @@ public static HumanBone Deserialize_LeftLittleIntermediate(ListTreeNode<JsonValu
return value;
}
public static HumanBone Deserialize_LeftLittleDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_LeftLittleDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1171,7 +1171,7 @@ public static HumanBone Deserialize_LeftLittleDistal(ListTreeNode<JsonValue> par
return value;
}
public static HumanBone Deserialize_RightThumbProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightThumbProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1188,7 +1188,7 @@ public static HumanBone Deserialize_RightThumbProximal(ListTreeNode<JsonValue> p
return value;
}
public static HumanBone Deserialize_RightThumbIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightThumbIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1205,7 +1205,7 @@ public static HumanBone Deserialize_RightThumbIntermediate(ListTreeNode<JsonValu
return value;
}
public static HumanBone Deserialize_RightThumbDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightThumbDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1222,7 +1222,7 @@ public static HumanBone Deserialize_RightThumbDistal(ListTreeNode<JsonValue> par
return value;
}
public static HumanBone Deserialize_RightIndexProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightIndexProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1239,7 +1239,7 @@ public static HumanBone Deserialize_RightIndexProximal(ListTreeNode<JsonValue> p
return value;
}
public static HumanBone Deserialize_RightIndexIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightIndexIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1256,7 +1256,7 @@ public static HumanBone Deserialize_RightIndexIntermediate(ListTreeNode<JsonValu
return value;
}
public static HumanBone Deserialize_RightIndexDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightIndexDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1273,7 +1273,7 @@ public static HumanBone Deserialize_RightIndexDistal(ListTreeNode<JsonValue> par
return value;
}
public static HumanBone Deserialize_RightMiddleProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightMiddleProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1290,7 +1290,7 @@ public static HumanBone Deserialize_RightMiddleProximal(ListTreeNode<JsonValue>
return value;
}
public static HumanBone Deserialize_RightMiddleIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightMiddleIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1307,7 +1307,7 @@ public static HumanBone Deserialize_RightMiddleIntermediate(ListTreeNode<JsonVal
return value;
}
public static HumanBone Deserialize_RightMiddleDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightMiddleDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1324,7 +1324,7 @@ public static HumanBone Deserialize_RightMiddleDistal(ListTreeNode<JsonValue> pa
return value;
}
public static HumanBone Deserialize_RightRingProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightRingProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1341,7 +1341,7 @@ public static HumanBone Deserialize_RightRingProximal(ListTreeNode<JsonValue> pa
return value;
}
public static HumanBone Deserialize_RightRingIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightRingIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1358,7 +1358,7 @@ public static HumanBone Deserialize_RightRingIntermediate(ListTreeNode<JsonValue
return value;
}
public static HumanBone Deserialize_RightRingDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightRingDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1375,7 +1375,7 @@ public static HumanBone Deserialize_RightRingDistal(ListTreeNode<JsonValue> pars
return value;
}
public static HumanBone Deserialize_RightLittleProximal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightLittleProximal(JsonNode parsed)
{
var value = new HumanBone();
@ -1392,7 +1392,7 @@ public static HumanBone Deserialize_RightLittleProximal(ListTreeNode<JsonValue>
return value;
}
public static HumanBone Deserialize_RightLittleIntermediate(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightLittleIntermediate(JsonNode parsed)
{
var value = new HumanBone();
@ -1409,7 +1409,7 @@ public static HumanBone Deserialize_RightLittleIntermediate(ListTreeNode<JsonVal
return value;
}
public static HumanBone Deserialize_RightLittleDistal(ListTreeNode<JsonValue> parsed)
public static HumanBone Deserialize_RightLittleDistal(JsonNode parsed)
{
var value = new HumanBone();
@ -1426,7 +1426,7 @@ public static HumanBone Deserialize_RightLittleDistal(ListTreeNode<JsonValue> pa
return value;
}
public static FirstPerson Deserialize_FirstPerson(ListTreeNode<JsonValue> parsed)
public static FirstPerson Deserialize_FirstPerson(JsonNode parsed)
{
var value = new FirstPerson();
@ -1443,7 +1443,7 @@ public static FirstPerson Deserialize_FirstPerson(ListTreeNode<JsonValue> parsed
return value;
}
public static List<MeshAnnotation> Deserialize_MeshAnnotations(ListTreeNode<JsonValue> parsed)
public static List<MeshAnnotation> Deserialize_MeshAnnotations(JsonNode parsed)
{
var value = new List<MeshAnnotation>();
foreach(var x in parsed.ArrayItems())
@ -1453,7 +1453,7 @@ public static List<MeshAnnotation> Deserialize_MeshAnnotations(ListTreeNode<Json
return value;
}
public static MeshAnnotation Deserialize_MeshAnnotations_ITEM(ListTreeNode<JsonValue> parsed)
public static MeshAnnotation Deserialize_MeshAnnotations_ITEM(JsonNode parsed)
{
var value = new MeshAnnotation();
@ -1475,7 +1475,7 @@ public static MeshAnnotation Deserialize_MeshAnnotations_ITEM(ListTreeNode<JsonV
return value;
}
public static LookAt Deserialize_LookAt(ListTreeNode<JsonValue> parsed)
public static LookAt Deserialize_LookAt(JsonNode parsed)
{
var value = new LookAt();
@ -1517,7 +1517,7 @@ public static LookAt Deserialize_LookAt(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_OffsetFromHeadBone(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_OffsetFromHeadBone(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -1528,7 +1528,7 @@ public static float[] Deserialize_OffsetFromHeadBone(ListTreeNode<JsonValue> par
return value;
}
public static LookAtRangeMap Deserialize_LookAtHorizontalInner(ListTreeNode<JsonValue> parsed)
public static LookAtRangeMap Deserialize_LookAtHorizontalInner(JsonNode parsed)
{
var value = new LookAtRangeMap();
@ -1550,7 +1550,7 @@ public static LookAtRangeMap Deserialize_LookAtHorizontalInner(ListTreeNode<Json
return value;
}
public static LookAtRangeMap Deserialize_LookAtHorizontalOuter(ListTreeNode<JsonValue> parsed)
public static LookAtRangeMap Deserialize_LookAtHorizontalOuter(JsonNode parsed)
{
var value = new LookAtRangeMap();
@ -1572,7 +1572,7 @@ public static LookAtRangeMap Deserialize_LookAtHorizontalOuter(ListTreeNode<Json
return value;
}
public static LookAtRangeMap Deserialize_LookAtVerticalDown(ListTreeNode<JsonValue> parsed)
public static LookAtRangeMap Deserialize_LookAtVerticalDown(JsonNode parsed)
{
var value = new LookAtRangeMap();
@ -1594,7 +1594,7 @@ public static LookAtRangeMap Deserialize_LookAtVerticalDown(ListTreeNode<JsonVal
return value;
}
public static LookAtRangeMap Deserialize_LookAtVerticalUp(ListTreeNode<JsonValue> parsed)
public static LookAtRangeMap Deserialize_LookAtVerticalUp(JsonNode parsed)
{
var value = new LookAtRangeMap();
@ -1616,7 +1616,7 @@ public static LookAtRangeMap Deserialize_LookAtVerticalUp(ListTreeNode<JsonValue
return value;
}
public static List<Expression> Deserialize_Expressions(ListTreeNode<JsonValue> parsed)
public static List<Expression> Deserialize_Expressions(JsonNode parsed)
{
var value = new List<Expression>();
foreach(var x in parsed.ArrayItems())
@ -1626,7 +1626,7 @@ public static List<Expression> Deserialize_Expressions(ListTreeNode<JsonValue> p
return value;
}
public static Expression Deserialize_Expressions_ITEM(ListTreeNode<JsonValue> parsed)
public static Expression Deserialize_Expressions_ITEM(JsonNode parsed)
{
var value = new Expression();
@ -1693,7 +1693,7 @@ public static Expression Deserialize_Expressions_ITEM(ListTreeNode<JsonValue> pa
return value;
}
public static List<MorphTargetBind> Deserialize_MorphTargetBinds(ListTreeNode<JsonValue> parsed)
public static List<MorphTargetBind> Deserialize_MorphTargetBinds(JsonNode parsed)
{
var value = new List<MorphTargetBind>();
foreach(var x in parsed.ArrayItems())
@ -1703,7 +1703,7 @@ public static List<MorphTargetBind> Deserialize_MorphTargetBinds(ListTreeNode<Js
return value;
}
public static MorphTargetBind Deserialize_MorphTargetBinds_ITEM(ListTreeNode<JsonValue> parsed)
public static MorphTargetBind Deserialize_MorphTargetBinds_ITEM(JsonNode parsed)
{
var value = new MorphTargetBind();
@ -1740,7 +1740,7 @@ public static MorphTargetBind Deserialize_MorphTargetBinds_ITEM(ListTreeNode<Jso
return value;
}
public static List<MaterialColorBind> Deserialize_MaterialColorBinds(ListTreeNode<JsonValue> parsed)
public static List<MaterialColorBind> Deserialize_MaterialColorBinds(JsonNode parsed)
{
var value = new List<MaterialColorBind>();
foreach(var x in parsed.ArrayItems())
@ -1750,7 +1750,7 @@ public static List<MaterialColorBind> Deserialize_MaterialColorBinds(ListTreeNod
return value;
}
public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(ListTreeNode<JsonValue> parsed)
public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(JsonNode parsed)
{
var value = new MaterialColorBind();
@ -1787,7 +1787,7 @@ public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(ListTreeNode
return value;
}
public static float[] Deserialize_TargetValue(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_TargetValue(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -1798,7 +1798,7 @@ public static float[] Deserialize_TargetValue(ListTreeNode<JsonValue> parsed)
return value;
}
public static List<TextureTransformBind> Deserialize_TextureTransformBinds(ListTreeNode<JsonValue> parsed)
public static List<TextureTransformBind> Deserialize_TextureTransformBinds(JsonNode parsed)
{
var value = new List<TextureTransformBind>();
foreach(var x in parsed.ArrayItems())
@ -1808,7 +1808,7 @@ public static List<TextureTransformBind> Deserialize_TextureTransformBinds(ListT
return value;
}
public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(ListTreeNode<JsonValue> parsed)
public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(JsonNode parsed)
{
var value = new TextureTransformBind();
@ -1845,7 +1845,7 @@ public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(ListTr
return value;
}
public static float[] Deserialize_Scaling(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_Scaling(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;
@ -1856,7 +1856,7 @@ public static float[] Deserialize_Scaling(ListTreeNode<JsonValue> parsed)
return value;
}
public static float[] Deserialize_Offset(ListTreeNode<JsonValue> parsed)
public static float[] Deserialize_Offset(JsonNode parsed)
{
var value = new float[parsed.GetArrayCount()];
int i=0;

View File

@ -10,7 +10,7 @@ namespace UniVRM10
/// </summary>
public static class Migration
{
static bool TryGet(this UniGLTF.glTFExtensionImport extensions, string key, out ListTreeNode<JsonValue> value)
static bool TryGet(this UniGLTF.glTFExtensionImport extensions, string key, out JsonNode value)
{
foreach (var kv in extensions.ObjectItems())
{
@ -46,7 +46,7 @@ namespace UniVRM10
// },
// "axisLength": 0
// },
static UniGLTF.Extensions.VRMC_vrm.HumanBone MigrateHumanoidBone(ListTreeNode<JsonValue> vrm0)
static UniGLTF.Extensions.VRMC_vrm.HumanBone MigrateHumanoidBone(JsonNode vrm0)
{
return new UniGLTF.Extensions.VRMC_vrm.HumanBone
{
@ -54,7 +54,7 @@ namespace UniVRM10
};
}
static UniGLTF.Extensions.VRMC_vrm.Humanoid MigrateHumanoid(ListTreeNode<JsonValue> vrm0)
static UniGLTF.Extensions.VRMC_vrm.Humanoid MigrateHumanoid(JsonNode vrm0)
{
var humanoid = new UniGLTF.Extensions.VRMC_vrm.Humanoid
{
@ -149,7 +149,7 @@ namespace UniVRM10
// "licenseName": "Other",
// "otherLicenseUrl": "https://3d.nicovideo.jp/alicia/rule.html"
// },
static UniGLTF.Extensions.VRMC_vrm.Meta MigrateMeta(ListTreeNode<JsonValue> vrm0)
static UniGLTF.Extensions.VRMC_vrm.Meta MigrateMeta(JsonNode vrm0)
{
var meta = new UniGLTF.Extensions.VRMC_vrm.Meta
{
@ -274,7 +274,7 @@ namespace UniVRM10
return meta;
}
static string GetLicenseUrl(ListTreeNode<JsonValue> vrm0)
static string GetLicenseUrl(JsonNode vrm0)
{
string l0 = default;
string l1 = default;
@ -302,7 +302,7 @@ namespace UniVRM10
return "";
}
static float[] ReverseZ(ListTreeNode<JsonValue> xyz)
static float[] ReverseZ(JsonNode xyz)
{
return new float[]{
xyz["x"].GetSingle(),
@ -324,7 +324,7 @@ namespace UniVRM10
}
}
static UniGLTF.Extensions.VRMC_springBone.VRMC_springBone MigrateSpringBone(UniGLTF.glTF gltf, ListTreeNode<JsonValue> sa)
static UniGLTF.Extensions.VRMC_springBone.VRMC_springBone MigrateSpringBone(UniGLTF.glTF gltf, JsonNode sa)
{
var colliderNodes = new List<int>();
@ -452,7 +452,7 @@ namespace UniVRM10
return springBone;
}
static UniGLTF.Extensions.VRMC_vrm.ExpressionPreset ToPreset(ListTreeNode<JsonValue> json)
static UniGLTF.Extensions.VRMC_vrm.ExpressionPreset ToPreset(JsonNode json)
{
switch (json.GetString().ToLower())
{
@ -486,7 +486,7 @@ namespace UniVRM10
throw new NotImplementedException();
}
static IEnumerable<UniGLTF.Extensions.VRMC_vrm.MorphTargetBind> ToMorphTargetBinds(UniGLTF.glTF gltf, ListTreeNode<JsonValue> json)
static IEnumerable<UniGLTF.Extensions.VRMC_vrm.MorphTargetBind> ToMorphTargetBinds(UniGLTF.glTF gltf, JsonNode json)
{
foreach (var x in json.ArrayItems())
{
@ -548,7 +548,7 @@ namespace UniVRM10
/// <param name="gltf"></param>
/// <param name="json"></param>
/// <param name="expression"></param>
static void ToMaterialColorBinds(UniGLTF.glTF gltf, ListTreeNode<JsonValue> json, UniGLTF.Extensions.VRMC_vrm.Expression expression)
static void ToMaterialColorBinds(UniGLTF.glTF gltf, JsonNode json, UniGLTF.Extensions.VRMC_vrm.Expression expression)
{
foreach (var x in json.ArrayItems())
{
@ -596,7 +596,7 @@ namespace UniVRM10
}
}
static IEnumerable<UniGLTF.Extensions.VRMC_vrm.Expression> MigrateExpression(UniGLTF.glTF gltf, ListTreeNode<JsonValue> json)
static IEnumerable<UniGLTF.Extensions.VRMC_vrm.Expression> MigrateExpression(UniGLTF.glTF gltf, JsonNode json)
{
foreach (var blendShapeClip in json["blendShapeGroups"].ArrayItems())
{
@ -670,7 +670,7 @@ namespace UniVRM10
}
}
public static void CheckBone(string bone, ListTreeNode<JsonValue> vrm0, UniGLTF.Extensions.VRMC_vrm.HumanBone vrm1)
public static void CheckBone(string bone, JsonNode vrm0, UniGLTF.Extensions.VRMC_vrm.HumanBone vrm1)
{
var vrm0NodeIndex = vrm0["node"].GetInt32();
if (vrm0NodeIndex != vrm1.Node)
@ -679,7 +679,7 @@ namespace UniVRM10
}
}
public static void CheckHumanoid(ListTreeNode<JsonValue> vrm0, UniGLTF.Extensions.VRMC_vrm.Humanoid vrm1)
public static void CheckHumanoid(JsonNode vrm0, UniGLTF.Extensions.VRMC_vrm.Humanoid vrm1)
{
foreach (var humanoidBone in vrm0["humanBones"].ArrayItems())
{
@ -763,7 +763,7 @@ namespace UniVRM10
throw new MigrationException(key, $"{x}");
}
public static void CheckMeta(ListTreeNode<JsonValue> vrm0, UniGLTF.Extensions.VRMC_vrm.Meta vrm1)
public static void CheckMeta(JsonNode vrm0, UniGLTF.Extensions.VRMC_vrm.Meta vrm1)
{
if (vrm0["title"].GetString() != vrm1.Name) throw new MigrationException("meta.title", vrm1.Name);
if (vrm0["version"].GetString() != vrm1.Version) throw new MigrationException("meta.version", vrm1.Version);
@ -808,13 +808,13 @@ namespace UniVRM10
}
}
public static void Check(ListTreeNode<JsonValue> vrm0, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm1)
public static void Check(JsonNode vrm0, UniGLTF.Extensions.VRMC_vrm.VRMC_vrm vrm1)
{
Migration.CheckMeta(vrm0["meta"], vrm1.Meta);
Migration.CheckHumanoid(vrm0["humanoid"], vrm1.Humanoid);
}
public static void Check(ListTreeNode<JsonValue> vrm0, UniGLTF.Extensions.VRMC_springBone.VRMC_springBone vrm1, List<UniGLTF.glTFNode> nodes)
public static void Check(JsonNode vrm0, UniGLTF.Extensions.VRMC_springBone.VRMC_springBone vrm1, List<UniGLTF.glTFNode> nodes)
{
// Migration.CheckSpringBone(vrm0["secondaryAnimation"], vrm1.sp)
}

View File

@ -17,14 +17,14 @@ namespace UniVRM10
}
}
static ListTreeNode<JsonValue> GetVRM0(byte[] bytes)
static JsonNode GetVRM0(byte[] bytes)
{
var glb = UniGLTF.Glb.Parse(bytes);
var json = glb.Json.Bytes.ParseAsJson();
return json["extensions"]["VRM"];
}
T GetExtension<T>(UniGLTF.glTFExtension extensions, UniJSON.Utf8String key, Func<ListTreeNode<JsonValue>, T> deserializer)
T GetExtension<T>(UniGLTF.glTFExtension extensions, UniJSON.Utf8String key, Func<JsonNode, T> deserializer)
{
if (extensions is UniGLTF.glTFExtensionImport import)
{