1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Fix converting constants from yaml to bfres fshu

This commit is contained in:
KillzXGaming 2020-03-10 19:36:42 -04:00
parent 186ec89b50
commit ea05ffda60
2 changed files with 27 additions and 1 deletions

View File

@ -113,6 +113,7 @@ namespace FirstPlugin
paramInfoU.FloatCurveCount = paramInfoNX.FloatCurveCount;
paramInfoU.IntCurveCount = paramInfoNX.IntCurveCount;
paramInfoU.SubBindIndex = paramInfoNX.SubBindIndex;
paramInfoU.ConstantCount = paramInfoNX.ConstantCount;
matAnimData.ParamAnimInfos.Add(paramInfoU);
}
}

View File

@ -8,7 +8,7 @@ using AampLibraryCSharp.IO;
using SharpYaml.Serialization;
using System.Globalization;
using Syroot.BinaryData;
using System.Collections.Generic;
using ByamlExt.Byaml;
namespace FirstPlugin
{
@ -213,6 +213,17 @@ namespace FirstPlugin
yamlNode.Add(item.Key, SaveNode(item.Key, item.Value));
return yamlNode;
}
else if (node is ByamlPathPoint)
{
return ConvertPathPoint((ByamlPathPoint)node);
}
else if (node is List<ByamlPathPoint>)
{
var yamlNode = new YamlSequenceNode();
foreach (var pt in (List<ByamlPathPoint>)node)
yamlNode.Add(ConvertPathPoint(pt));
return yamlNode;
}
else
{
string tag = null;
@ -227,6 +238,20 @@ namespace FirstPlugin
}
}
private static YamlMappingNode ConvertPathPoint(ByamlPathPoint point)
{
YamlMappingNode node = new YamlMappingNode();
node.Style = SharpYaml.YamlStyle.Flow;
node.Add("X", point.Position.X.ToString());
node.Add("Y", point.Position.Y.ToString());
node.Add("Z", point.Position.Z.ToString());
node.Add("NX", point.Normal.X.ToString());
node.Add("NY", point.Normal.Y.ToString());
node.Add("NZ", point.Normal.Z.ToString());
node.Add("Value", point.Unknown.ToString());
return node;
}
private static bool IsReferenceNode(dynamic node)
{
return false;