Skip R, S

This commit is contained in:
ousttrue
2021-06-22 14:13:07 +09:00
parent 20d068e16f
commit c8e245c172
2 changed files with 4 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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)]