From 161381b235ca0a173d9d614104044171c9a2febd Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 12:47:06 +0900 Subject: [PATCH 1/8] update JsonSchema. VRMC_node_collider is removed. --- Assets/VRM10/Editor/GeneratorMenu.cs | 3 --- vrm-specification | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Assets/VRM10/Editor/GeneratorMenu.cs b/Assets/VRM10/Editor/GeneratorMenu.cs index fa7fd2993..ba76317d3 100644 --- a/Assets/VRM10/Editor/GeneratorMenu.cs +++ b/Assets/VRM10/Editor/GeneratorMenu.cs @@ -48,9 +48,6 @@ namespace UniVRM10 // VRMC_materials_mtoon "vrm-specification/specification/VRMC_materials_mtoon-1.0_draft/schema/VRMC_materials_mtoon.schema.json", "Assets/VRM10/Runtime/Format/MaterialsMToon", // dst - // VRMC_node_collider - "vrm-specification/specification/VRMC_node_collider_1.0_draft/schema/VRMC_node_collider.json", - "Assets/VRM10/Runtime/Format/NodeCollider", // dst // VRMC_springBone "vrm-specification/specification/VRMC_springBone-1.0_draft/schema/VRMC_springBone.schema.json", "Assets/VRM10/Runtime/Format/SpringBone", // dst diff --git a/vrm-specification b/vrm-specification index a69067518..9a02cc230 160000 --- a/vrm-specification +++ b/vrm-specification @@ -1 +1 @@ -Subproject commit a690675180a91ec2bb2b5bceaf6cb1777d43421f +Subproject commit 9a02cc2302c4c656e404fc1d505e9d9c4895d04d From d85cc70a64a9b797c90dfd1fcd8ba9f95541b350 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 12:47:14 +0900 Subject: [PATCH 2/8] indent --- Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs b/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs index 447553bee..cc2ce07b5 100644 --- a/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs +++ b/Assets/UniGLTF/Editor/JsonSchema/JsonSchemaSource.cs @@ -265,7 +265,7 @@ namespace UniGLTF.JsonSchema public void Dump(StringBuilder sb, string indent = "") { - sb.AppendLine($"{indent}{JsonPath}: {type}"); + sb.AppendLine($"{JsonPath}: {type}"); foreach (var x in Children()) { From 502628b768dcc9ec1ee252cfccf4e85e0455375e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 13:02:20 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=83=8D=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=BC=E3=81=AE=E5=90=8D=E5=89=8D=E7=AB=B6?= =?UTF-8?q?=E5=90=88=E3=81=AE=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/JsonSchema/Schemas/ObjectJsonSchema.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Assets/UniGLTF/Editor/JsonSchema/Schemas/ObjectJsonSchema.cs b/Assets/UniGLTF/Editor/JsonSchema/Schemas/ObjectJsonSchema.cs index 50ea95918..ff9694a32 100644 --- a/Assets/UniGLTF/Editor/JsonSchema/Schemas/ObjectJsonSchema.cs +++ b/Assets/UniGLTF/Editor/JsonSchema/Schemas/ObjectJsonSchema.cs @@ -71,6 +71,8 @@ public static $0 $2(JsonNode parsed) .Replace("$2", callName) ); + var prefix = string.IsNullOrEmpty(ClassName) ? "Deserialize_" : $"{ClassName}_Deserialize_"; + foreach (var kv in Properties) { writer.Write(@" @@ -80,7 +82,7 @@ public static $0 $2(JsonNode parsed) } " .Replace("$0", kv.Key) -.Replace("$1", kv.Value.GenerateDeserializerCall($"Deserialize_{kv.Key.ToUpperCamel()}", "kv.Value")) +.Replace("$1", kv.Value.GenerateDeserializerCall($"{prefix}{kv.Key.ToUpperCamel()}", "kv.Value")) .Replace("$2", kv.Key.ToUpperCamel()) ); } @@ -95,7 +97,7 @@ public static $0 $2(JsonNode parsed) { if (!kv.Value.IsInline) { - kv.Value.GenerateDeserializer(writer, $"Deserialize_{kv.Key.ToUpperCamel()}"); + kv.Value.GenerateDeserializer(writer, $"{prefix}{kv.Key.ToUpperCamel()}"); } } } @@ -131,6 +133,9 @@ public static void {callName}(JsonFormatter f, {ValueType} value) " ); + + var prefix = string.IsNullOrEmpty(ClassName) ? "Serialize_" : $"{ClassName}_Serialize_"; + foreach (var kv in Properties) { var valueName = $"value.{kv.Key.ToUpperCamel()}"; @@ -138,7 +143,7 @@ public static void {callName}(JsonFormatter f, {ValueType} value) writer.Write($@" if({kv.Value.CreateSerializationCondition(valueName)}{condition}){{ f.Key(""{kv.Key}""); - {kv.Value.GenerateSerializerCall($"Serialize_{kv.Key.ToUpperCamel()}", valueName)}; + {kv.Value.GenerateSerializerCall($"{prefix}{kv.Key.ToUpperCamel()}", valueName)}; }} "); } @@ -152,7 +157,7 @@ public static void {callName}(JsonFormatter f, {ValueType} value) { if (!kv.Value.IsInline) { - kv.Value.GenerateSerializer(writer, $"Serialize_{kv.Key.ToUpperCamel()}"); + kv.Value.GenerateSerializer(writer, $"{prefix}{kv.Key.ToUpperCamel()}"); } } } From 693eb982fad750d94ea7ab3ad3b724b462f40825 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 13:02:58 +0900 Subject: [PATCH 4/8] generate cs from JsonSchema --- .../Format/Constraints/Deserializer.g.cs | 50 ++- .../Format/Constraints/Serializer.g.cs | 52 ++- .../Format/SpringBone/Deserializer.g.cs | 216 +++++++++++- .../Runtime/Format/SpringBone/Format.g.cs | 66 +++- .../Runtime/Format/SpringBone/Serializer.g.cs | 205 ++++++++++- .../Runtime/Format/Vrm/Deserializer.g.cs | 312 ++++++++--------- Assets/VRM10/Runtime/Format/Vrm/Format.g.cs | 14 +- .../VRM10/Runtime/Format/Vrm/Serializer.g.cs | 320 +++++++++--------- Assets/VRM10/Runtime/IO/Vrm10Exporter.cs | 14 +- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 14 +- .../MigrationVrmFirstPersonAndLookAt.cs | 12 +- .../Migration/MigrationVrmSpringBone.cs | 2 +- Assets/VRM10/Tests/MigrationTests.cs | 2 +- 13 files changed, 885 insertions(+), 394 deletions(-) diff --git a/Assets/VRM10/Runtime/Format/Constraints/Deserializer.g.cs b/Assets/VRM10/Runtime/Format/Constraints/Deserializer.g.cs index 39c374210..ce4d738a7 100644 --- a/Assets/VRM10/Runtime/Format/Constraints/Deserializer.g.cs +++ b/Assets/VRM10/Runtime/Format/Constraints/Deserializer.g.cs @@ -74,17 +74,17 @@ public static Constraint Deserialize_Constraint(JsonNode parsed) } if(key=="position"){ - value.Position = Deserialize_Position(kv.Value); + value.Position = __constraint_Deserialize_Position(kv.Value); continue; } if(key=="rotation"){ - value.Rotation = Deserialize_Rotation(kv.Value); + value.Rotation = __constraint_Deserialize_Rotation(kv.Value); continue; } if(key=="aim"){ - value.Aim = Deserialize_Aim(kv.Value); + value.Aim = __constraint_Deserialize_Aim(kv.Value); continue; } @@ -92,7 +92,7 @@ public static Constraint Deserialize_Constraint(JsonNode parsed) return value; } -public static PositionConstraint Deserialize_Position(JsonNode parsed) +public static PositionConstraint __constraint_Deserialize_Position(JsonNode parsed) { var value = new PositionConstraint(); @@ -131,7 +131,7 @@ public static PositionConstraint Deserialize_Position(JsonNode parsed) } if(key=="freezeAxes"){ - value.FreezeAxes = Deserialize_FreezeAxes(kv.Value); + value.FreezeAxes = __constraint__position_Deserialize_FreezeAxes(kv.Value); continue; } @@ -144,7 +144,7 @@ public static PositionConstraint Deserialize_Position(JsonNode parsed) return value; } -public static bool[] Deserialize_FreezeAxes(JsonNode parsed) +public static bool[] __constraint__position_Deserialize_FreezeAxes(JsonNode parsed) { var value = new bool[parsed.GetArrayCount()]; int i=0; @@ -155,7 +155,7 @@ public static bool[] Deserialize_FreezeAxes(JsonNode parsed) return value; } -public static RotationConstraint Deserialize_Rotation(JsonNode parsed) +public static RotationConstraint __constraint_Deserialize_Rotation(JsonNode parsed) { var value = new RotationConstraint(); @@ -194,7 +194,7 @@ public static RotationConstraint Deserialize_Rotation(JsonNode parsed) } if(key=="freezeAxes"){ - value.FreezeAxes = Deserialize_FreezeAxes(kv.Value); + value.FreezeAxes = __constraint__rotation_Deserialize_FreezeAxes(kv.Value); continue; } @@ -207,7 +207,18 @@ public static RotationConstraint Deserialize_Rotation(JsonNode parsed) return value; } -public static AimConstraint Deserialize_Aim(JsonNode parsed) +public static bool[] __constraint__rotation_Deserialize_FreezeAxes(JsonNode parsed) +{ + var value = new bool[parsed.GetArrayCount()]; + int i=0; + foreach(var x in parsed.ArrayItems()) + { + value[i++] = x.GetBoolean(); + } + return value; +} + +public static AimConstraint __constraint_Deserialize_Aim(JsonNode parsed) { var value = new AimConstraint(); @@ -246,17 +257,17 @@ public static AimConstraint Deserialize_Aim(JsonNode parsed) } if(key=="aimVector"){ - value.AimVector = Deserialize_AimVector(kv.Value); + value.AimVector = __constraint__aim_Deserialize_AimVector(kv.Value); continue; } if(key=="upVector"){ - value.UpVector = Deserialize_UpVector(kv.Value); + value.UpVector = __constraint__aim_Deserialize_UpVector(kv.Value); continue; } if(key=="freezeAxes"){ - value.FreezeAxes = Deserialize_FreezeAxes(kv.Value); + value.FreezeAxes = __constraint__aim_Deserialize_FreezeAxes(kv.Value); continue; } @@ -269,7 +280,7 @@ public static AimConstraint Deserialize_Aim(JsonNode parsed) return value; } -public static float[] Deserialize_AimVector(JsonNode parsed) +public static float[] __constraint__aim_Deserialize_AimVector(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -280,7 +291,7 @@ public static float[] Deserialize_AimVector(JsonNode parsed) return value; } -public static float[] Deserialize_UpVector(JsonNode parsed) +public static float[] __constraint__aim_Deserialize_UpVector(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -291,5 +302,16 @@ public static float[] Deserialize_UpVector(JsonNode parsed) return value; } +public static bool[] __constraint__aim_Deserialize_FreezeAxes(JsonNode parsed) +{ + var value = new bool[parsed.GetArrayCount()]; + int i=0; + foreach(var x in parsed.ArrayItems()) + { + value[i++] = x.GetBoolean(); + } + return value; +} + } // GltfDeserializer } // UniGLTF diff --git a/Assets/VRM10/Runtime/Format/Constraints/Serializer.g.cs b/Assets/VRM10/Runtime/Format/Constraints/Serializer.g.cs index baf92073f..35356e461 100644 --- a/Assets/VRM10/Runtime/Format/Constraints/Serializer.g.cs +++ b/Assets/VRM10/Runtime/Format/Constraints/Serializer.g.cs @@ -68,23 +68,23 @@ public static void Serialize_Constraint(JsonFormatter f, Constraint value) if(value.Position!=null){ f.Key("position"); - Serialize_Position(f, value.Position); + __constraint_Serialize_Position(f, value.Position); } if(value.Rotation!=null){ f.Key("rotation"); - Serialize_Rotation(f, value.Rotation); + __constraint_Serialize_Rotation(f, value.Rotation); } if(value.Aim!=null){ f.Key("aim"); - Serialize_Aim(f, value.Aim); + __constraint_Serialize_Aim(f, value.Aim); } f.EndMap(); } -public static void Serialize_Position(JsonFormatter f, PositionConstraint value) +public static void __constraint_Serialize_Position(JsonFormatter f, PositionConstraint value) { f.BeginMap(); @@ -121,7 +121,7 @@ public static void Serialize_Position(JsonFormatter f, PositionConstraint value) if(value.FreezeAxes!=null&&value.FreezeAxes.Count()>=3){ f.Key("freezeAxes"); - Serialize_FreezeAxes(f, value.FreezeAxes); + __constraint__position_Serialize_FreezeAxes(f, value.FreezeAxes); } if(value.Weight.HasValue){ @@ -132,7 +132,7 @@ public static void Serialize_Position(JsonFormatter f, PositionConstraint value) f.EndMap(); } -public static void Serialize_FreezeAxes(JsonFormatter f, bool[] value) +public static void __constraint__position_Serialize_FreezeAxes(JsonFormatter f, bool[] value) { f.BeginList(); @@ -144,7 +144,7 @@ public static void Serialize_FreezeAxes(JsonFormatter f, bool[] value) f.EndList(); } -public static void Serialize_Rotation(JsonFormatter f, RotationConstraint value) +public static void __constraint_Serialize_Rotation(JsonFormatter f, RotationConstraint value) { f.BeginMap(); @@ -181,7 +181,7 @@ public static void Serialize_Rotation(JsonFormatter f, RotationConstraint value) if(value.FreezeAxes!=null&&value.FreezeAxes.Count()>=3){ f.Key("freezeAxes"); - Serialize_FreezeAxes(f, value.FreezeAxes); + __constraint__rotation_Serialize_FreezeAxes(f, value.FreezeAxes); } if(value.Weight.HasValue){ @@ -192,7 +192,19 @@ public static void Serialize_Rotation(JsonFormatter f, RotationConstraint value) f.EndMap(); } -public static void Serialize_Aim(JsonFormatter f, AimConstraint value) +public static void __constraint__rotation_Serialize_FreezeAxes(JsonFormatter f, bool[] value) +{ + f.BeginList(); + + foreach(var item in value) + { + f.Value(item); + + } + f.EndList(); +} + +public static void __constraint_Serialize_Aim(JsonFormatter f, AimConstraint value) { f.BeginMap(); @@ -229,17 +241,17 @@ public static void Serialize_Aim(JsonFormatter f, AimConstraint value) if(value.AimVector!=null&&value.AimVector.Count()>=3){ f.Key("aimVector"); - Serialize_AimVector(f, value.AimVector); + __constraint__aim_Serialize_AimVector(f, value.AimVector); } if(value.UpVector!=null&&value.UpVector.Count()>=3){ f.Key("upVector"); - Serialize_UpVector(f, value.UpVector); + __constraint__aim_Serialize_UpVector(f, value.UpVector); } if(value.FreezeAxes!=null&&value.FreezeAxes.Count()>=2){ f.Key("freezeAxes"); - Serialize_FreezeAxes(f, value.FreezeAxes); + __constraint__aim_Serialize_FreezeAxes(f, value.FreezeAxes); } if(value.Weight.HasValue){ @@ -250,7 +262,7 @@ public static void Serialize_Aim(JsonFormatter f, AimConstraint value) f.EndMap(); } -public static void Serialize_AimVector(JsonFormatter f, float[] value) +public static void __constraint__aim_Serialize_AimVector(JsonFormatter f, float[] value) { f.BeginList(); @@ -262,7 +274,19 @@ public static void Serialize_AimVector(JsonFormatter f, float[] value) f.EndList(); } -public static void Serialize_UpVector(JsonFormatter f, float[] value) +public static void __constraint__aim_Serialize_UpVector(JsonFormatter f, float[] value) +{ + f.BeginList(); + + foreach(var item in value) + { + f.Value(item); + + } + f.EndList(); +} + +public static void __constraint__aim_Serialize_FreezeAxes(JsonFormatter f, bool[] value) { f.BeginList(); diff --git a/Assets/VRM10/Runtime/Format/SpringBone/Deserializer.g.cs b/Assets/VRM10/Runtime/Format/SpringBone/Deserializer.g.cs index 3ebef6e81..1d6b3a46c 100644 --- a/Assets/VRM10/Runtime/Format/SpringBone/Deserializer.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBone/Deserializer.g.cs @@ -46,6 +46,11 @@ public static VRMC_springBone Deserialize(JsonNode parsed) continue; } + if(key=="colliderGroups"){ + value.ColliderGroups = Deserialize_ColliderGroups(kv.Value); + continue; + } + if(key=="springs"){ value.Springs = Deserialize_Springs(kv.Value); continue; @@ -55,6 +60,199 @@ public static VRMC_springBone Deserialize(JsonNode parsed) return value; } +public static List Deserialize_ColliderGroups(JsonNode parsed) +{ + var value = new List(); + foreach(var x in parsed.ArrayItems()) + { + value.Add(Deserialize_ColliderGroups_ITEM(x)); + } + return value; +} + +public static ColliderGroup Deserialize_ColliderGroups_ITEM(JsonNode parsed) +{ + var value = new ColliderGroup(); + + foreach(var kv in parsed.ObjectItems()) + { + var key = kv.Key.GetString(); + + if(key=="extensions"){ + value.Extensions = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="extras"){ + value.Extras = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="colliders"){ + value.Colliders = __colliderGroups_ITEM_Deserialize_Colliders(kv.Value); + continue; + } + + } + return value; +} + +public static List __colliderGroups_ITEM_Deserialize_Colliders(JsonNode parsed) +{ + var value = new List(); + foreach(var x in parsed.ArrayItems()) + { + value.Add(__colliderGroups_ITEM_Deserialize_Colliders_ITEM(x)); + } + return value; +} + +public static Collider __colliderGroups_ITEM_Deserialize_Colliders_ITEM(JsonNode parsed) +{ + var value = new Collider(); + + foreach(var kv in parsed.ObjectItems()) + { + var key = kv.Key.GetString(); + + if(key=="extensions"){ + value.Extensions = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="extras"){ + value.Extras = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="node"){ + value.Node = kv.Value.GetInt32(); + continue; + } + + if(key=="shape"){ + value.Shape = __colliderGroups_ITEM__colliders_ITEM_Deserialize_Shape(kv.Value); + continue; + } + + } + return value; +} + +public static ColliderShape __colliderGroups_ITEM__colliders_ITEM_Deserialize_Shape(JsonNode parsed) +{ + var value = new ColliderShape(); + + foreach(var kv in parsed.ObjectItems()) + { + var key = kv.Key.GetString(); + + if(key=="extensions"){ + value.Extensions = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="extras"){ + value.Extras = new glTFExtensionImport(kv.Value); + continue; + } + + if(key=="sphere"){ + value.Sphere = __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Sphere(kv.Value); + continue; + } + + if(key=="capsule"){ + value.Capsule = __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Capsule(kv.Value); + continue; + } + + } + return value; +} + +public static ColliderShapeSphere __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Sphere(JsonNode parsed) +{ + var value = new ColliderShapeSphere(); + + foreach(var kv in parsed.ObjectItems()) + { + var key = kv.Key.GetString(); + + if(key=="offset"){ + value.Offset = __colliderGroups_ITEM__colliders_ITEM__shape__sphere_Deserialize_Offset(kv.Value); + continue; + } + + if(key=="radius"){ + value.Radius = kv.Value.GetSingle(); + continue; + } + + } + return value; +} + +public static float[] __colliderGroups_ITEM__colliders_ITEM__shape__sphere_Deserialize_Offset(JsonNode parsed) +{ + var value = new float[parsed.GetArrayCount()]; + int i=0; + foreach(var x in parsed.ArrayItems()) + { + value[i++] = x.GetSingle(); + } + return value; +} + +public static ColliderShapeCapsule __colliderGroups_ITEM__colliders_ITEM__shape_Deserialize_Capsule(JsonNode parsed) +{ + var value = new ColliderShapeCapsule(); + + foreach(var kv in parsed.ObjectItems()) + { + var key = kv.Key.GetString(); + + if(key=="offset"){ + value.Offset = __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Offset(kv.Value); + continue; + } + + if(key=="radius"){ + value.Radius = kv.Value.GetSingle(); + continue; + } + + if(key=="tail"){ + value.Tail = __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Tail(kv.Value); + continue; + } + + } + return value; +} + +public static float[] __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Offset(JsonNode parsed) +{ + var value = new float[parsed.GetArrayCount()]; + int i=0; + foreach(var x in parsed.ArrayItems()) + { + value[i++] = x.GetSingle(); + } + return value; +} + +public static float[] __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Deserialize_Tail(JsonNode parsed) +{ + var value = new float[parsed.GetArrayCount()]; + int i=0; + foreach(var x in parsed.ArrayItems()) + { + value[i++] = x.GetSingle(); + } + return value; +} + public static List Deserialize_Springs(JsonNode parsed) { var value = new List(); @@ -89,12 +287,12 @@ public static Spring Deserialize_Springs_ITEM(JsonNode parsed) } if(key=="joints"){ - value.Joints = Deserialize_Joints(kv.Value); + value.Joints = __springs_ITEM_Deserialize_Joints(kv.Value); continue; } - if(key=="colliders"){ - value.Colliders = Deserialize_Colliders(kv.Value); + if(key=="colliderGroups"){ + value.ColliderGroups = __springs_ITEM_Deserialize_ColliderGroups(kv.Value); continue; } @@ -102,17 +300,17 @@ public static Spring Deserialize_Springs_ITEM(JsonNode parsed) return value; } -public static List Deserialize_Joints(JsonNode parsed) +public static List __springs_ITEM_Deserialize_Joints(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) { - value.Add(Deserialize_Joints_ITEM(x)); + value.Add(__springs_ITEM_Deserialize_Joints_ITEM(x)); } return value; } -public static SpringBoneJoint Deserialize_Joints_ITEM(JsonNode parsed) +public static SpringBoneJoint __springs_ITEM_Deserialize_Joints_ITEM(JsonNode parsed) { var value = new SpringBoneJoint(); @@ -151,7 +349,7 @@ public static SpringBoneJoint Deserialize_Joints_ITEM(JsonNode parsed) } if(key=="gravityDir"){ - value.GravityDir = Deserialize_GravityDir(kv.Value); + value.GravityDir = __springs_ITEM__joints_ITEM_Deserialize_GravityDir(kv.Value); continue; } @@ -164,7 +362,7 @@ public static SpringBoneJoint Deserialize_Joints_ITEM(JsonNode parsed) return value; } -public static float[] Deserialize_GravityDir(JsonNode parsed) +public static float[] __springs_ITEM__joints_ITEM_Deserialize_GravityDir(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -175,7 +373,7 @@ public static float[] Deserialize_GravityDir(JsonNode parsed) return value; } -public static int[] Deserialize_Colliders(JsonNode parsed) +public static int[] __springs_ITEM_Deserialize_ColliderGroups(JsonNode parsed) { var value = new int[parsed.GetArrayCount()]; int i=0; diff --git a/Assets/VRM10/Runtime/Format/SpringBone/Format.g.cs b/Assets/VRM10/Runtime/Format/SpringBone/Format.g.cs index 17405bf0e..b4124a382 100644 --- a/Assets/VRM10/Runtime/Format/SpringBone/Format.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBone/Format.g.cs @@ -7,6 +7,65 @@ using UniJSON; namespace UniGLTF.Extensions.VRMC_springBone { + public class ColliderShapeSphere + { + // The sphere center. vector3 + public float[] Offset; + + // The sphere radius + public float? Radius; + } + + public class ColliderShapeCapsule + { + // The capsule head. vector3 + public float[] Offset; + + // The capsule radius + public float? Radius; + + // The capsule tail. vector3 + public float[] Tail; + } + + public class ColliderShape + { + // Dictionary object with extension-specific objects. + public glTFExtension Extensions; + + // Application-specific data. + public glTFExtension Extras; + + public ColliderShapeSphere Sphere; + + public ColliderShapeCapsule Capsule; + } + + public class Collider + { + // Dictionary object with extension-specific objects. + public glTFExtension Extensions; + + // Application-specific data. + public glTFExtension Extras; + + // The node index. + public int? Node; + + public ColliderShape Shape; + } + + public class ColliderGroup + { + // Dictionary object with extension-specific objects. + public glTFExtension Extensions; + + // Application-specific data. + public glTFExtension Extras; + + public List Colliders; + } + public class SpringBoneJoint { // Dictionary object with extension-specific objects. @@ -48,8 +107,8 @@ namespace UniGLTF.Extensions.VRMC_springBone // Joints of the spring. Except for the first element, a previous joint of the array must be an ancestor of the joint. public List Joints; - // Colliders that detect collision with this spring. - public int[] Colliders; + // Indices of ColliderGroups that detect collision with this spring. + public int[] ColliderGroups; } public class VRMC_springBone @@ -63,6 +122,9 @@ namespace UniGLTF.Extensions.VRMC_springBone // Application-specific data. public glTFExtension Extras; + // An array of colliderGroups. + public List ColliderGroups; + // An array of springs. public List Springs; } diff --git a/Assets/VRM10/Runtime/Format/SpringBone/Serializer.g.cs b/Assets/VRM10/Runtime/Format/SpringBone/Serializer.g.cs index c7b9fa404..38e423999 100644 --- a/Assets/VRM10/Runtime/Format/SpringBone/Serializer.g.cs +++ b/Assets/VRM10/Runtime/Format/SpringBone/Serializer.g.cs @@ -43,6 +43,11 @@ public static void Serialize(JsonFormatter f, VRMC_springBone value) value.Extras.Serialize(f); } + if(value.ColliderGroups!=null&&value.ColliderGroups.Count()>=0){ + f.Key("colliderGroups"); + Serialize_ColliderGroups(f, value.ColliderGroups); + } + if(value.Springs!=null&&value.Springs.Count()>=0){ f.Key("springs"); Serialize_Springs(f, value.Springs); @@ -51,6 +56,186 @@ public static void Serialize(JsonFormatter f, VRMC_springBone value) f.EndMap(); } +public static void Serialize_ColliderGroups(JsonFormatter f, List value) +{ + f.BeginList(); + + foreach(var item in value) + { + Serialize_ColliderGroups_ITEM(f, item); + + } + f.EndList(); +} + +public static void Serialize_ColliderGroups_ITEM(JsonFormatter f, ColliderGroup value) +{ + f.BeginMap(); + + + if(value.Extensions!=null){ + f.Key("extensions"); + value.Extensions.Serialize(f); + } + + if(value.Extras!=null){ + f.Key("extras"); + value.Extras.Serialize(f); + } + + if(value.Colliders!=null&&value.Colliders.Count()>=0){ + f.Key("colliders"); + __colliderGroups_ITEM_Serialize_Colliders(f, value.Colliders); + } + + f.EndMap(); +} + +public static void __colliderGroups_ITEM_Serialize_Colliders(JsonFormatter f, List value) +{ + f.BeginList(); + + foreach(var item in value) + { + __colliderGroups_ITEM_Serialize_Colliders_ITEM(f, item); + + } + f.EndList(); +} + +public static void __colliderGroups_ITEM_Serialize_Colliders_ITEM(JsonFormatter f, Collider value) +{ + f.BeginMap(); + + + if(value.Extensions!=null){ + f.Key("extensions"); + value.Extensions.Serialize(f); + } + + if(value.Extras!=null){ + f.Key("extras"); + value.Extras.Serialize(f); + } + + if(value.Node.HasValue){ + f.Key("node"); + f.Value(value.Node.GetValueOrDefault()); + } + + if(value.Shape!=null){ + f.Key("shape"); + __colliderGroups_ITEM__colliders_ITEM_Serialize_Shape(f, value.Shape); + } + + f.EndMap(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM_Serialize_Shape(JsonFormatter f, ColliderShape value) +{ + f.BeginMap(); + + + if(value.Extensions!=null){ + f.Key("extensions"); + value.Extensions.Serialize(f); + } + + if(value.Extras!=null){ + f.Key("extras"); + value.Extras.Serialize(f); + } + + if(value.Sphere!=null){ + f.Key("sphere"); + __colliderGroups_ITEM__colliders_ITEM__shape_Serialize_Sphere(f, value.Sphere); + } + + if(value.Capsule!=null){ + f.Key("capsule"); + __colliderGroups_ITEM__colliders_ITEM__shape_Serialize_Capsule(f, value.Capsule); + } + + f.EndMap(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM__shape_Serialize_Sphere(JsonFormatter f, ColliderShapeSphere value) +{ + f.BeginMap(); + + + if(value.Offset!=null&&value.Offset.Count()>=3){ + f.Key("offset"); + __colliderGroups_ITEM__colliders_ITEM__shape__sphere_Serialize_Offset(f, value.Offset); + } + + if(value.Radius.HasValue){ + f.Key("radius"); + f.Value(value.Radius.GetValueOrDefault()); + } + + f.EndMap(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM__shape__sphere_Serialize_Offset(JsonFormatter f, float[] value) +{ + f.BeginList(); + + foreach(var item in value) + { + f.Value(item); + + } + f.EndList(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM__shape_Serialize_Capsule(JsonFormatter f, ColliderShapeCapsule value) +{ + f.BeginMap(); + + + if(value.Offset!=null&&value.Offset.Count()>=3){ + f.Key("offset"); + __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Serialize_Offset(f, value.Offset); + } + + if(value.Radius.HasValue){ + f.Key("radius"); + f.Value(value.Radius.GetValueOrDefault()); + } + + if(value.Tail!=null&&value.Tail.Count()>=3){ + f.Key("tail"); + __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Serialize_Tail(f, value.Tail); + } + + f.EndMap(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Serialize_Offset(JsonFormatter f, float[] value) +{ + f.BeginList(); + + foreach(var item in value) + { + f.Value(item); + + } + f.EndList(); +} + +public static void __colliderGroups_ITEM__colliders_ITEM__shape__capsule_Serialize_Tail(JsonFormatter f, float[] value) +{ + f.BeginList(); + + foreach(var item in value) + { + f.Value(item); + + } + f.EndList(); +} + public static void Serialize_Springs(JsonFormatter f, List value) { f.BeginList(); @@ -85,30 +270,30 @@ public static void Serialize_Springs_ITEM(JsonFormatter f, Spring value) if(value.Joints!=null&&value.Joints.Count()>=0){ f.Key("joints"); - Serialize_Joints(f, value.Joints); + __springs_ITEM_Serialize_Joints(f, value.Joints); } - if(value.Colliders!=null&&value.Colliders.Count()>=0){ - f.Key("colliders"); - Serialize_Colliders(f, value.Colliders); + if(value.ColliderGroups!=null&&value.ColliderGroups.Count()>=0){ + f.Key("colliderGroups"); + __springs_ITEM_Serialize_ColliderGroups(f, value.ColliderGroups); } f.EndMap(); } -public static void Serialize_Joints(JsonFormatter f, List value) +public static void __springs_ITEM_Serialize_Joints(JsonFormatter f, List value) { f.BeginList(); foreach(var item in value) { - Serialize_Joints_ITEM(f, item); + __springs_ITEM_Serialize_Joints_ITEM(f, item); } f.EndList(); } -public static void Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value) +public static void __springs_ITEM_Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value) { f.BeginMap(); @@ -145,7 +330,7 @@ public static void Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value) if(value.GravityDir!=null&&value.GravityDir.Count()>=3){ f.Key("gravityDir"); - Serialize_GravityDir(f, value.GravityDir); + __springs_ITEM__joints_ITEM_Serialize_GravityDir(f, value.GravityDir); } if(value.DragForce.HasValue){ @@ -156,7 +341,7 @@ public static void Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value) f.EndMap(); } -public static void Serialize_GravityDir(JsonFormatter f, float[] value) +public static void __springs_ITEM__joints_ITEM_Serialize_GravityDir(JsonFormatter f, float[] value) { f.BeginList(); @@ -168,7 +353,7 @@ public static void Serialize_GravityDir(JsonFormatter f, float[] value) f.EndList(); } -public static void Serialize_Colliders(JsonFormatter f, int[] value) +public static void __springs_ITEM_Serialize_ColliderGroups(JsonFormatter f, int[] value) { f.BeginList(); diff --git a/Assets/VRM10/Runtime/Format/Vrm/Deserializer.g.cs b/Assets/VRM10/Runtime/Format/Vrm/Deserializer.g.cs index bb54f92d4..fef0de1f1 100644 --- a/Assets/VRM10/Runtime/Format/Vrm/Deserializer.g.cs +++ b/Assets/VRM10/Runtime/Format/Vrm/Deserializer.g.cs @@ -89,7 +89,7 @@ public static Meta Deserialize_Meta(JsonNode parsed) } if(key=="authors"){ - value.Authors = Deserialize_Authors(kv.Value); + value.Authors = __meta_Deserialize_Authors(kv.Value); continue; } @@ -104,7 +104,7 @@ public static Meta Deserialize_Meta(JsonNode parsed) } if(key=="references"){ - value.References = Deserialize_References(kv.Value); + value.References = __meta_Deserialize_References(kv.Value); continue; } @@ -167,7 +167,7 @@ public static Meta Deserialize_Meta(JsonNode parsed) return value; } -public static List Deserialize_Authors(JsonNode parsed) +public static List __meta_Deserialize_Authors(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) @@ -177,7 +177,7 @@ public static List Deserialize_Authors(JsonNode parsed) return value; } -public static List Deserialize_References(JsonNode parsed) +public static List __meta_Deserialize_References(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) @@ -196,7 +196,7 @@ public static Humanoid Deserialize_Humanoid(JsonNode parsed) var key = kv.Key.GetString(); if(key=="humanBones"){ - value.HumanBones = Deserialize_HumanBones(kv.Value); + value.HumanBones = __humanoid_Deserialize_HumanBones(kv.Value); continue; } @@ -204,7 +204,7 @@ public static Humanoid Deserialize_Humanoid(JsonNode parsed) return value; } -public static HumanBones Deserialize_HumanBones(JsonNode parsed) +public static HumanBones __humanoid_Deserialize_HumanBones(JsonNode parsed) { var value = new HumanBones(); @@ -213,277 +213,277 @@ public static HumanBones Deserialize_HumanBones(JsonNode parsed) var key = kv.Key.GetString(); if(key=="hips"){ - value.Hips = Deserialize_Hips(kv.Value); + value.Hips = __humanoid__humanBones_Deserialize_Hips(kv.Value); continue; } if(key=="spine"){ - value.Spine = Deserialize_Spine(kv.Value); + value.Spine = __humanoid__humanBones_Deserialize_Spine(kv.Value); continue; } if(key=="chest"){ - value.Chest = Deserialize_Chest(kv.Value); + value.Chest = __humanoid__humanBones_Deserialize_Chest(kv.Value); continue; } if(key=="upperChest"){ - value.UpperChest = Deserialize_UpperChest(kv.Value); + value.UpperChest = __humanoid__humanBones_Deserialize_UpperChest(kv.Value); continue; } if(key=="neck"){ - value.Neck = Deserialize_Neck(kv.Value); + value.Neck = __humanoid__humanBones_Deserialize_Neck(kv.Value); continue; } if(key=="head"){ - value.Head = Deserialize_Head(kv.Value); + value.Head = __humanoid__humanBones_Deserialize_Head(kv.Value); continue; } if(key=="leftEye"){ - value.LeftEye = Deserialize_LeftEye(kv.Value); + value.LeftEye = __humanoid__humanBones_Deserialize_LeftEye(kv.Value); continue; } if(key=="rightEye"){ - value.RightEye = Deserialize_RightEye(kv.Value); + value.RightEye = __humanoid__humanBones_Deserialize_RightEye(kv.Value); continue; } if(key=="jaw"){ - value.Jaw = Deserialize_Jaw(kv.Value); + value.Jaw = __humanoid__humanBones_Deserialize_Jaw(kv.Value); continue; } if(key=="leftUpperLeg"){ - value.LeftUpperLeg = Deserialize_LeftUpperLeg(kv.Value); + value.LeftUpperLeg = __humanoid__humanBones_Deserialize_LeftUpperLeg(kv.Value); continue; } if(key=="leftLowerLeg"){ - value.LeftLowerLeg = Deserialize_LeftLowerLeg(kv.Value); + value.LeftLowerLeg = __humanoid__humanBones_Deserialize_LeftLowerLeg(kv.Value); continue; } if(key=="leftFoot"){ - value.LeftFoot = Deserialize_LeftFoot(kv.Value); + value.LeftFoot = __humanoid__humanBones_Deserialize_LeftFoot(kv.Value); continue; } if(key=="leftToes"){ - value.LeftToes = Deserialize_LeftToes(kv.Value); + value.LeftToes = __humanoid__humanBones_Deserialize_LeftToes(kv.Value); continue; } if(key=="rightUpperLeg"){ - value.RightUpperLeg = Deserialize_RightUpperLeg(kv.Value); + value.RightUpperLeg = __humanoid__humanBones_Deserialize_RightUpperLeg(kv.Value); continue; } if(key=="rightLowerLeg"){ - value.RightLowerLeg = Deserialize_RightLowerLeg(kv.Value); + value.RightLowerLeg = __humanoid__humanBones_Deserialize_RightLowerLeg(kv.Value); continue; } if(key=="rightFoot"){ - value.RightFoot = Deserialize_RightFoot(kv.Value); + value.RightFoot = __humanoid__humanBones_Deserialize_RightFoot(kv.Value); continue; } if(key=="rightToes"){ - value.RightToes = Deserialize_RightToes(kv.Value); + value.RightToes = __humanoid__humanBones_Deserialize_RightToes(kv.Value); continue; } if(key=="leftShoulder"){ - value.LeftShoulder = Deserialize_LeftShoulder(kv.Value); + value.LeftShoulder = __humanoid__humanBones_Deserialize_LeftShoulder(kv.Value); continue; } if(key=="leftUpperArm"){ - value.LeftUpperArm = Deserialize_LeftUpperArm(kv.Value); + value.LeftUpperArm = __humanoid__humanBones_Deserialize_LeftUpperArm(kv.Value); continue; } if(key=="leftLowerArm"){ - value.LeftLowerArm = Deserialize_LeftLowerArm(kv.Value); + value.LeftLowerArm = __humanoid__humanBones_Deserialize_LeftLowerArm(kv.Value); continue; } if(key=="leftHand"){ - value.LeftHand = Deserialize_LeftHand(kv.Value); + value.LeftHand = __humanoid__humanBones_Deserialize_LeftHand(kv.Value); continue; } if(key=="rightShoulder"){ - value.RightShoulder = Deserialize_RightShoulder(kv.Value); + value.RightShoulder = __humanoid__humanBones_Deserialize_RightShoulder(kv.Value); continue; } if(key=="rightUpperArm"){ - value.RightUpperArm = Deserialize_RightUpperArm(kv.Value); + value.RightUpperArm = __humanoid__humanBones_Deserialize_RightUpperArm(kv.Value); continue; } if(key=="rightLowerArm"){ - value.RightLowerArm = Deserialize_RightLowerArm(kv.Value); + value.RightLowerArm = __humanoid__humanBones_Deserialize_RightLowerArm(kv.Value); continue; } if(key=="rightHand"){ - value.RightHand = Deserialize_RightHand(kv.Value); + value.RightHand = __humanoid__humanBones_Deserialize_RightHand(kv.Value); continue; } if(key=="leftThumbProximal"){ - value.LeftThumbProximal = Deserialize_LeftThumbProximal(kv.Value); + value.LeftThumbProximal = __humanoid__humanBones_Deserialize_LeftThumbProximal(kv.Value); continue; } if(key=="leftThumbIntermediate"){ - value.LeftThumbIntermediate = Deserialize_LeftThumbIntermediate(kv.Value); + value.LeftThumbIntermediate = __humanoid__humanBones_Deserialize_LeftThumbIntermediate(kv.Value); continue; } if(key=="leftThumbDistal"){ - value.LeftThumbDistal = Deserialize_LeftThumbDistal(kv.Value); + value.LeftThumbDistal = __humanoid__humanBones_Deserialize_LeftThumbDistal(kv.Value); continue; } if(key=="leftIndexProximal"){ - value.LeftIndexProximal = Deserialize_LeftIndexProximal(kv.Value); + value.LeftIndexProximal = __humanoid__humanBones_Deserialize_LeftIndexProximal(kv.Value); continue; } if(key=="leftIndexIntermediate"){ - value.LeftIndexIntermediate = Deserialize_LeftIndexIntermediate(kv.Value); + value.LeftIndexIntermediate = __humanoid__humanBones_Deserialize_LeftIndexIntermediate(kv.Value); continue; } if(key=="leftIndexDistal"){ - value.LeftIndexDistal = Deserialize_LeftIndexDistal(kv.Value); + value.LeftIndexDistal = __humanoid__humanBones_Deserialize_LeftIndexDistal(kv.Value); continue; } if(key=="leftMiddleProximal"){ - value.LeftMiddleProximal = Deserialize_LeftMiddleProximal(kv.Value); + value.LeftMiddleProximal = __humanoid__humanBones_Deserialize_LeftMiddleProximal(kv.Value); continue; } if(key=="leftMiddleIntermediate"){ - value.LeftMiddleIntermediate = Deserialize_LeftMiddleIntermediate(kv.Value); + value.LeftMiddleIntermediate = __humanoid__humanBones_Deserialize_LeftMiddleIntermediate(kv.Value); continue; } if(key=="leftMiddleDistal"){ - value.LeftMiddleDistal = Deserialize_LeftMiddleDistal(kv.Value); + value.LeftMiddleDistal = __humanoid__humanBones_Deserialize_LeftMiddleDistal(kv.Value); continue; } if(key=="leftRingProximal"){ - value.LeftRingProximal = Deserialize_LeftRingProximal(kv.Value); + value.LeftRingProximal = __humanoid__humanBones_Deserialize_LeftRingProximal(kv.Value); continue; } if(key=="leftRingIntermediate"){ - value.LeftRingIntermediate = Deserialize_LeftRingIntermediate(kv.Value); + value.LeftRingIntermediate = __humanoid__humanBones_Deserialize_LeftRingIntermediate(kv.Value); continue; } if(key=="leftRingDistal"){ - value.LeftRingDistal = Deserialize_LeftRingDistal(kv.Value); + value.LeftRingDistal = __humanoid__humanBones_Deserialize_LeftRingDistal(kv.Value); continue; } if(key=="leftLittleProximal"){ - value.LeftLittleProximal = Deserialize_LeftLittleProximal(kv.Value); + value.LeftLittleProximal = __humanoid__humanBones_Deserialize_LeftLittleProximal(kv.Value); continue; } if(key=="leftLittleIntermediate"){ - value.LeftLittleIntermediate = Deserialize_LeftLittleIntermediate(kv.Value); + value.LeftLittleIntermediate = __humanoid__humanBones_Deserialize_LeftLittleIntermediate(kv.Value); continue; } if(key=="leftLittleDistal"){ - value.LeftLittleDistal = Deserialize_LeftLittleDistal(kv.Value); + value.LeftLittleDistal = __humanoid__humanBones_Deserialize_LeftLittleDistal(kv.Value); continue; } if(key=="rightThumbProximal"){ - value.RightThumbProximal = Deserialize_RightThumbProximal(kv.Value); + value.RightThumbProximal = __humanoid__humanBones_Deserialize_RightThumbProximal(kv.Value); continue; } if(key=="rightThumbIntermediate"){ - value.RightThumbIntermediate = Deserialize_RightThumbIntermediate(kv.Value); + value.RightThumbIntermediate = __humanoid__humanBones_Deserialize_RightThumbIntermediate(kv.Value); continue; } if(key=="rightThumbDistal"){ - value.RightThumbDistal = Deserialize_RightThumbDistal(kv.Value); + value.RightThumbDistal = __humanoid__humanBones_Deserialize_RightThumbDistal(kv.Value); continue; } if(key=="rightIndexProximal"){ - value.RightIndexProximal = Deserialize_RightIndexProximal(kv.Value); + value.RightIndexProximal = __humanoid__humanBones_Deserialize_RightIndexProximal(kv.Value); continue; } if(key=="rightIndexIntermediate"){ - value.RightIndexIntermediate = Deserialize_RightIndexIntermediate(kv.Value); + value.RightIndexIntermediate = __humanoid__humanBones_Deserialize_RightIndexIntermediate(kv.Value); continue; } if(key=="rightIndexDistal"){ - value.RightIndexDistal = Deserialize_RightIndexDistal(kv.Value); + value.RightIndexDistal = __humanoid__humanBones_Deserialize_RightIndexDistal(kv.Value); continue; } if(key=="rightMiddleProximal"){ - value.RightMiddleProximal = Deserialize_RightMiddleProximal(kv.Value); + value.RightMiddleProximal = __humanoid__humanBones_Deserialize_RightMiddleProximal(kv.Value); continue; } if(key=="rightMiddleIntermediate"){ - value.RightMiddleIntermediate = Deserialize_RightMiddleIntermediate(kv.Value); + value.RightMiddleIntermediate = __humanoid__humanBones_Deserialize_RightMiddleIntermediate(kv.Value); continue; } if(key=="rightMiddleDistal"){ - value.RightMiddleDistal = Deserialize_RightMiddleDistal(kv.Value); + value.RightMiddleDistal = __humanoid__humanBones_Deserialize_RightMiddleDistal(kv.Value); continue; } if(key=="rightRingProximal"){ - value.RightRingProximal = Deserialize_RightRingProximal(kv.Value); + value.RightRingProximal = __humanoid__humanBones_Deserialize_RightRingProximal(kv.Value); continue; } if(key=="rightRingIntermediate"){ - value.RightRingIntermediate = Deserialize_RightRingIntermediate(kv.Value); + value.RightRingIntermediate = __humanoid__humanBones_Deserialize_RightRingIntermediate(kv.Value); continue; } if(key=="rightRingDistal"){ - value.RightRingDistal = Deserialize_RightRingDistal(kv.Value); + value.RightRingDistal = __humanoid__humanBones_Deserialize_RightRingDistal(kv.Value); continue; } if(key=="rightLittleProximal"){ - value.RightLittleProximal = Deserialize_RightLittleProximal(kv.Value); + value.RightLittleProximal = __humanoid__humanBones_Deserialize_RightLittleProximal(kv.Value); continue; } if(key=="rightLittleIntermediate"){ - value.RightLittleIntermediate = Deserialize_RightLittleIntermediate(kv.Value); + value.RightLittleIntermediate = __humanoid__humanBones_Deserialize_RightLittleIntermediate(kv.Value); continue; } if(key=="rightLittleDistal"){ - value.RightLittleDistal = Deserialize_RightLittleDistal(kv.Value); + value.RightLittleDistal = __humanoid__humanBones_Deserialize_RightLittleDistal(kv.Value); continue; } @@ -491,7 +491,7 @@ public static HumanBones Deserialize_HumanBones(JsonNode parsed) return value; } -public static HumanBone Deserialize_Hips(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Hips(JsonNode parsed) { var value = new HumanBone(); @@ -508,7 +508,7 @@ public static HumanBone Deserialize_Hips(JsonNode parsed) return value; } -public static HumanBone Deserialize_Spine(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Spine(JsonNode parsed) { var value = new HumanBone(); @@ -525,7 +525,7 @@ public static HumanBone Deserialize_Spine(JsonNode parsed) return value; } -public static HumanBone Deserialize_Chest(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Chest(JsonNode parsed) { var value = new HumanBone(); @@ -542,7 +542,7 @@ public static HumanBone Deserialize_Chest(JsonNode parsed) return value; } -public static HumanBone Deserialize_UpperChest(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_UpperChest(JsonNode parsed) { var value = new HumanBone(); @@ -559,7 +559,7 @@ public static HumanBone Deserialize_UpperChest(JsonNode parsed) return value; } -public static HumanBone Deserialize_Neck(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Neck(JsonNode parsed) { var value = new HumanBone(); @@ -576,7 +576,7 @@ public static HumanBone Deserialize_Neck(JsonNode parsed) return value; } -public static HumanBone Deserialize_Head(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Head(JsonNode parsed) { var value = new HumanBone(); @@ -593,7 +593,7 @@ public static HumanBone Deserialize_Head(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftEye(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftEye(JsonNode parsed) { var value = new HumanBone(); @@ -610,7 +610,7 @@ public static HumanBone Deserialize_LeftEye(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightEye(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightEye(JsonNode parsed) { var value = new HumanBone(); @@ -627,7 +627,7 @@ public static HumanBone Deserialize_RightEye(JsonNode parsed) return value; } -public static HumanBone Deserialize_Jaw(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_Jaw(JsonNode parsed) { var value = new HumanBone(); @@ -644,7 +644,7 @@ public static HumanBone Deserialize_Jaw(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftUpperLeg(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftUpperLeg(JsonNode parsed) { var value = new HumanBone(); @@ -661,7 +661,7 @@ public static HumanBone Deserialize_LeftUpperLeg(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftLowerLeg(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftLowerLeg(JsonNode parsed) { var value = new HumanBone(); @@ -678,7 +678,7 @@ public static HumanBone Deserialize_LeftLowerLeg(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftFoot(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftFoot(JsonNode parsed) { var value = new HumanBone(); @@ -695,7 +695,7 @@ public static HumanBone Deserialize_LeftFoot(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftToes(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftToes(JsonNode parsed) { var value = new HumanBone(); @@ -712,7 +712,7 @@ public static HumanBone Deserialize_LeftToes(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightUpperLeg(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightUpperLeg(JsonNode parsed) { var value = new HumanBone(); @@ -729,7 +729,7 @@ public static HumanBone Deserialize_RightUpperLeg(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightLowerLeg(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightLowerLeg(JsonNode parsed) { var value = new HumanBone(); @@ -746,7 +746,7 @@ public static HumanBone Deserialize_RightLowerLeg(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightFoot(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightFoot(JsonNode parsed) { var value = new HumanBone(); @@ -763,7 +763,7 @@ public static HumanBone Deserialize_RightFoot(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightToes(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightToes(JsonNode parsed) { var value = new HumanBone(); @@ -780,7 +780,7 @@ public static HumanBone Deserialize_RightToes(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftShoulder(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftShoulder(JsonNode parsed) { var value = new HumanBone(); @@ -797,7 +797,7 @@ public static HumanBone Deserialize_LeftShoulder(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftUpperArm(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftUpperArm(JsonNode parsed) { var value = new HumanBone(); @@ -814,7 +814,7 @@ public static HumanBone Deserialize_LeftUpperArm(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftLowerArm(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftLowerArm(JsonNode parsed) { var value = new HumanBone(); @@ -831,7 +831,7 @@ public static HumanBone Deserialize_LeftLowerArm(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftHand(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftHand(JsonNode parsed) { var value = new HumanBone(); @@ -848,7 +848,7 @@ public static HumanBone Deserialize_LeftHand(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightShoulder(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightShoulder(JsonNode parsed) { var value = new HumanBone(); @@ -865,7 +865,7 @@ public static HumanBone Deserialize_RightShoulder(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightUpperArm(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightUpperArm(JsonNode parsed) { var value = new HumanBone(); @@ -882,7 +882,7 @@ public static HumanBone Deserialize_RightUpperArm(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightLowerArm(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightLowerArm(JsonNode parsed) { var value = new HumanBone(); @@ -899,7 +899,7 @@ public static HumanBone Deserialize_RightLowerArm(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightHand(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightHand(JsonNode parsed) { var value = new HumanBone(); @@ -916,7 +916,7 @@ public static HumanBone Deserialize_RightHand(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftThumbProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftThumbProximal(JsonNode parsed) { var value = new HumanBone(); @@ -933,7 +933,7 @@ public static HumanBone Deserialize_LeftThumbProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftThumbIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftThumbIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -950,7 +950,7 @@ public static HumanBone Deserialize_LeftThumbIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftThumbDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftThumbDistal(JsonNode parsed) { var value = new HumanBone(); @@ -967,7 +967,7 @@ public static HumanBone Deserialize_LeftThumbDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftIndexProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftIndexProximal(JsonNode parsed) { var value = new HumanBone(); @@ -984,7 +984,7 @@ public static HumanBone Deserialize_LeftIndexProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftIndexIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftIndexIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1001,7 +1001,7 @@ public static HumanBone Deserialize_LeftIndexIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftIndexDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftIndexDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1018,7 +1018,7 @@ public static HumanBone Deserialize_LeftIndexDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftMiddleProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftMiddleProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1035,7 +1035,7 @@ public static HumanBone Deserialize_LeftMiddleProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftMiddleIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftMiddleIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1052,7 +1052,7 @@ public static HumanBone Deserialize_LeftMiddleIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftMiddleDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftMiddleDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1069,7 +1069,7 @@ public static HumanBone Deserialize_LeftMiddleDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftRingProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftRingProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1086,7 +1086,7 @@ public static HumanBone Deserialize_LeftRingProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftRingIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftRingIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1103,7 +1103,7 @@ public static HumanBone Deserialize_LeftRingIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftRingDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftRingDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1120,7 +1120,7 @@ public static HumanBone Deserialize_LeftRingDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftLittleProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftLittleProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1137,7 +1137,7 @@ public static HumanBone Deserialize_LeftLittleProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftLittleIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftLittleIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1154,7 +1154,7 @@ public static HumanBone Deserialize_LeftLittleIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_LeftLittleDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_LeftLittleDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1171,7 +1171,7 @@ public static HumanBone Deserialize_LeftLittleDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightThumbProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightThumbProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1188,7 +1188,7 @@ public static HumanBone Deserialize_RightThumbProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightThumbIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightThumbIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1205,7 +1205,7 @@ public static HumanBone Deserialize_RightThumbIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightThumbDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightThumbDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1222,7 +1222,7 @@ public static HumanBone Deserialize_RightThumbDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightIndexProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightIndexProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1239,7 +1239,7 @@ public static HumanBone Deserialize_RightIndexProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightIndexIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightIndexIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1256,7 +1256,7 @@ public static HumanBone Deserialize_RightIndexIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightIndexDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightIndexDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1273,7 +1273,7 @@ public static HumanBone Deserialize_RightIndexDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightMiddleProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightMiddleProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1290,7 +1290,7 @@ public static HumanBone Deserialize_RightMiddleProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightMiddleIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightMiddleIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1307,7 +1307,7 @@ public static HumanBone Deserialize_RightMiddleIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightMiddleDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightMiddleDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1324,7 +1324,7 @@ public static HumanBone Deserialize_RightMiddleDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightRingProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightRingProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1341,7 +1341,7 @@ public static HumanBone Deserialize_RightRingProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightRingIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightRingIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1358,7 +1358,7 @@ public static HumanBone Deserialize_RightRingIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightRingDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightRingDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1375,7 +1375,7 @@ public static HumanBone Deserialize_RightRingDistal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightLittleProximal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightLittleProximal(JsonNode parsed) { var value = new HumanBone(); @@ -1392,7 +1392,7 @@ public static HumanBone Deserialize_RightLittleProximal(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightLittleIntermediate(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightLittleIntermediate(JsonNode parsed) { var value = new HumanBone(); @@ -1409,7 +1409,7 @@ public static HumanBone Deserialize_RightLittleIntermediate(JsonNode parsed) return value; } -public static HumanBone Deserialize_RightLittleDistal(JsonNode parsed) +public static HumanBone __humanoid__humanBones_Deserialize_RightLittleDistal(JsonNode parsed) { var value = new HumanBone(); @@ -1435,7 +1435,7 @@ public static FirstPerson Deserialize_FirstPerson(JsonNode parsed) var key = kv.Key.GetString(); if(key=="meshAnnotations"){ - value.MeshAnnotations = Deserialize_MeshAnnotations(kv.Value); + value.MeshAnnotations = __firstPerson_Deserialize_MeshAnnotations(kv.Value); continue; } @@ -1443,17 +1443,17 @@ public static FirstPerson Deserialize_FirstPerson(JsonNode parsed) return value; } -public static List Deserialize_MeshAnnotations(JsonNode parsed) +public static List __firstPerson_Deserialize_MeshAnnotations(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) { - value.Add(Deserialize_MeshAnnotations_ITEM(x)); + value.Add(__firstPerson_Deserialize_MeshAnnotations_ITEM(x)); } return value; } -public static MeshAnnotation Deserialize_MeshAnnotations_ITEM(JsonNode parsed) +public static MeshAnnotation __firstPerson_Deserialize_MeshAnnotations_ITEM(JsonNode parsed) { var value = new MeshAnnotation(); @@ -1466,8 +1466,8 @@ public static MeshAnnotation Deserialize_MeshAnnotations_ITEM(JsonNode parsed) continue; } - if(key=="firstPersonType"){ - value.FirstPersonType = (FirstPersonType)Enum.Parse(typeof(FirstPersonType), kv.Value.GetString(), true); + if(key=="type"){ + value.Type = (FirstPersonType)Enum.Parse(typeof(FirstPersonType), kv.Value.GetString(), true); continue; } @@ -1484,32 +1484,32 @@ public static LookAt Deserialize_LookAt(JsonNode parsed) var key = kv.Key.GetString(); if(key=="offsetFromHeadBone"){ - value.OffsetFromHeadBone = Deserialize_OffsetFromHeadBone(kv.Value); + value.OffsetFromHeadBone = __lookAt_Deserialize_OffsetFromHeadBone(kv.Value); continue; } - if(key=="lookAtType"){ - value.LookAtType = (LookAtType)Enum.Parse(typeof(LookAtType), kv.Value.GetString(), true); + if(key=="type"){ + value.Type = (LookAtType)Enum.Parse(typeof(LookAtType), kv.Value.GetString(), true); continue; } - if(key=="lookAtHorizontalInner"){ - value.LookAtHorizontalInner = Deserialize_LookAtHorizontalInner(kv.Value); + if(key=="rangeMapHorizontalInner"){ + value.RangeMapHorizontalInner = __lookAt_Deserialize_RangeMapHorizontalInner(kv.Value); continue; } - if(key=="lookAtHorizontalOuter"){ - value.LookAtHorizontalOuter = Deserialize_LookAtHorizontalOuter(kv.Value); + if(key=="rangeMapHorizontalOuter"){ + value.RangeMapHorizontalOuter = __lookAt_Deserialize_RangeMapHorizontalOuter(kv.Value); continue; } - if(key=="lookAtVerticalDown"){ - value.LookAtVerticalDown = Deserialize_LookAtVerticalDown(kv.Value); + if(key=="rangeMapVerticalDown"){ + value.RangeMapVerticalDown = __lookAt_Deserialize_RangeMapVerticalDown(kv.Value); continue; } - if(key=="lookAtVerticalUp"){ - value.LookAtVerticalUp = Deserialize_LookAtVerticalUp(kv.Value); + if(key=="rangeMapVerticalUp"){ + value.RangeMapVerticalUp = __lookAt_Deserialize_RangeMapVerticalUp(kv.Value); continue; } @@ -1517,7 +1517,7 @@ public static LookAt Deserialize_LookAt(JsonNode parsed) return value; } -public static float[] Deserialize_OffsetFromHeadBone(JsonNode parsed) +public static float[] __lookAt_Deserialize_OffsetFromHeadBone(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -1528,7 +1528,7 @@ public static float[] Deserialize_OffsetFromHeadBone(JsonNode parsed) return value; } -public static LookAtRangeMap Deserialize_LookAtHorizontalInner(JsonNode parsed) +public static LookAtRangeMap __lookAt_Deserialize_RangeMapHorizontalInner(JsonNode parsed) { var value = new LookAtRangeMap(); @@ -1550,7 +1550,7 @@ public static LookAtRangeMap Deserialize_LookAtHorizontalInner(JsonNode parsed) return value; } -public static LookAtRangeMap Deserialize_LookAtHorizontalOuter(JsonNode parsed) +public static LookAtRangeMap __lookAt_Deserialize_RangeMapHorizontalOuter(JsonNode parsed) { var value = new LookAtRangeMap(); @@ -1572,7 +1572,7 @@ public static LookAtRangeMap Deserialize_LookAtHorizontalOuter(JsonNode parsed) return value; } -public static LookAtRangeMap Deserialize_LookAtVerticalDown(JsonNode parsed) +public static LookAtRangeMap __lookAt_Deserialize_RangeMapVerticalDown(JsonNode parsed) { var value = new LookAtRangeMap(); @@ -1594,7 +1594,7 @@ public static LookAtRangeMap Deserialize_LookAtVerticalDown(JsonNode parsed) return value; } -public static LookAtRangeMap Deserialize_LookAtVerticalUp(JsonNode parsed) +public static LookAtRangeMap __lookAt_Deserialize_RangeMapVerticalUp(JsonNode parsed) { var value = new LookAtRangeMap(); @@ -1655,17 +1655,17 @@ public static Expression Deserialize_Expressions_ITEM(JsonNode parsed) } if(key=="morphTargetBinds"){ - value.MorphTargetBinds = Deserialize_MorphTargetBinds(kv.Value); + value.MorphTargetBinds = __expressions_ITEM_Deserialize_MorphTargetBinds(kv.Value); continue; } if(key=="materialColorBinds"){ - value.MaterialColorBinds = Deserialize_MaterialColorBinds(kv.Value); + value.MaterialColorBinds = __expressions_ITEM_Deserialize_MaterialColorBinds(kv.Value); continue; } if(key=="textureTransformBinds"){ - value.TextureTransformBinds = Deserialize_TextureTransformBinds(kv.Value); + value.TextureTransformBinds = __expressions_ITEM_Deserialize_TextureTransformBinds(kv.Value); continue; } @@ -1693,17 +1693,17 @@ public static Expression Deserialize_Expressions_ITEM(JsonNode parsed) return value; } -public static List Deserialize_MorphTargetBinds(JsonNode parsed) +public static List __expressions_ITEM_Deserialize_MorphTargetBinds(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) { - value.Add(Deserialize_MorphTargetBinds_ITEM(x)); + value.Add(__expressions_ITEM_Deserialize_MorphTargetBinds_ITEM(x)); } return value; } -public static MorphTargetBind Deserialize_MorphTargetBinds_ITEM(JsonNode parsed) +public static MorphTargetBind __expressions_ITEM_Deserialize_MorphTargetBinds_ITEM(JsonNode parsed) { var value = new MorphTargetBind(); @@ -1740,17 +1740,17 @@ public static MorphTargetBind Deserialize_MorphTargetBinds_ITEM(JsonNode parsed) return value; } -public static List Deserialize_MaterialColorBinds(JsonNode parsed) +public static List __expressions_ITEM_Deserialize_MaterialColorBinds(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) { - value.Add(Deserialize_MaterialColorBinds_ITEM(x)); + value.Add(__expressions_ITEM_Deserialize_MaterialColorBinds_ITEM(x)); } return value; } -public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(JsonNode parsed) +public static MaterialColorBind __expressions_ITEM_Deserialize_MaterialColorBinds_ITEM(JsonNode parsed) { var value = new MaterialColorBind(); @@ -1779,7 +1779,7 @@ public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(JsonNode par } if(key=="targetValue"){ - value.TargetValue = Deserialize_TargetValue(kv.Value); + value.TargetValue = __expressions_ITEM__materialColorBinds_ITEM_Deserialize_TargetValue(kv.Value); continue; } @@ -1787,7 +1787,7 @@ public static MaterialColorBind Deserialize_MaterialColorBinds_ITEM(JsonNode par return value; } -public static float[] Deserialize_TargetValue(JsonNode parsed) +public static float[] __expressions_ITEM__materialColorBinds_ITEM_Deserialize_TargetValue(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -1798,17 +1798,17 @@ public static float[] Deserialize_TargetValue(JsonNode parsed) return value; } -public static List Deserialize_TextureTransformBinds(JsonNode parsed) +public static List __expressions_ITEM_Deserialize_TextureTransformBinds(JsonNode parsed) { var value = new List(); foreach(var x in parsed.ArrayItems()) { - value.Add(Deserialize_TextureTransformBinds_ITEM(x)); + value.Add(__expressions_ITEM_Deserialize_TextureTransformBinds_ITEM(x)); } return value; } -public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(JsonNode parsed) +public static TextureTransformBind __expressions_ITEM_Deserialize_TextureTransformBinds_ITEM(JsonNode parsed) { var value = new TextureTransformBind(); @@ -1832,12 +1832,12 @@ public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(JsonNo } if(key=="scaling"){ - value.Scaling = Deserialize_Scaling(kv.Value); + value.Scaling = __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scaling(kv.Value); continue; } if(key=="offset"){ - value.Offset = Deserialize_Offset(kv.Value); + value.Offset = __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Offset(kv.Value); continue; } @@ -1845,7 +1845,7 @@ public static TextureTransformBind Deserialize_TextureTransformBinds_ITEM(JsonNo return value; } -public static float[] Deserialize_Scaling(JsonNode parsed) +public static float[] __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Scaling(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; @@ -1856,7 +1856,7 @@ public static float[] Deserialize_Scaling(JsonNode parsed) return value; } -public static float[] Deserialize_Offset(JsonNode parsed) +public static float[] __expressions_ITEM__textureTransformBinds_ITEM_Deserialize_Offset(JsonNode parsed) { var value = new float[parsed.GetArrayCount()]; int i=0; diff --git a/Assets/VRM10/Runtime/Format/Vrm/Format.g.cs b/Assets/VRM10/Runtime/Format/Vrm/Format.g.cs index 8650c4b84..60319c844 100644 --- a/Assets/VRM10/Runtime/Format/Vrm/Format.g.cs +++ b/Assets/VRM10/Runtime/Format/Vrm/Format.g.cs @@ -293,12 +293,12 @@ namespace UniGLTF.Extensions.VRMC_vrm // How the camera interprets the mesh. [JsonSchema(EnumSerializationType = EnumSerializationType.AsString)] - public FirstPersonType FirstPersonType; + public FirstPersonType Type; } public class FirstPerson { - // Mesh rendering annotation for cameras. 'required' : [ 'mesh' , 'firstPersonType' ] + // Mesh rendering annotation for cameras. public List MeshAnnotations; } @@ -324,19 +324,19 @@ namespace UniGLTF.Extensions.VRMC_vrm public float[] OffsetFromHeadBone; [JsonSchema(EnumSerializationType = EnumSerializationType.AsString)] - public LookAtType LookAtType; + public LookAtType Type; // Horizontal inward movement. The left eye moves right. The right eye moves left. - public LookAtRangeMap LookAtHorizontalInner; + public LookAtRangeMap RangeMapHorizontalInner; // Horizontal outward movement. The left eye moves left. The right eye moves right. - public LookAtRangeMap LookAtHorizontalOuter; + public LookAtRangeMap RangeMapHorizontalOuter; // Vertical downward movement. Both eyes move upwards - public LookAtRangeMap LookAtVerticalDown; + public LookAtRangeMap RangeMapVerticalDown; // Vertical upward movement. Both eyes move downwards - public LookAtRangeMap LookAtVerticalUp; + public LookAtRangeMap RangeMapVerticalUp; } public enum ExpressionPreset diff --git a/Assets/VRM10/Runtime/Format/Vrm/Serializer.g.cs b/Assets/VRM10/Runtime/Format/Vrm/Serializer.g.cs index 06579e338..c5dc200a8 100644 --- a/Assets/VRM10/Runtime/Format/Vrm/Serializer.g.cs +++ b/Assets/VRM10/Runtime/Format/Vrm/Serializer.g.cs @@ -83,7 +83,7 @@ public static void Serialize_Meta(JsonFormatter f, Meta value) if(value.Authors!=null&&value.Authors.Count()>=1){ f.Key("authors"); - Serialize_Authors(f, value.Authors); + __meta_Serialize_Authors(f, value.Authors); } if(!string.IsNullOrEmpty(value.CopyrightInformation)){ @@ -98,7 +98,7 @@ public static void Serialize_Meta(JsonFormatter f, Meta value) if(value.References!=null&&value.References.Count()>=0){ f.Key("references"); - Serialize_References(f, value.References); + __meta_Serialize_References(f, value.References); } if(!string.IsNullOrEmpty(value.ThirdPartyLicenses)){ @@ -159,7 +159,7 @@ public static void Serialize_Meta(JsonFormatter f, Meta value) f.EndMap(); } -public static void Serialize_Authors(JsonFormatter f, List value) +public static void __meta_Serialize_Authors(JsonFormatter f, List value) { f.BeginList(); @@ -171,7 +171,7 @@ public static void Serialize_Authors(JsonFormatter f, List value) f.EndList(); } -public static void Serialize_References(JsonFormatter f, List value) +public static void __meta_Serialize_References(JsonFormatter f, List value) { f.BeginList(); @@ -190,296 +190,296 @@ public static void Serialize_Humanoid(JsonFormatter f, Humanoid value) if(value.HumanBones!=null){ f.Key("humanBones"); - Serialize_HumanBones(f, value.HumanBones); + __humanoid_Serialize_HumanBones(f, value.HumanBones); } f.EndMap(); } -public static void Serialize_HumanBones(JsonFormatter f, HumanBones value) +public static void __humanoid_Serialize_HumanBones(JsonFormatter f, HumanBones value) { f.BeginMap(); if(value.Hips!=null){ f.Key("hips"); - Serialize_Hips(f, value.Hips); + __humanoid__humanBones_Serialize_Hips(f, value.Hips); } if(value.Spine!=null){ f.Key("spine"); - Serialize_Spine(f, value.Spine); + __humanoid__humanBones_Serialize_Spine(f, value.Spine); } if(value.Chest!=null){ f.Key("chest"); - Serialize_Chest(f, value.Chest); + __humanoid__humanBones_Serialize_Chest(f, value.Chest); } if(value.UpperChest!=null){ f.Key("upperChest"); - Serialize_UpperChest(f, value.UpperChest); + __humanoid__humanBones_Serialize_UpperChest(f, value.UpperChest); } if(value.Neck!=null){ f.Key("neck"); - Serialize_Neck(f, value.Neck); + __humanoid__humanBones_Serialize_Neck(f, value.Neck); } if(value.Head!=null){ f.Key("head"); - Serialize_Head(f, value.Head); + __humanoid__humanBones_Serialize_Head(f, value.Head); } if(value.LeftEye!=null){ f.Key("leftEye"); - Serialize_LeftEye(f, value.LeftEye); + __humanoid__humanBones_Serialize_LeftEye(f, value.LeftEye); } if(value.RightEye!=null){ f.Key("rightEye"); - Serialize_RightEye(f, value.RightEye); + __humanoid__humanBones_Serialize_RightEye(f, value.RightEye); } if(value.Jaw!=null){ f.Key("jaw"); - Serialize_Jaw(f, value.Jaw); + __humanoid__humanBones_Serialize_Jaw(f, value.Jaw); } if(value.LeftUpperLeg!=null){ f.Key("leftUpperLeg"); - Serialize_LeftUpperLeg(f, value.LeftUpperLeg); + __humanoid__humanBones_Serialize_LeftUpperLeg(f, value.LeftUpperLeg); } if(value.LeftLowerLeg!=null){ f.Key("leftLowerLeg"); - Serialize_LeftLowerLeg(f, value.LeftLowerLeg); + __humanoid__humanBones_Serialize_LeftLowerLeg(f, value.LeftLowerLeg); } if(value.LeftFoot!=null){ f.Key("leftFoot"); - Serialize_LeftFoot(f, value.LeftFoot); + __humanoid__humanBones_Serialize_LeftFoot(f, value.LeftFoot); } if(value.LeftToes!=null){ f.Key("leftToes"); - Serialize_LeftToes(f, value.LeftToes); + __humanoid__humanBones_Serialize_LeftToes(f, value.LeftToes); } if(value.RightUpperLeg!=null){ f.Key("rightUpperLeg"); - Serialize_RightUpperLeg(f, value.RightUpperLeg); + __humanoid__humanBones_Serialize_RightUpperLeg(f, value.RightUpperLeg); } if(value.RightLowerLeg!=null){ f.Key("rightLowerLeg"); - Serialize_RightLowerLeg(f, value.RightLowerLeg); + __humanoid__humanBones_Serialize_RightLowerLeg(f, value.RightLowerLeg); } if(value.RightFoot!=null){ f.Key("rightFoot"); - Serialize_RightFoot(f, value.RightFoot); + __humanoid__humanBones_Serialize_RightFoot(f, value.RightFoot); } if(value.RightToes!=null){ f.Key("rightToes"); - Serialize_RightToes(f, value.RightToes); + __humanoid__humanBones_Serialize_RightToes(f, value.RightToes); } if(value.LeftShoulder!=null){ f.Key("leftShoulder"); - Serialize_LeftShoulder(f, value.LeftShoulder); + __humanoid__humanBones_Serialize_LeftShoulder(f, value.LeftShoulder); } if(value.LeftUpperArm!=null){ f.Key("leftUpperArm"); - Serialize_LeftUpperArm(f, value.LeftUpperArm); + __humanoid__humanBones_Serialize_LeftUpperArm(f, value.LeftUpperArm); } if(value.LeftLowerArm!=null){ f.Key("leftLowerArm"); - Serialize_LeftLowerArm(f, value.LeftLowerArm); + __humanoid__humanBones_Serialize_LeftLowerArm(f, value.LeftLowerArm); } if(value.LeftHand!=null){ f.Key("leftHand"); - Serialize_LeftHand(f, value.LeftHand); + __humanoid__humanBones_Serialize_LeftHand(f, value.LeftHand); } if(value.RightShoulder!=null){ f.Key("rightShoulder"); - Serialize_RightShoulder(f, value.RightShoulder); + __humanoid__humanBones_Serialize_RightShoulder(f, value.RightShoulder); } if(value.RightUpperArm!=null){ f.Key("rightUpperArm"); - Serialize_RightUpperArm(f, value.RightUpperArm); + __humanoid__humanBones_Serialize_RightUpperArm(f, value.RightUpperArm); } if(value.RightLowerArm!=null){ f.Key("rightLowerArm"); - Serialize_RightLowerArm(f, value.RightLowerArm); + __humanoid__humanBones_Serialize_RightLowerArm(f, value.RightLowerArm); } if(value.RightHand!=null){ f.Key("rightHand"); - Serialize_RightHand(f, value.RightHand); + __humanoid__humanBones_Serialize_RightHand(f, value.RightHand); } if(value.LeftThumbProximal!=null){ f.Key("leftThumbProximal"); - Serialize_LeftThumbProximal(f, value.LeftThumbProximal); + __humanoid__humanBones_Serialize_LeftThumbProximal(f, value.LeftThumbProximal); } if(value.LeftThumbIntermediate!=null){ f.Key("leftThumbIntermediate"); - Serialize_LeftThumbIntermediate(f, value.LeftThumbIntermediate); + __humanoid__humanBones_Serialize_LeftThumbIntermediate(f, value.LeftThumbIntermediate); } if(value.LeftThumbDistal!=null){ f.Key("leftThumbDistal"); - Serialize_LeftThumbDistal(f, value.LeftThumbDistal); + __humanoid__humanBones_Serialize_LeftThumbDistal(f, value.LeftThumbDistal); } if(value.LeftIndexProximal!=null){ f.Key("leftIndexProximal"); - Serialize_LeftIndexProximal(f, value.LeftIndexProximal); + __humanoid__humanBones_Serialize_LeftIndexProximal(f, value.LeftIndexProximal); } if(value.LeftIndexIntermediate!=null){ f.Key("leftIndexIntermediate"); - Serialize_LeftIndexIntermediate(f, value.LeftIndexIntermediate); + __humanoid__humanBones_Serialize_LeftIndexIntermediate(f, value.LeftIndexIntermediate); } if(value.LeftIndexDistal!=null){ f.Key("leftIndexDistal"); - Serialize_LeftIndexDistal(f, value.LeftIndexDistal); + __humanoid__humanBones_Serialize_LeftIndexDistal(f, value.LeftIndexDistal); } if(value.LeftMiddleProximal!=null){ f.Key("leftMiddleProximal"); - Serialize_LeftMiddleProximal(f, value.LeftMiddleProximal); + __humanoid__humanBones_Serialize_LeftMiddleProximal(f, value.LeftMiddleProximal); } if(value.LeftMiddleIntermediate!=null){ f.Key("leftMiddleIntermediate"); - Serialize_LeftMiddleIntermediate(f, value.LeftMiddleIntermediate); + __humanoid__humanBones_Serialize_LeftMiddleIntermediate(f, value.LeftMiddleIntermediate); } if(value.LeftMiddleDistal!=null){ f.Key("leftMiddleDistal"); - Serialize_LeftMiddleDistal(f, value.LeftMiddleDistal); + __humanoid__humanBones_Serialize_LeftMiddleDistal(f, value.LeftMiddleDistal); } if(value.LeftRingProximal!=null){ f.Key("leftRingProximal"); - Serialize_LeftRingProximal(f, value.LeftRingProximal); + __humanoid__humanBones_Serialize_LeftRingProximal(f, value.LeftRingProximal); } if(value.LeftRingIntermediate!=null){ f.Key("leftRingIntermediate"); - Serialize_LeftRingIntermediate(f, value.LeftRingIntermediate); + __humanoid__humanBones_Serialize_LeftRingIntermediate(f, value.LeftRingIntermediate); } if(value.LeftRingDistal!=null){ f.Key("leftRingDistal"); - Serialize_LeftRingDistal(f, value.LeftRingDistal); + __humanoid__humanBones_Serialize_LeftRingDistal(f, value.LeftRingDistal); } if(value.LeftLittleProximal!=null){ f.Key("leftLittleProximal"); - Serialize_LeftLittleProximal(f, value.LeftLittleProximal); + __humanoid__humanBones_Serialize_LeftLittleProximal(f, value.LeftLittleProximal); } if(value.LeftLittleIntermediate!=null){ f.Key("leftLittleIntermediate"); - Serialize_LeftLittleIntermediate(f, value.LeftLittleIntermediate); + __humanoid__humanBones_Serialize_LeftLittleIntermediate(f, value.LeftLittleIntermediate); } if(value.LeftLittleDistal!=null){ f.Key("leftLittleDistal"); - Serialize_LeftLittleDistal(f, value.LeftLittleDistal); + __humanoid__humanBones_Serialize_LeftLittleDistal(f, value.LeftLittleDistal); } if(value.RightThumbProximal!=null){ f.Key("rightThumbProximal"); - Serialize_RightThumbProximal(f, value.RightThumbProximal); + __humanoid__humanBones_Serialize_RightThumbProximal(f, value.RightThumbProximal); } if(value.RightThumbIntermediate!=null){ f.Key("rightThumbIntermediate"); - Serialize_RightThumbIntermediate(f, value.RightThumbIntermediate); + __humanoid__humanBones_Serialize_RightThumbIntermediate(f, value.RightThumbIntermediate); } if(value.RightThumbDistal!=null){ f.Key("rightThumbDistal"); - Serialize_RightThumbDistal(f, value.RightThumbDistal); + __humanoid__humanBones_Serialize_RightThumbDistal(f, value.RightThumbDistal); } if(value.RightIndexProximal!=null){ f.Key("rightIndexProximal"); - Serialize_RightIndexProximal(f, value.RightIndexProximal); + __humanoid__humanBones_Serialize_RightIndexProximal(f, value.RightIndexProximal); } if(value.RightIndexIntermediate!=null){ f.Key("rightIndexIntermediate"); - Serialize_RightIndexIntermediate(f, value.RightIndexIntermediate); + __humanoid__humanBones_Serialize_RightIndexIntermediate(f, value.RightIndexIntermediate); } if(value.RightIndexDistal!=null){ f.Key("rightIndexDistal"); - Serialize_RightIndexDistal(f, value.RightIndexDistal); + __humanoid__humanBones_Serialize_RightIndexDistal(f, value.RightIndexDistal); } if(value.RightMiddleProximal!=null){ f.Key("rightMiddleProximal"); - Serialize_RightMiddleProximal(f, value.RightMiddleProximal); + __humanoid__humanBones_Serialize_RightMiddleProximal(f, value.RightMiddleProximal); } if(value.RightMiddleIntermediate!=null){ f.Key("rightMiddleIntermediate"); - Serialize_RightMiddleIntermediate(f, value.RightMiddleIntermediate); + __humanoid__humanBones_Serialize_RightMiddleIntermediate(f, value.RightMiddleIntermediate); } if(value.RightMiddleDistal!=null){ f.Key("rightMiddleDistal"); - Serialize_RightMiddleDistal(f, value.RightMiddleDistal); + __humanoid__humanBones_Serialize_RightMiddleDistal(f, value.RightMiddleDistal); } if(value.RightRingProximal!=null){ f.Key("rightRingProximal"); - Serialize_RightRingProximal(f, value.RightRingProximal); + __humanoid__humanBones_Serialize_RightRingProximal(f, value.RightRingProximal); } if(value.RightRingIntermediate!=null){ f.Key("rightRingIntermediate"); - Serialize_RightRingIntermediate(f, value.RightRingIntermediate); + __humanoid__humanBones_Serialize_RightRingIntermediate(f, value.RightRingIntermediate); } if(value.RightRingDistal!=null){ f.Key("rightRingDistal"); - Serialize_RightRingDistal(f, value.RightRingDistal); + __humanoid__humanBones_Serialize_RightRingDistal(f, value.RightRingDistal); } if(value.RightLittleProximal!=null){ f.Key("rightLittleProximal"); - Serialize_RightLittleProximal(f, value.RightLittleProximal); + __humanoid__humanBones_Serialize_RightLittleProximal(f, value.RightLittleProximal); } if(value.RightLittleIntermediate!=null){ f.Key("rightLittleIntermediate"); - Serialize_RightLittleIntermediate(f, value.RightLittleIntermediate); + __humanoid__humanBones_Serialize_RightLittleIntermediate(f, value.RightLittleIntermediate); } if(value.RightLittleDistal!=null){ f.Key("rightLittleDistal"); - Serialize_RightLittleDistal(f, value.RightLittleDistal); + __humanoid__humanBones_Serialize_RightLittleDistal(f, value.RightLittleDistal); } f.EndMap(); } -public static void Serialize_Hips(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Hips(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -492,7 +492,7 @@ public static void Serialize_Hips(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_Spine(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Spine(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -505,7 +505,7 @@ public static void Serialize_Spine(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_Chest(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Chest(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -518,7 +518,7 @@ public static void Serialize_Chest(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_UpperChest(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_UpperChest(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -531,7 +531,7 @@ public static void Serialize_UpperChest(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_Neck(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Neck(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -544,7 +544,7 @@ public static void Serialize_Neck(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_Head(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Head(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -557,7 +557,7 @@ public static void Serialize_Head(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftEye(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftEye(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -570,7 +570,7 @@ public static void Serialize_LeftEye(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightEye(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightEye(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -583,7 +583,7 @@ public static void Serialize_RightEye(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_Jaw(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_Jaw(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -596,7 +596,7 @@ public static void Serialize_Jaw(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftUpperLeg(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftUpperLeg(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -609,7 +609,7 @@ public static void Serialize_LeftUpperLeg(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftLowerLeg(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftLowerLeg(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -622,7 +622,7 @@ public static void Serialize_LeftLowerLeg(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftFoot(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftFoot(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -635,7 +635,7 @@ public static void Serialize_LeftFoot(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftToes(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftToes(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -648,7 +648,7 @@ public static void Serialize_LeftToes(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightUpperLeg(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightUpperLeg(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -661,7 +661,7 @@ public static void Serialize_RightUpperLeg(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightLowerLeg(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightLowerLeg(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -674,7 +674,7 @@ public static void Serialize_RightLowerLeg(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightFoot(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightFoot(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -687,7 +687,7 @@ public static void Serialize_RightFoot(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightToes(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightToes(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -700,7 +700,7 @@ public static void Serialize_RightToes(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftShoulder(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftShoulder(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -713,7 +713,7 @@ public static void Serialize_LeftShoulder(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftUpperArm(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftUpperArm(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -726,7 +726,7 @@ public static void Serialize_LeftUpperArm(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftLowerArm(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftLowerArm(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -739,7 +739,7 @@ public static void Serialize_LeftLowerArm(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftHand(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftHand(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -752,7 +752,7 @@ public static void Serialize_LeftHand(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightShoulder(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightShoulder(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -765,7 +765,7 @@ public static void Serialize_RightShoulder(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightUpperArm(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightUpperArm(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -778,7 +778,7 @@ public static void Serialize_RightUpperArm(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightLowerArm(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightLowerArm(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -791,7 +791,7 @@ public static void Serialize_RightLowerArm(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightHand(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightHand(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -804,7 +804,7 @@ public static void Serialize_RightHand(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftThumbProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftThumbProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -817,7 +817,7 @@ public static void Serialize_LeftThumbProximal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftThumbIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftThumbIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -830,7 +830,7 @@ public static void Serialize_LeftThumbIntermediate(JsonFormatter f, HumanBone va f.EndMap(); } -public static void Serialize_LeftThumbDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftThumbDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -843,7 +843,7 @@ public static void Serialize_LeftThumbDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftIndexProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftIndexProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -856,7 +856,7 @@ public static void Serialize_LeftIndexProximal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftIndexIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftIndexIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -869,7 +869,7 @@ public static void Serialize_LeftIndexIntermediate(JsonFormatter f, HumanBone va f.EndMap(); } -public static void Serialize_LeftIndexDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftIndexDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -882,7 +882,7 @@ public static void Serialize_LeftIndexDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftMiddleProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftMiddleProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -895,7 +895,7 @@ public static void Serialize_LeftMiddleProximal(JsonFormatter f, HumanBone value f.EndMap(); } -public static void Serialize_LeftMiddleIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftMiddleIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -908,7 +908,7 @@ public static void Serialize_LeftMiddleIntermediate(JsonFormatter f, HumanBone v f.EndMap(); } -public static void Serialize_LeftMiddleDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftMiddleDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -921,7 +921,7 @@ public static void Serialize_LeftMiddleDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftRingProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftRingProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -934,7 +934,7 @@ public static void Serialize_LeftRingProximal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftRingIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftRingIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -947,7 +947,7 @@ public static void Serialize_LeftRingIntermediate(JsonFormatter f, HumanBone val f.EndMap(); } -public static void Serialize_LeftRingDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftRingDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -960,7 +960,7 @@ public static void Serialize_LeftRingDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_LeftLittleProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftLittleProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -973,7 +973,7 @@ public static void Serialize_LeftLittleProximal(JsonFormatter f, HumanBone value f.EndMap(); } -public static void Serialize_LeftLittleIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftLittleIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -986,7 +986,7 @@ public static void Serialize_LeftLittleIntermediate(JsonFormatter f, HumanBone v f.EndMap(); } -public static void Serialize_LeftLittleDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_LeftLittleDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -999,7 +999,7 @@ public static void Serialize_LeftLittleDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightThumbProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightThumbProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1012,7 +1012,7 @@ public static void Serialize_RightThumbProximal(JsonFormatter f, HumanBone value f.EndMap(); } -public static void Serialize_RightThumbIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightThumbIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1025,7 +1025,7 @@ public static void Serialize_RightThumbIntermediate(JsonFormatter f, HumanBone v f.EndMap(); } -public static void Serialize_RightThumbDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightThumbDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1038,7 +1038,7 @@ public static void Serialize_RightThumbDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightIndexProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightIndexProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1051,7 +1051,7 @@ public static void Serialize_RightIndexProximal(JsonFormatter f, HumanBone value f.EndMap(); } -public static void Serialize_RightIndexIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightIndexIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1064,7 +1064,7 @@ public static void Serialize_RightIndexIntermediate(JsonFormatter f, HumanBone v f.EndMap(); } -public static void Serialize_RightIndexDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightIndexDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1077,7 +1077,7 @@ public static void Serialize_RightIndexDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightMiddleProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightMiddleProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1090,7 +1090,7 @@ public static void Serialize_RightMiddleProximal(JsonFormatter f, HumanBone valu f.EndMap(); } -public static void Serialize_RightMiddleIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightMiddleIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1103,7 +1103,7 @@ public static void Serialize_RightMiddleIntermediate(JsonFormatter f, HumanBone f.EndMap(); } -public static void Serialize_RightMiddleDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightMiddleDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1116,7 +1116,7 @@ public static void Serialize_RightMiddleDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightRingProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightRingProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1129,7 +1129,7 @@ public static void Serialize_RightRingProximal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightRingIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightRingIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1142,7 +1142,7 @@ public static void Serialize_RightRingIntermediate(JsonFormatter f, HumanBone va f.EndMap(); } -public static void Serialize_RightRingDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightRingDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1155,7 +1155,7 @@ public static void Serialize_RightRingDistal(JsonFormatter f, HumanBone value) f.EndMap(); } -public static void Serialize_RightLittleProximal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightLittleProximal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1168,7 +1168,7 @@ public static void Serialize_RightLittleProximal(JsonFormatter f, HumanBone valu f.EndMap(); } -public static void Serialize_RightLittleIntermediate(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightLittleIntermediate(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1181,7 +1181,7 @@ public static void Serialize_RightLittleIntermediate(JsonFormatter f, HumanBone f.EndMap(); } -public static void Serialize_RightLittleDistal(JsonFormatter f, HumanBone value) +public static void __humanoid__humanBones_Serialize_RightLittleDistal(JsonFormatter f, HumanBone value) { f.BeginMap(); @@ -1201,25 +1201,25 @@ public static void Serialize_FirstPerson(JsonFormatter f, FirstPerson value) if(value.MeshAnnotations!=null&&value.MeshAnnotations.Count()>=0){ f.Key("meshAnnotations"); - Serialize_MeshAnnotations(f, value.MeshAnnotations); + __firstPerson_Serialize_MeshAnnotations(f, value.MeshAnnotations); } f.EndMap(); } -public static void Serialize_MeshAnnotations(JsonFormatter f, List value) +public static void __firstPerson_Serialize_MeshAnnotations(JsonFormatter f, List value) { f.BeginList(); foreach(var item in value) { - Serialize_MeshAnnotations_ITEM(f, item); + __firstPerson_Serialize_MeshAnnotations_ITEM(f, item); } f.EndList(); } -public static void Serialize_MeshAnnotations_ITEM(JsonFormatter f, MeshAnnotation value) +public static void __firstPerson_Serialize_MeshAnnotations_ITEM(JsonFormatter f, MeshAnnotation value) { f.BeginMap(); @@ -1230,8 +1230,8 @@ public static void Serialize_MeshAnnotations_ITEM(JsonFormatter f, MeshAnnotatio } if(true){ - f.Key("firstPersonType"); - f.Value(value.FirstPersonType.ToString()); + f.Key("type"); + f.Value(value.Type.ToString()); } f.EndMap(); @@ -1244,38 +1244,38 @@ public static void Serialize_LookAt(JsonFormatter f, LookAt value) if(value.OffsetFromHeadBone!=null&&value.OffsetFromHeadBone.Count()>=0){ f.Key("offsetFromHeadBone"); - Serialize_OffsetFromHeadBone(f, value.OffsetFromHeadBone); + __lookAt_Serialize_OffsetFromHeadBone(f, value.OffsetFromHeadBone); } if(true){ - f.Key("lookAtType"); - f.Value(value.LookAtType.ToString()); + f.Key("type"); + f.Value(value.Type.ToString()); } - if(value.LookAtHorizontalInner!=null){ - f.Key("lookAtHorizontalInner"); - Serialize_LookAtHorizontalInner(f, value.LookAtHorizontalInner); + if(value.RangeMapHorizontalInner!=null){ + f.Key("rangeMapHorizontalInner"); + __lookAt_Serialize_RangeMapHorizontalInner(f, value.RangeMapHorizontalInner); } - if(value.LookAtHorizontalOuter!=null){ - f.Key("lookAtHorizontalOuter"); - Serialize_LookAtHorizontalOuter(f, value.LookAtHorizontalOuter); + if(value.RangeMapHorizontalOuter!=null){ + f.Key("rangeMapHorizontalOuter"); + __lookAt_Serialize_RangeMapHorizontalOuter(f, value.RangeMapHorizontalOuter); } - if(value.LookAtVerticalDown!=null){ - f.Key("lookAtVerticalDown"); - Serialize_LookAtVerticalDown(f, value.LookAtVerticalDown); + if(value.RangeMapVerticalDown!=null){ + f.Key("rangeMapVerticalDown"); + __lookAt_Serialize_RangeMapVerticalDown(f, value.RangeMapVerticalDown); } - if(value.LookAtVerticalUp!=null){ - f.Key("lookAtVerticalUp"); - Serialize_LookAtVerticalUp(f, value.LookAtVerticalUp); + if(value.RangeMapVerticalUp!=null){ + f.Key("rangeMapVerticalUp"); + __lookAt_Serialize_RangeMapVerticalUp(f, value.RangeMapVerticalUp); } f.EndMap(); } -public static void Serialize_OffsetFromHeadBone(JsonFormatter f, float[] value) +public static void __lookAt_Serialize_OffsetFromHeadBone(JsonFormatter f, float[] value) { f.BeginList(); @@ -1287,7 +1287,7 @@ public static void Serialize_OffsetFromHeadBone(JsonFormatter f, float[] value) f.EndList(); } -public static void Serialize_LookAtHorizontalInner(JsonFormatter f, LookAtRangeMap value) +public static void __lookAt_Serialize_RangeMapHorizontalInner(JsonFormatter f, LookAtRangeMap value) { f.BeginMap(); @@ -1305,7 +1305,7 @@ public static void Serialize_LookAtHorizontalInner(JsonFormatter f, LookAtRangeM f.EndMap(); } -public static void Serialize_LookAtHorizontalOuter(JsonFormatter f, LookAtRangeMap value) +public static void __lookAt_Serialize_RangeMapHorizontalOuter(JsonFormatter f, LookAtRangeMap value) { f.BeginMap(); @@ -1323,7 +1323,7 @@ public static void Serialize_LookAtHorizontalOuter(JsonFormatter f, LookAtRangeM f.EndMap(); } -public static void Serialize_LookAtVerticalDown(JsonFormatter f, LookAtRangeMap value) +public static void __lookAt_Serialize_RangeMapVerticalDown(JsonFormatter f, LookAtRangeMap value) { f.BeginMap(); @@ -1341,7 +1341,7 @@ public static void Serialize_LookAtVerticalDown(JsonFormatter f, LookAtRangeMap f.EndMap(); } -public static void Serialize_LookAtVerticalUp(JsonFormatter f, LookAtRangeMap value) +public static void __lookAt_Serialize_RangeMapVerticalUp(JsonFormatter f, LookAtRangeMap value) { f.BeginMap(); @@ -1398,17 +1398,17 @@ public static void Serialize_Expressions_ITEM(JsonFormatter f, Expression value) if(value.MorphTargetBinds!=null&&value.MorphTargetBinds.Count()>=0){ f.Key("morphTargetBinds"); - Serialize_MorphTargetBinds(f, value.MorphTargetBinds); + __expressions_ITEM_Serialize_MorphTargetBinds(f, value.MorphTargetBinds); } if(value.MaterialColorBinds!=null&&value.MaterialColorBinds.Count()>=0){ f.Key("materialColorBinds"); - Serialize_MaterialColorBinds(f, value.MaterialColorBinds); + __expressions_ITEM_Serialize_MaterialColorBinds(f, value.MaterialColorBinds); } if(value.TextureTransformBinds!=null&&value.TextureTransformBinds.Count()>=0){ f.Key("textureTransformBinds"); - Serialize_TextureTransformBinds(f, value.TextureTransformBinds); + __expressions_ITEM_Serialize_TextureTransformBinds(f, value.TextureTransformBinds); } if(value.IsBinary.HasValue){ @@ -1434,19 +1434,19 @@ public static void Serialize_Expressions_ITEM(JsonFormatter f, Expression value) f.EndMap(); } -public static void Serialize_MorphTargetBinds(JsonFormatter f, List value) +public static void __expressions_ITEM_Serialize_MorphTargetBinds(JsonFormatter f, List value) { f.BeginList(); foreach(var item in value) { - Serialize_MorphTargetBinds_ITEM(f, item); + __expressions_ITEM_Serialize_MorphTargetBinds_ITEM(f, item); } f.EndList(); } -public static void Serialize_MorphTargetBinds_ITEM(JsonFormatter f, MorphTargetBind value) +public static void __expressions_ITEM_Serialize_MorphTargetBinds_ITEM(JsonFormatter f, MorphTargetBind value) { f.BeginMap(); @@ -1479,19 +1479,19 @@ public static void Serialize_MorphTargetBinds_ITEM(JsonFormatter f, MorphTargetB f.EndMap(); } -public static void Serialize_MaterialColorBinds(JsonFormatter f, List value) +public static void __expressions_ITEM_Serialize_MaterialColorBinds(JsonFormatter f, List value) { f.BeginList(); foreach(var item in value) { - Serialize_MaterialColorBinds_ITEM(f, item); + __expressions_ITEM_Serialize_MaterialColorBinds_ITEM(f, item); } f.EndList(); } -public static void Serialize_MaterialColorBinds_ITEM(JsonFormatter f, MaterialColorBind value) +public static void __expressions_ITEM_Serialize_MaterialColorBinds_ITEM(JsonFormatter f, MaterialColorBind value) { f.BeginMap(); @@ -1518,13 +1518,13 @@ public static void Serialize_MaterialColorBinds_ITEM(JsonFormatter f, MaterialCo if(value.TargetValue!=null&&value.TargetValue.Count()>=4){ f.Key("targetValue"); - Serialize_TargetValue(f, value.TargetValue); + __expressions_ITEM__materialColorBinds_ITEM_Serialize_TargetValue(f, value.TargetValue); } f.EndMap(); } -public static void Serialize_TargetValue(JsonFormatter f, float[] value) +public static void __expressions_ITEM__materialColorBinds_ITEM_Serialize_TargetValue(JsonFormatter f, float[] value) { f.BeginList(); @@ -1536,19 +1536,19 @@ public static void Serialize_TargetValue(JsonFormatter f, float[] value) f.EndList(); } -public static void Serialize_TextureTransformBinds(JsonFormatter f, List value) +public static void __expressions_ITEM_Serialize_TextureTransformBinds(JsonFormatter f, List value) { f.BeginList(); foreach(var item in value) { - Serialize_TextureTransformBinds_ITEM(f, item); + __expressions_ITEM_Serialize_TextureTransformBinds_ITEM(f, item); } f.EndList(); } -public static void Serialize_TextureTransformBinds_ITEM(JsonFormatter f, TextureTransformBind value) +public static void __expressions_ITEM_Serialize_TextureTransformBinds_ITEM(JsonFormatter f, TextureTransformBind value) { f.BeginMap(); @@ -1570,18 +1570,18 @@ public static void Serialize_TextureTransformBinds_ITEM(JsonFormatter f, Texture if(value.Scaling!=null&&value.Scaling.Count()>=2){ f.Key("scaling"); - Serialize_Scaling(f, value.Scaling); + __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scaling(f, value.Scaling); } if(value.Offset!=null&&value.Offset.Count()>=2){ f.Key("offset"); - Serialize_Offset(f, value.Offset); + __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Offset(f, value.Offset); } f.EndMap(); } -public static void Serialize_Scaling(JsonFormatter f, float[] value) +public static void __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Scaling(JsonFormatter f, float[] value) { f.BeginList(); @@ -1593,7 +1593,7 @@ public static void Serialize_Scaling(JsonFormatter f, float[] value) f.EndList(); } -public static void Serialize_Offset(JsonFormatter f, float[] value) +public static void __expressions_ITEM__textureTransformBinds_ITEM_Serialize_Offset(JsonFormatter f, float[] value) { f.BeginList(); diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index f2ae36921..bb20f8477 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -347,7 +347,7 @@ namespace UniVRM10 // serialize UniGLTF.Extensions.VRMC_node_collider.GltfSerializer.SerializeTo(ref gltfNode.extensions, collider); } - spring.Colliders = colliders.ToArray(); + spring.ColliderGroups = colliders.ToArray(); } return springBone; @@ -453,7 +453,7 @@ namespace UniVRM10 return new UniGLTF.Extensions.VRMC_vrm.MeshAnnotation { Node = getIndex(flags.Renderer), - FirstPersonType = flags.FirstPersonFlag, + Type = flags.FirstPersonFlag, }; } @@ -497,16 +497,16 @@ namespace UniVRM10 vrm.LookAt = new UniGLTF.Extensions.VRMC_vrm.LookAt { - LookAtType = vrmController.LookAt.LookAtType, + Type = vrmController.LookAt.LookAtType, OffsetFromHeadBone = new float[]{ vrmController.LookAt.OffsetFromHead.x , vrmController.LookAt.OffsetFromHead.y , vrmController.LookAt.OffsetFromHead.z , }, - LookAtHorizontalInner = ExportLookAtRangeMap(vrmController.LookAt.HorizontalInner), - LookAtHorizontalOuter = ExportLookAtRangeMap(vrmController.LookAt.HorizontalOuter), - LookAtVerticalDown = ExportLookAtRangeMap(vrmController.LookAt.VerticalDown), - LookAtVerticalUp = ExportLookAtRangeMap(vrmController.LookAt.VerticalUp), + RangeMapHorizontalInner = ExportLookAtRangeMap(vrmController.LookAt.HorizontalInner), + RangeMapHorizontalOuter = ExportLookAtRangeMap(vrmController.LookAt.HorizontalOuter), + RangeMapVerticalDown = ExportLookAtRangeMap(vrmController.LookAt.VerticalDown), + RangeMapVerticalUp = ExportLookAtRangeMap(vrmController.LookAt.VerticalUp), }; } diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 146042dda..0c4d001f4 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -334,12 +334,12 @@ namespace UniVRM10 if (vrm.LookAt != null) { var src = vrm.LookAt; - controller.LookAt.LookAtType = src.LookAtType; + controller.LookAt.LookAtType = src.Type; controller.LookAt.OffsetFromHead = new Vector3(src.OffsetFromHeadBone[0], src.OffsetFromHeadBone[1], src.OffsetFromHeadBone[2]); - controller.LookAt.HorizontalInner = new CurveMapper(src.LookAtHorizontalInner.InputMaxValue.Value, src.LookAtHorizontalInner.OutputScale.Value); - controller.LookAt.HorizontalOuter = new CurveMapper(src.LookAtHorizontalOuter.InputMaxValue.Value, src.LookAtHorizontalOuter.OutputScale.Value); - controller.LookAt.VerticalUp = new CurveMapper(src.LookAtVerticalUp.InputMaxValue.Value, src.LookAtHorizontalOuter.OutputScale.Value); - controller.LookAt.VerticalDown = new CurveMapper(src.LookAtVerticalDown.InputMaxValue.Value, src.LookAtHorizontalOuter.OutputScale.Value); + controller.LookAt.HorizontalInner = new CurveMapper(src.RangeMapHorizontalInner.InputMaxValue.Value, src.RangeMapHorizontalInner.OutputScale.Value); + controller.LookAt.HorizontalOuter = new CurveMapper(src.RangeMapHorizontalOuter.InputMaxValue.Value, src.RangeMapHorizontalOuter.OutputScale.Value); + controller.LookAt.VerticalUp = new CurveMapper(src.RangeMapVerticalUp.InputMaxValue.Value, src.RangeMapVerticalUp.OutputScale.Value); + controller.LookAt.VerticalDown = new CurveMapper(src.RangeMapVerticalDown.InputMaxValue.Value, src.RangeMapVerticalDown.OutputScale.Value); } // firstPerson @@ -351,7 +351,7 @@ namespace UniVRM10 var node = Nodes[x.Node.Value]; controller.FirstPerson.Renderers.Add(new RendererFirstPersonFlags { - FirstPersonFlag = x.FirstPersonType, + FirstPersonFlag = x.Type, Renderer = node.GetComponent() }); } @@ -397,7 +397,7 @@ namespace UniVRM10 } // collider - springBone.ColliderGroups.AddRange(gltfSpring.Colliders.Select(colliderNode => + springBone.ColliderGroups.AddRange(gltfSpring.ColliderGroups.Select(colliderNode => { if (UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(Parser.GLTF.nodes[colliderNode].extensions, out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider extension)) diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs index 0db988232..adecb3871 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmFirstPersonAndLookAt.cs @@ -41,11 +41,11 @@ namespace UniVRM10 // firstPerson に同居していた LookAt は独立します var lookAt = new LookAt { - LookAtHorizontalInner = MigrateLookAtRangeMap(vrm0["lookAtHorizontalInner"]), - LookAtHorizontalOuter = MigrateLookAtRangeMap(vrm0["lookAtHorizontalOuter"]), - LookAtVerticalDown = MigrateLookAtRangeMap(vrm0["lookAtVerticalDown"]), - LookAtVerticalUp = MigrateLookAtRangeMap(vrm0["lookAtVerticalUp"]), - LookAtType = MigrateLookAtType(vrm0["lookAtTypeName"]), + RangeMapHorizontalInner = MigrateLookAtRangeMap(vrm0["lookAtHorizontalInner"]), + RangeMapHorizontalOuter = MigrateLookAtRangeMap(vrm0["lookAtHorizontalOuter"]), + RangeMapVerticalDown = MigrateLookAtRangeMap(vrm0["lookAtVerticalDown"]), + RangeMapVerticalUp = MigrateLookAtRangeMap(vrm0["lookAtVerticalUp"]), + Type = MigrateLookAtType(vrm0["lookAtTypeName"]), OffsetFromHeadBone = MigrateVector3.Migrate(vrm0["firstPersonBoneOffset"]), }; @@ -75,7 +75,7 @@ namespace UniVRM10 var a = new MeshAnnotation { Node = meshIndexToRenderNodeIndex(x["mesh"].GetInt32()), - FirstPersonType = MigrateFirstPersonType(x["firstPersonFlag"]), + Type = MigrateFirstPersonType(x["firstPersonFlag"]), }; firstPerson.MeshAnnotations.Add(a); } diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs index 1a1d3a321..fa7be5a04 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs @@ -123,7 +123,7 @@ namespace UniVRM10 var spring = new UniGLTF.Extensions.VRMC_springBone.Spring { Name = comment, - Colliders = x["colliderGroups"].ArrayItems().Select(z => colliderNodes[z.GetInt32()]).ToArray(), + ColliderGroups = x["colliderGroups"].ArrayItems().Select(z => colliderNodes[z.GetInt32()]).ToArray(), Joints = new List(), }; diff --git a/Assets/VRM10/Tests/MigrationTests.cs b/Assets/VRM10/Tests/MigrationTests.cs index 1fcc93f4f..7b136a2c4 100644 --- a/Assets/VRM10/Tests/MigrationTests.cs +++ b/Assets/VRM10/Tests/MigrationTests.cs @@ -244,7 +244,7 @@ namespace UniVRM10 parser1.Parse(AliciaPath, bytes1); Assert.True(UniGLTF.Extensions.VRMC_springBone.GltfDeserializer.TryGet(parser1.GLTF.extensions, out UniGLTF.Extensions.VRMC_springBone.VRMC_springBone springBone)); var spring = springBone.Springs[0]; - var colliderNodeIndex = spring.Colliders[0]; + var colliderNodeIndex = spring.ColliderGroups[0]; Assert.True(UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(parser1.GLTF.nodes[colliderNodeIndex].extensions, out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider colliderGroup)); // x軸だけが反転する Assert.AreEqual(-VALUE.x, colliderGroup.Shapes[0].Sphere.Offset[0]); From f5a1c1e537e4c02c77c1a3b8676afbfa84f8ffd6 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 13:21:36 +0900 Subject: [PATCH 5/8] remove unused Format/NodeCollider --- Assets/VRM10/Runtime/Format/NodeCollider.meta | 8 - .../Format/NodeCollider/Deserializer.g.cs | 172 ------------------ .../NodeCollider/Deserializer.g.cs.meta | 11 -- .../Runtime/Format/NodeCollider/Format.g.cs | 57 ------ .../Format/NodeCollider/Format.g.cs.meta | 11 -- .../Format/NodeCollider/Serializer.g.cs | 160 ---------------- .../Format/NodeCollider/Serializer.g.cs.meta | 11 -- Assets/VRM10/Runtime/IO/Vrm10Exporter.cs | 24 +-- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 90 ++++----- .../Migration/MigrationVrmSpringBone.cs | 39 ++-- Assets/VRM10/Tests/MigrationTests.cs | 7 +- 11 files changed, 77 insertions(+), 513 deletions(-) delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider.meta delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs.meta delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs.meta delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs delete mode 100644 Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs.meta diff --git a/Assets/VRM10/Runtime/Format/NodeCollider.meta b/Assets/VRM10/Runtime/Format/NodeCollider.meta deleted file mode 100644 index c5aa25fd7..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 57de298702679f949a2f2658ad186d4a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs b/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs deleted file mode 100644 index b97f75bb1..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs +++ /dev/null @@ -1,172 +0,0 @@ -// This file is generated from JsonSchema. Don't modify this source code. -using UniJSON; -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace UniGLTF.Extensions.VRMC_node_collider { - -public static class GltfDeserializer -{ - -public static bool TryGet(UniGLTF.glTFExtension src, out VRMC_node_collider extension) -{ - if(src is UniGLTF.glTFExtensionImport extensions) - { - foreach(var kv in extensions.ObjectItems()) - { - if(kv.Key.GetUtf8String() == VRMC_node_collider.ExtensionNameUtf8) - { - extension = Deserialize(kv.Value); - return true; - } - } - } - - extension = default; - return false; -} - - -public static VRMC_node_collider Deserialize(JsonNode parsed) -{ - var value = new VRMC_node_collider(); - - foreach(var kv in parsed.ObjectItems()) - { - var key = kv.Key.GetString(); - - if(key=="extensions"){ - value.Extensions = new glTFExtensionImport(kv.Value); - continue; - } - - if(key=="extras"){ - value.Extras = new glTFExtensionImport(kv.Value); - continue; - } - - if(key=="shapes"){ - value.Shapes = Deserialize_Shapes(kv.Value); - continue; - } - - } - return value; -} - -public static List Deserialize_Shapes(JsonNode parsed) -{ - var value = new List(); - foreach(var x in parsed.ArrayItems()) - { - value.Add(Deserialize_Shapes_ITEM(x)); - } - return value; -} - -public static ColliderShape Deserialize_Shapes_ITEM(JsonNode parsed) -{ - var value = new ColliderShape(); - - foreach(var kv in parsed.ObjectItems()) - { - var key = kv.Key.GetString(); - - if(key=="extensions"){ - value.Extensions = new glTFExtensionImport(kv.Value); - continue; - } - - if(key=="extras"){ - value.Extras = new glTFExtensionImport(kv.Value); - continue; - } - - if(key=="sphere"){ - value.Sphere = Deserialize_Sphere(kv.Value); - continue; - } - - if(key=="capsule"){ - value.Capsule = Deserialize_Capsule(kv.Value); - continue; - } - - } - return value; -} - -public static ColliderShapeSphere Deserialize_Sphere(JsonNode parsed) -{ - var value = new ColliderShapeSphere(); - - foreach(var kv in parsed.ObjectItems()) - { - var key = kv.Key.GetString(); - - if(key=="offset"){ - value.Offset = Deserialize_Offset(kv.Value); - continue; - } - - if(key=="radius"){ - value.Radius = kv.Value.GetSingle(); - continue; - } - - } - return value; -} - -public static float[] Deserialize_Offset(JsonNode parsed) -{ - var value = new float[parsed.GetArrayCount()]; - int i=0; - foreach(var x in parsed.ArrayItems()) - { - value[i++] = x.GetSingle(); - } - return value; -} - -public static ColliderShapeCapsule Deserialize_Capsule(JsonNode parsed) -{ - var value = new ColliderShapeCapsule(); - - foreach(var kv in parsed.ObjectItems()) - { - var key = kv.Key.GetString(); - - if(key=="offset"){ - value.Offset = Deserialize_Offset(kv.Value); - continue; - } - - if(key=="radius"){ - value.Radius = kv.Value.GetSingle(); - continue; - } - - if(key=="tail"){ - value.Tail = Deserialize_Tail(kv.Value); - continue; - } - - } - return value; -} - -public static float[] Deserialize_Tail(JsonNode parsed) -{ - var value = new float[parsed.GetArrayCount()]; - int i=0; - foreach(var x in parsed.ArrayItems()) - { - value[i++] = x.GetSingle(); - } - return value; -} - -} // GltfDeserializer -} // UniGLTF diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs.meta b/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs.meta deleted file mode 100644 index 8d5235f1b..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Deserializer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 162032f06e7a71549bb767d4aad3d221 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs b/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs deleted file mode 100644 index 1f33f6cd6..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs +++ /dev/null @@ -1,57 +0,0 @@ -// This file is generated from JsonSchema. Don't modify this source code. -using System; -using System.Collections.Generic; -using UniGLTF; -using UniJSON; - -namespace UniGLTF.Extensions.VRMC_node_collider -{ - - public class ColliderShapeSphere - { - // The sphere center. vector3 - public float[] Offset; - - // The sphere radius - public float? Radius; - } - - public class ColliderShapeCapsule - { - // The capsule head. vector3 - public float[] Offset; - - // The capsule radius - public float? Radius; - - // The capsule tail. vector3 - public float[] Tail; - } - - public class ColliderShape - { - // Dictionary object with extension-specific objects. - public glTFExtension Extensions; - - // Application-specific data. - public glTFExtension Extras; - - public ColliderShapeSphere Sphere; - - public ColliderShapeCapsule Capsule; - } - - public class VRMC_node_collider - { - public const string ExtensionName = "VRMC_node_collider"; - public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(ExtensionName); - - // Dictionary object with extension-specific objects. - public glTFExtension Extensions; - - // Application-specific data. - public glTFExtension Extras; - - public List Shapes; - } -} diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs.meta b/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs.meta deleted file mode 100644 index 065d2245e..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Format.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b1f73d7cedc49cb4d9513f7a0a9ae9b6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs b/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs deleted file mode 100644 index 5fc75ed36..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs +++ /dev/null @@ -1,160 +0,0 @@ -// This file is generated from JsonSchema. Don't modify this source code. -using System; -using System.Collections.Generic; -using System.Linq; -using UniJSON; - -namespace UniGLTF.Extensions.VRMC_node_collider { - - static public class GltfSerializer - { - - public static void SerializeTo(ref UniGLTF.glTFExtension dst, VRMC_node_collider extension) - { - if (dst is glTFExtensionImport) - { - throw new NotImplementedException(); - } - - if (!(dst is glTFExtensionExport extensions)) - { - extensions = new glTFExtensionExport(); - dst = extensions; - } - - var f = new JsonFormatter(); - Serialize(f, extension); - extensions.Add(VRMC_node_collider.ExtensionName, f.GetStoreBytes()); - } - - -public static void Serialize(JsonFormatter f, VRMC_node_collider value) -{ - f.BeginMap(); - - - if(value.Extensions!=null){ - f.Key("extensions"); - value.Extensions.Serialize(f); - } - - if(value.Extras!=null){ - f.Key("extras"); - value.Extras.Serialize(f); - } - - if(value.Shapes!=null&&value.Shapes.Count()>=0){ - f.Key("shapes"); - Serialize_Shapes(f, value.Shapes); - } - - f.EndMap(); -} - -public static void Serialize_Shapes(JsonFormatter f, List value) -{ - f.BeginList(); - - foreach(var item in value) - { - Serialize_Shapes_ITEM(f, item); - - } - f.EndList(); -} - -public static void Serialize_Shapes_ITEM(JsonFormatter f, ColliderShape value) -{ - f.BeginMap(); - - - if(value.Extensions!=null){ - f.Key("extensions"); - value.Extensions.Serialize(f); - } - - if(value.Extras!=null){ - f.Key("extras"); - value.Extras.Serialize(f); - } - - if(value.Sphere!=null){ - f.Key("sphere"); - Serialize_Sphere(f, value.Sphere); - } - - if(value.Capsule!=null){ - f.Key("capsule"); - Serialize_Capsule(f, value.Capsule); - } - - f.EndMap(); -} - -public static void Serialize_Sphere(JsonFormatter f, ColliderShapeSphere value) -{ - f.BeginMap(); - - - if(value.Offset!=null&&value.Offset.Count()>=3){ - f.Key("offset"); - Serialize_Offset(f, value.Offset); - } - - if(value.Radius.HasValue){ - f.Key("radius"); - f.Value(value.Radius.GetValueOrDefault()); - } - - f.EndMap(); -} - -public static void Serialize_Offset(JsonFormatter f, float[] value) -{ - f.BeginList(); - - foreach(var item in value) - { - f.Value(item); - - } - f.EndList(); -} - -public static void Serialize_Capsule(JsonFormatter f, ColliderShapeCapsule value) -{ - f.BeginMap(); - - - if(value.Offset!=null&&value.Offset.Count()>=3){ - f.Key("offset"); - Serialize_Offset(f, value.Offset); - } - - if(value.Radius.HasValue){ - f.Key("radius"); - f.Value(value.Radius.GetValueOrDefault()); - } - - if(value.Tail!=null&&value.Tail.Count()>=3){ - f.Key("tail"); - Serialize_Tail(f, value.Tail); - } - - f.EndMap(); -} - -public static void Serialize_Tail(JsonFormatter f, float[] value) -{ - f.BeginList(); - - foreach(var item in value) - { - f.Value(item); - - } - f.EndList(); -} - - } // class -} // namespace diff --git a/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs.meta b/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs.meta deleted file mode 100644 index 2d2f3390b..000000000 --- a/Assets/VRM10/Runtime/Format/NodeCollider/Serializer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 8eb6c9672b71ea147867c73cb8d58a35 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index bb20f8477..f87d172c9 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -24,7 +24,6 @@ namespace UniVRM10 Storage.Gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_vrm.VRMC_vrm.ExtensionName); Storage.Gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_materials_mtoon.VRMC_materials_mtoon.ExtensionName); Storage.Gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_springBone.VRMC_springBone.ExtensionName); - Storage.Gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider.ExtensionName); Storage.Gltf.extensionsUsed.Add(UniGLTF.Extensions.VRMC_node_constraint.VRMC_node_constraint.ExtensionName); Storage.Gltf.buffers.Add(new glTFBuffer { @@ -264,14 +263,14 @@ namespace UniVRM10 return (vrm, vrmSpringBone, thumbnailTextureIndex); } - UniGLTF.Extensions.VRMC_node_collider.ColliderShape ExportShape(VRM10SpringBoneCollider z) + UniGLTF.Extensions.VRMC_springBone.ColliderShape ExportShape(VRM10SpringBoneCollider z) { - var shape = new UniGLTF.Extensions.VRMC_node_collider.ColliderShape(); + var shape = new UniGLTF.Extensions.VRMC_springBone.ColliderShape(); switch (z.ColliderType) { case VRM10SpringBoneColliderTypes.Sphere: { - shape.Sphere = new UniGLTF.Extensions.VRMC_node_collider.ColliderShapeSphere + shape.Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere { Radius = z.Radius, Offset = ReverseX(z.Offset), @@ -281,7 +280,7 @@ namespace UniVRM10 case VRM10SpringBoneColliderTypes.Capsule: { - shape.Capsule = new UniGLTF.Extensions.VRMC_node_collider.ColliderShapeCapsule + shape.Capsule = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeCapsule { Radius = z.Radius, Offset = new float[] { z.Offset.x, z.Offset.y, z.Offset.z }, @@ -311,6 +310,7 @@ namespace UniVRM10 { var springBone = new UniGLTF.Extensions.VRMC_springBone.VRMC_springBone { + ColliderGroups = new List(), Springs = new List(), }; @@ -338,14 +338,14 @@ namespace UniVRM10 colliders.Add(nodeIndex); var gltfNode = Storage.Gltf.nodes[nodeIndex]; - // VRMC_node_collider - var collider = new UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider - { - Shapes = y.Colliders.Select(ExportShape).ToList(), - }; + // // VRMC_node_collider + // var collider = new UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider + // { + // Shapes = y.Colliders.Select(ExportShape).ToList(), + // }; - // serialize - UniGLTF.Extensions.VRMC_node_collider.GltfSerializer.SerializeTo(ref gltfNode.extensions, collider); + // // serialize + // UniGLTF.Extensions.VRMC_node_collider.GltfSerializer.SerializeTo(ref gltfNode.extensions, collider); } spring.ColliderGroups = colliders.ToArray(); } diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 0c4d001f4..03c6b5e1d 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -396,51 +396,51 @@ namespace UniVRM10 } } - // collider - springBone.ColliderGroups.AddRange(gltfSpring.ColliderGroups.Select(colliderNode => - { - if (UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(Parser.GLTF.nodes[colliderNode].extensions, - out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider extension)) - { - var node = Nodes[colliderNode]; - var colliderGroup = node.gameObject.GetComponent(); - if (colliderGroup == null) - { - colliderGroup = node.gameObject.AddComponent(); - colliderGroup.Colliders.AddRange(extension.Shapes.Select(x => - { - if (x.Sphere != null) - { - return new VRM10SpringBoneCollider - { - ColliderType = VRM10SpringBoneColliderTypes.Sphere, - Offset = Vector3InvertX(x.Sphere.Offset), - Radius = x.Sphere.Radius.Value, - }; - } - else if (x.Capsule != null) - { - return new VRM10SpringBoneCollider - { - ColliderType = VRM10SpringBoneColliderTypes.Capsule, - Offset = Vector3InvertX(x.Capsule.Offset), - Radius = x.Capsule.Radius.Value, - Tail = Vector3InvertX(x.Capsule.Tail), - }; - } - else - { - throw new NotImplementedException(); - } - })); - } - return colliderGroup; - } - else - { - return null; - } - }).Where(x => x != null)); + // // collider + // springBone.ColliderGroups.AddRange(gltfSpring.ColliderGroups.Select(colliderNode => + // { + // if (UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(Parser.GLTF.nodes[colliderNode].extensions, + // out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider extension)) + // { + // var node = Nodes[colliderNode]; + // var colliderGroup = node.gameObject.GetComponent(); + // if (colliderGroup == null) + // { + // colliderGroup = node.gameObject.AddComponent(); + // colliderGroup.Colliders.AddRange(extension.Shapes.Select(x => + // { + // if (x.Sphere != null) + // { + // return new VRM10SpringBoneCollider + // { + // ColliderType = VRM10SpringBoneColliderTypes.Sphere, + // Offset = Vector3InvertX(x.Sphere.Offset), + // Radius = x.Sphere.Radius.Value, + // }; + // } + // else if (x.Capsule != null) + // { + // return new VRM10SpringBoneCollider + // { + // ColliderType = VRM10SpringBoneColliderTypes.Capsule, + // Offset = Vector3InvertX(x.Capsule.Offset), + // Radius = x.Capsule.Radius.Value, + // Tail = Vector3InvertX(x.Capsule.Tail), + // }; + // } + // else + // { + // throw new NotImplementedException(); + // } + // })); + // } + // return colliderGroup; + // } + // else + // { + // return null; + // } + // }).Where(x => x != null)); } } } diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs index fa7be5a04..10b91d1a6 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs @@ -23,16 +23,22 @@ namespace UniVRM10 { var colliderNodes = new List(); + var springBone = new UniGLTF.Extensions.VRMC_springBone.VRMC_springBone + { + ColliderGroups = new List(), + Springs = new List(), + }; + foreach (var x in sa["colliderGroups"].ArrayItems()) { var node = x["node"].GetInt32(); colliderNodes.Add(node); - var gltfNode = gltf.nodes[node]; - var collider = new UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider() + var colliderGroup = new UniGLTF.Extensions.VRMC_springBone.ColliderGroup() { - Shapes = new List(), + Colliders = new List(), }; + springBone.ColliderGroups.Add(colliderGroup); // { // "node": 14, @@ -65,31 +71,20 @@ namespace UniVRM10 // }, foreach (var y in x["colliders"].ArrayItems()) { - collider.Shapes.Add(new UniGLTF.Extensions.VRMC_node_collider.ColliderShape + colliderGroup.Colliders.Add(new UniGLTF.Extensions.VRMC_springBone.Collider { - Sphere = new UniGLTF.Extensions.VRMC_node_collider.ColliderShapeSphere + Shape = new UniGLTF.Extensions.VRMC_springBone.ColliderShape { - Offset = MigrateVector3.Migrate(y["offset"]), - Radius = y["radius"].GetSingle() + Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere + { + Offset = MigrateVector3.Migrate(y["offset"]), + Radius = y["radius"].GetSingle() + } } }); } - - if (!(gltfNode.extensions is UniGLTF.glTFExtensionExport extensions)) - { - extensions = new UniGLTF.glTFExtensionExport(); - gltfNode.extensions = extensions; - } - - var f = new JsonFormatter(); - UniGLTF.Extensions.VRMC_node_collider.GltfSerializer.Serialize(f, collider); - extensions.Add(UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider.ExtensionName, f.GetStoreBytes()); } - var springBone = new UniGLTF.Extensions.VRMC_springBone.VRMC_springBone - { - Springs = new List(), - }; foreach (var x in sa["boneGroups"].ArrayItems()) { // { @@ -123,7 +118,7 @@ namespace UniVRM10 var spring = new UniGLTF.Extensions.VRMC_springBone.Spring { Name = comment, - ColliderGroups = x["colliderGroups"].ArrayItems().Select(z => colliderNodes[z.GetInt32()]).ToArray(), + ColliderGroups = x["colliderGroups"].ArrayItems().Select(z => z.GetInt32()).ToArray(), Joints = new List(), }; diff --git a/Assets/VRM10/Tests/MigrationTests.cs b/Assets/VRM10/Tests/MigrationTests.cs index 7b136a2c4..f85879212 100644 --- a/Assets/VRM10/Tests/MigrationTests.cs +++ b/Assets/VRM10/Tests/MigrationTests.cs @@ -245,11 +245,10 @@ namespace UniVRM10 Assert.True(UniGLTF.Extensions.VRMC_springBone.GltfDeserializer.TryGet(parser1.GLTF.extensions, out UniGLTF.Extensions.VRMC_springBone.VRMC_springBone springBone)); var spring = springBone.Springs[0]; var colliderNodeIndex = spring.ColliderGroups[0]; - Assert.True(UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(parser1.GLTF.nodes[colliderNodeIndex].extensions, out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider colliderGroup)); // x軸だけが反転する - Assert.AreEqual(-VALUE.x, colliderGroup.Shapes[0].Sphere.Offset[0]); - Assert.AreEqual(VALUE.y, colliderGroup.Shapes[0].Sphere.Offset[1]); - Assert.AreEqual(VALUE.z, colliderGroup.Shapes[0].Sphere.Offset[2]); + Assert.AreEqual(-VALUE.x, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[0]); + Assert.AreEqual(VALUE.y, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[1]); + Assert.AreEqual(VALUE.z, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[2]); } } } From a507266df499bcce243e20ec250cd627816b8470 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 13:30:23 +0900 Subject: [PATCH 6/8] VRM10SpringBoneCollider is MonoBehaviour --- .../SpringBone/VRM10SpringBoneCollider.cs | 71 +++++++++++++++++- .../VRM10SpringBoneColliderGroup.cs | 75 ------------------- 2 files changed, 70 insertions(+), 76 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneCollider.cs b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneCollider.cs index 1f5fe5357..8b8baa86b 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneCollider.cs +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneCollider.cs @@ -10,7 +10,7 @@ namespace UniVRM10 } [Serializable] - public class VRM10SpringBoneCollider + public class VRM10SpringBoneCollider : MonoBehaviour { public VRM10SpringBoneColliderTypes ColliderType; @@ -22,5 +22,74 @@ namespace UniVRM10 /// bone local position public Vector3 Tail; + + public static void DrawWireCapsule(Vector3 headPos, Vector3 tailPos, float radius) + { + var headToTail = tailPos - headPos; + if (headToTail.sqrMagnitude <= float.Epsilon) + { + Gizmos.DrawWireSphere(headPos, radius); + return; + } + + var forward = headToTail.normalized * radius; + + var xLen = Mathf.Abs(forward.x); + var yLen = Mathf.Abs(forward.y); + var zLen = Mathf.Abs(forward.z); + var rightWorldAxis = (yLen > xLen && yLen > zLen) ? Vector3.right : Vector3.up; + + var up = Vector3.Cross(forward, rightWorldAxis).normalized * radius; + var right = Vector3.Cross(up, forward).normalized * radius; + + const int division = 24; + DrawWireCircle(headPos, up, right, division, division); + DrawWireCircle(headPos, up, -forward, division, division / 2); + DrawWireCircle(headPos, right, -forward, division, division / 2); + + DrawWireCircle(tailPos, up, right, division, division); + DrawWireCircle(tailPos, up, forward, division, division / 2); + DrawWireCircle(tailPos, right, forward, division, division / 2); + + Gizmos.DrawLine(headPos + right, tailPos + right); + Gizmos.DrawLine(headPos - right, tailPos - right); + Gizmos.DrawLine(headPos + up, tailPos + up); + Gizmos.DrawLine(headPos - up, tailPos - up); + } + + private static void DrawWireCircle(Vector3 centerPos, Vector3 xAxis, Vector3 yAxis, int division, int count) + { + for (var idx = 0; idx < division && idx < count; ++idx) + { + var s = ((idx + 0) % division) / (float)division * Mathf.PI * 2f; + var t = ((idx + 1) % division) / (float)division * Mathf.PI * 2f; + + Gizmos.DrawLine( + centerPos + xAxis * Mathf.Cos(s) + yAxis * Mathf.Sin(s), + centerPos + xAxis * Mathf.Cos(t) + yAxis * Mathf.Sin(t) + ); + } + } + + public void OnDrawGizmosSelected() + { + Gizmos.color = Color.cyan; + Matrix4x4 mat = transform.localToWorldMatrix; + Gizmos.matrix = mat * Matrix4x4.Scale(new Vector3( + 1.0f / transform.lossyScale.x, + 1.0f / transform.lossyScale.y, + 1.0f / transform.lossyScale.z + )); + switch (ColliderType) + { + case VRM10SpringBoneColliderTypes.Sphere: + Gizmos.DrawWireSphere(Offset, Radius); + break; + + case VRM10SpringBoneColliderTypes.Capsule: + DrawWireCapsule(Offset, Tail, Radius); + break; + } + } } } diff --git a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneColliderGroup.cs b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneColliderGroup.cs index 221f896d5..fece4413f 100644 --- a/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneColliderGroup.cs +++ b/Assets/VRM10/Runtime/Components/SpringBone/VRM10SpringBoneColliderGroup.cs @@ -10,82 +10,7 @@ namespace UniVRM10 [AddComponentMenu("VRM10/VRM10SpringBoneColliderGroup")] public class VRM10SpringBoneColliderGroup : MonoBehaviour { - [SerializeField] - Color m_gizmoColor = Color.cyan; - [SerializeField] public List Colliders = new List(); - - public static void DrawWireCapsule(Vector3 headPos, Vector3 tailPos, float radius) - { - var headToTail = tailPos - headPos; - if (headToTail.sqrMagnitude <= float.Epsilon) - { - Gizmos.DrawWireSphere(headPos, radius); - return; - } - - var forward = headToTail.normalized * radius; - - var xLen = Mathf.Abs(forward.x); - var yLen = Mathf.Abs(forward.y); - var zLen = Mathf.Abs(forward.z); - var rightWorldAxis = (yLen > xLen && yLen > zLen) ? Vector3.right : Vector3.up; - - var up = Vector3.Cross(forward, rightWorldAxis).normalized * radius; - var right = Vector3.Cross(up, forward).normalized * radius; - - const int division = 24; - DrawWireCircle(headPos, up, right, division, division); - DrawWireCircle(headPos, up, -forward, division, division / 2); - DrawWireCircle(headPos, right, -forward, division, division / 2); - - DrawWireCircle(tailPos, up, right, division, division); - DrawWireCircle(tailPos, up, forward, division, division / 2); - DrawWireCircle(tailPos, right, forward, division, division / 2); - - Gizmos.DrawLine(headPos + right, tailPos + right); - Gizmos.DrawLine(headPos - right, tailPos - right); - Gizmos.DrawLine(headPos + up, tailPos + up); - Gizmos.DrawLine(headPos - up, tailPos - up); - } - - private static void DrawWireCircle(Vector3 centerPos, Vector3 xAxis, Vector3 yAxis, int division, int count) - { - for (var idx = 0; idx < division && idx < count; ++idx) - { - var s = ((idx + 0) % division) / (float)division * Mathf.PI * 2f; - var t = ((idx + 1) % division) / (float)division * Mathf.PI * 2f; - - Gizmos.DrawLine( - centerPos + xAxis * Mathf.Cos(s) + yAxis * Mathf.Sin(s), - centerPos + xAxis * Mathf.Cos(t) + yAxis * Mathf.Sin(t) - ); - } - } - - public void OnDrawGizmosSelected() - { - Gizmos.color = m_gizmoColor; - Matrix4x4 mat = transform.localToWorldMatrix; - Gizmos.matrix = mat * Matrix4x4.Scale(new Vector3( - 1.0f / transform.lossyScale.x, - 1.0f / transform.lossyScale.y, - 1.0f / transform.lossyScale.z - )); - foreach (var y in Colliders) - { - switch (y.ColliderType) - { - case VRM10SpringBoneColliderTypes.Sphere: - Gizmos.DrawWireSphere(y.Offset, y.Radius); - break; - - case VRM10SpringBoneColliderTypes.Capsule: - DrawWireCapsule(y.Offset, y.Tail, y.Radius); - break; - } - } - } } } From c4dd9e0404cec1d60796857b007e82c05b2ace6e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 13:34:44 +0900 Subject: [PATCH 7/8] fix MigrationTests --- Assets/VRM10/Tests/MigrationTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/VRM10/Tests/MigrationTests.cs b/Assets/VRM10/Tests/MigrationTests.cs index f85879212..e60a69d51 100644 --- a/Assets/VRM10/Tests/MigrationTests.cs +++ b/Assets/VRM10/Tests/MigrationTests.cs @@ -246,9 +246,9 @@ namespace UniVRM10 var spring = springBone.Springs[0]; var colliderNodeIndex = spring.ColliderGroups[0]; // x軸だけが反転する - Assert.AreEqual(-VALUE.x, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[0]); - Assert.AreEqual(VALUE.y, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[1]); - Assert.AreEqual(VALUE.z, springBone.ColliderGroups[0].Colliders[0].Shape.Sphere.Offset[2]); + Assert.AreEqual(-VALUE.x, springBone.ColliderGroups[colliderIndex].Colliders[0].Shape.Sphere.Offset[0]); + Assert.AreEqual(VALUE.y, springBone.ColliderGroups[colliderIndex].Colliders[0].Shape.Sphere.Offset[1]); + Assert.AreEqual(VALUE.z, springBone.ColliderGroups[colliderIndex].Colliders[0].Shape.Sphere.Offset[2]); } } } From 9274c84c01914da25996ae91bd0e1224fd36dfb4 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Fri, 30 Apr 2021 14:08:36 +0900 Subject: [PATCH 8/8] =?UTF-8?q?collider=20group=20=E3=81=AE=E4=BB=95?= =?UTF-8?q?=E6=A7=98=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/Runtime/IO/Vrm10Exporter.cs | 48 +++++----- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 88 +++++++++---------- .../Migration/MigrationVrmSpringBone.cs | 1 + 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index f87d172c9..042e72e5a 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -314,40 +314,44 @@ namespace UniVRM10 Springs = new List(), }; - Func getIndexFromTransform = t => + Func getNodeIndexFromTransform = t => { var node = converter.Nodes[t.gameObject]; return model.Nodes.IndexOf(node); }; + var colliderGroups = vrmController.GetComponentsInChildren(); + foreach (var x in colliderGroups) + { + var colliderGroup = new UniGLTF.Extensions.VRMC_springBone.ColliderGroup + { + Colliders = new List(), + }; + springBone.ColliderGroups.Add(colliderGroup); + + foreach (var y in x.Colliders) + { + if (y == null) + { + continue; + } + colliderGroup.Colliders.Add(new UniGLTF.Extensions.VRMC_springBone.Collider + { + Node = getNodeIndexFromTransform(y.transform), + Shape = ExportShape(y), + }); + } + } + foreach (var x in vrmController.GetComponentsInChildren()) { var spring = new UniGLTF.Extensions.VRMC_springBone.Spring { Name = x.Comment, - Joints = x.Joints.Select(y => ExportJoint(y, getIndexFromTransform)).ToList(), + Joints = x.Joints.Select(y => ExportJoint(y, getNodeIndexFromTransform)).ToList(), + ColliderGroups = x.ColliderGroups.Select(y => Array.IndexOf(colliderGroups, y)).ToArray(), }; springBone.Springs.Add(spring); - - List colliders = new List(); - foreach (var y in x.ColliderGroups) - { - // node - var node = converter.Nodes[y.gameObject]; - var nodeIndex = model.Nodes.IndexOf(node); - colliders.Add(nodeIndex); - var gltfNode = Storage.Gltf.nodes[nodeIndex]; - - // // VRMC_node_collider - // var collider = new UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider - // { - // Shapes = y.Colliders.Select(ExportShape).ToList(), - // }; - - // // serialize - // UniGLTF.Extensions.VRMC_node_collider.GltfSerializer.SerializeTo(ref gltfNode.extensions, collider); - } - spring.ColliderGroups = colliders.ToArray(); } return springBone; diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index 03c6b5e1d..1a8d52ba9 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -365,6 +365,47 @@ namespace UniVRM10 // springs if (gltfVrmSpringBone.Springs != null) { + var secondary = Root.transform.Find("secondary"); + if (secondary == null) + { + secondary = new GameObject("secondary").transform; + secondary.SetParent(Root.transform, false); + } + + // colliderGroup + var list = new List(); + foreach (var g in gltfVrmSpringBone.ColliderGroups) + { + var colliderGroup = secondary.gameObject.AddComponent(); + list.Add(colliderGroup); + + foreach (var c in g.Colliders) + { + var node = Nodes[c.Node.Value]; + + var collider = node.gameObject.AddComponent(); + colliderGroup.Colliders.Add(collider); + + if (c.Shape.Sphere is UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere sphere) + { + collider.ColliderType = VRM10SpringBoneColliderTypes.Sphere; + collider.Radius = sphere.Radius.Value; + collider.Offset = Vector3InvertX(sphere.Offset); + } + else if (c.Shape.Capsule is UniGLTF.Extensions.VRMC_springBone.ColliderShapeCapsule capsule) + { + collider.ColliderType = VRM10SpringBoneColliderTypes.Capsule; + collider.Radius = capsule.Radius.Value; + collider.Offset = Vector3InvertX(capsule.Offset); + collider.Tail = Vector3InvertX(capsule.Tail); + } + else + { + throw new NotImplementedException(); + } + } + } + foreach (var gltfSpring in gltfVrmSpringBone.Springs) { if (gltfSpring.Joints == null || gltfSpring.Joints.Count == 0) @@ -374,6 +415,7 @@ namespace UniVRM10 var firstJointNode = Nodes[gltfSpring.Joints.First().Node.Value]; var springBone = firstJointNode.gameObject.AddComponent(); springBone.Comment = gltfSpring.Name; + springBone.ColliderGroups = gltfSpring.ColliderGroups.Select(x => list[x]).ToList(); // joint foreach (var gltfJoint in gltfSpring.Joints) @@ -395,52 +437,6 @@ namespace UniVRM10 springBone.Joints.Add(joint); } } - - // // collider - // springBone.ColliderGroups.AddRange(gltfSpring.ColliderGroups.Select(colliderNode => - // { - // if (UniGLTF.Extensions.VRMC_node_collider.GltfDeserializer.TryGet(Parser.GLTF.nodes[colliderNode].extensions, - // out UniGLTF.Extensions.VRMC_node_collider.VRMC_node_collider extension)) - // { - // var node = Nodes[colliderNode]; - // var colliderGroup = node.gameObject.GetComponent(); - // if (colliderGroup == null) - // { - // colliderGroup = node.gameObject.AddComponent(); - // colliderGroup.Colliders.AddRange(extension.Shapes.Select(x => - // { - // if (x.Sphere != null) - // { - // return new VRM10SpringBoneCollider - // { - // ColliderType = VRM10SpringBoneColliderTypes.Sphere, - // Offset = Vector3InvertX(x.Sphere.Offset), - // Radius = x.Sphere.Radius.Value, - // }; - // } - // else if (x.Capsule != null) - // { - // return new VRM10SpringBoneCollider - // { - // ColliderType = VRM10SpringBoneColliderTypes.Capsule, - // Offset = Vector3InvertX(x.Capsule.Offset), - // Radius = x.Capsule.Radius.Value, - // Tail = Vector3InvertX(x.Capsule.Tail), - // }; - // } - // else - // { - // throw new NotImplementedException(); - // } - // })); - // } - // return colliderGroup; - // } - // else - // { - // return null; - // } - // }).Where(x => x != null)); } } } diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs index 10b91d1a6..bb8deeb59 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmSpringBone.cs @@ -73,6 +73,7 @@ namespace UniVRM10 { colliderGroup.Colliders.Add(new UniGLTF.Extensions.VRMC_springBone.Collider { + Node = x["node"].GetInt32(), Shape = new UniGLTF.Extensions.VRMC_springBone.ColliderShape { Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere