diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/GltfSerializer.g.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/GltfSerializer.g.cs index c695f91f8..943a14d19 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/GltfSerializer.g.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Format/GltfSerializer.g.cs @@ -1127,12 +1127,12 @@ public static void Serialize_gltf_nodes_ITEM(JsonFormatter f, glTFNode value) Serialize_gltf_nodes__translation(f, value.translation); } - if(value.rotation!=null&&value.rotation.Length>=4){ + if(value.rotation!=null&&value.rotation.Length>=4&&!value.rotation.SequenceEqual(new float[]{0, 0, 0, 1})){ f.Key("rotation"); Serialize_gltf_nodes__rotation(f, value.rotation); } - if(value.scale!=null&&value.scale.Length>=3){ + if(value.scale!=null&&value.scale.Length>=3&&!value.scale.SequenceEqual(new float[]{1, 1, 1})){ f.Key("scale"); Serialize_gltf_nodes__scale(f, value.scale); } diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFNode.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFNode.cs index 9d5bec958..a46d9208b 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFNode.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Format/glTFNode.cs @@ -20,11 +20,11 @@ namespace UniGLTF [JsonSchema(MinItems = 3, MaxItems = 3, SerializationConditions = new string[] { "!value.translation.SequenceEqual(new float[]{0, 0, 0})" })] public float[] translation; - [JsonSchema(MinItems = 4, MaxItems = 4)] + [JsonSchema(MinItems = 4, MaxItems = 4, SerializationConditions = new string[] { "!value.rotation.SequenceEqual(new float[]{0, 0, 0, 1})" })] [ItemJsonSchema(Minimum = -1.0, Maximum = 1.0)] public float[] rotation; - [JsonSchema(MinItems = 3, MaxItems = 3)] + [JsonSchema(MinItems = 3, MaxItems = 3, SerializationConditions = new string[] { "!value.scale.SequenceEqual(new float[]{1, 1, 1})" })] public float[] scale; [JsonSchema(Minimum = 0, ExplicitIgnorableValue = -1)]