remove byteStride

#461
This commit is contained in:
ousttrue
2020-09-24 15:47:34 +09:00
parent 361954aa9d
commit 3bdc932f0d
2 changed files with 15 additions and 13 deletions

View File

@@ -44,13 +44,13 @@ namespace UniGLTF
Stream m_s;
StreamWriter m_w;
static Dictionary<string, string> s_snipets = new Dictionary<string, string>
static Dictionary<string, string> s_snippets = new Dictionary<string, string>
{
{"gltf/animations", "if(value.animations!=null && value.animations.Count>0)" },
{"gltf/cameras", "if(value.cameras!=null && value.cameras.Count>0)" },
{"gltf/buffers", "if(value.buffers!=null && value.buffers.Count>0)" },
{"gltf/bufferViews", "if(value.bufferViews!=null && value.bufferViews.Count>0)" },
{"gltf/bufferViews[]/byteStride", "if(false)" },
{"gltf/bufferViews[]/byteStride", "" },
{"gltf/bufferViews[]/target", "if(value.target!=0)" },
{"gltf/animations[]/channels", "if(value.channels!=null && value.channels.Count>0)" },
{"gltf/animations[]/channels[]/target", "if(value!=null)" },
@@ -276,7 +276,7 @@ namespace UniGLTF {
{
}
else if(fi.FieldType == typeof(glTF_KHR_materials_unlit))
else if (fi.FieldType == typeof(glTF_KHR_materials_unlit))
{
}
@@ -287,20 +287,27 @@ namespace UniGLTF {
var snipet = fi.FieldType.IsClass ? "if(value." + fi.Name + "!=null)" : "";
var value = default(string);
if (s_snipets.TryGetValue(path + "/" + fi.Name, out value))
if (s_snippets.TryGetValue(path + "/" + fi.Name, out value))
{
snipet = value;
}
m_w.Write(@"
if (value == "")
{
// found, but empty
}
else
{
m_w.Write(@"
$1
{
f.Key(""$0""); f.GenSerialize(value.$0);
}
"
.Replace("$0", fi.Name)
.Replace("$1", snipet)
);
.Replace("$0", fi.Name)
.Replace("$1", snipet)
);
}
}
m_w.Write(@"

View File

@@ -212,11 +212,6 @@ namespace UniGLTF {
f.Key("byteLength"); f.GenSerialize(value.byteLength);
}
if(false)
{
f.Key("byteStride"); f.GenSerialize(value.byteStride);
}
if(value.target!=0)
{
f.Key("target"); f.GenSerialize(value.target);