mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 13:59:21 -05:00
skip T if [0, 0, 0]
This commit is contained in:
@@ -16,6 +16,7 @@ namespace UniGLTF
|
||||
const string Begin = @"using System;
|
||||
using System.Collections.Generic;
|
||||
using UniJSON;
|
||||
using System.Linq;
|
||||
|
||||
namespace UniGLTF {
|
||||
|
||||
@@ -34,7 +35,7 @@ namespace UniGLTF {
|
||||
get
|
||||
{
|
||||
return Path.Combine(UnityEngine.Application.dataPath,
|
||||
"UniGLTF/UniGLTF/Scripts/IO/GltfSerializer.g.cs");
|
||||
"UniGLTF/Runtime/UniGLTF/Format/GltfSerializer.g.cs");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UniJSON;
|
||||
using System.Linq;
|
||||
|
||||
namespace UniGLTF {
|
||||
|
||||
@@ -1121,7 +1122,7 @@ public static void Serialize_gltf_nodes_ITEM(JsonFormatter f, glTFNode value)
|
||||
Serialize_gltf_nodes__matrix(f, value.matrix);
|
||||
}
|
||||
|
||||
if(value.translation!=null&&value.translation.Length>=3){
|
||||
if(value.translation!=null&&value.translation.Length>=3&&!value.translation.SequenceEqual(new float[]{0, 0, 0})){
|
||||
f.Key("translation");
|
||||
Serialize_gltf_nodes__translation(f, value.translation);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace UniGLTF
|
||||
[JsonSchema(MinItems = 16, MaxItems = 16)]
|
||||
public float[] matrix;
|
||||
|
||||
[JsonSchema(MinItems = 3, MaxItems = 3)]
|
||||
[JsonSchema(MinItems = 3, MaxItems = 3, SerializationConditions = new string[] { "!value.translation.SequenceEqual(new float[]{0, 0, 0})" })]
|
||||
public float[] translation;
|
||||
|
||||
[JsonSchema(MinItems = 4, MaxItems = 4)]
|
||||
|
||||
Reference in New Issue
Block a user