mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-27 21:34:38 -05:00
@@ -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(@"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user