1
0
mirror of synced 2024-11-28 01:10:51 +01:00

Import User data

Import userdata when importing a WiiU animation to a Switch bfres
This commit is contained in:
Shuken Mondin 2020-12-25 11:14:16 +08:00
parent 2fd88ce7eb
commit f2601229d3

View File

@ -384,6 +384,26 @@ namespace FirstPlugin
ska.BakedSize = skeletalAnimU.BakedSize;
ska.Loop = skeletalAnimU.Loop;
ska.Baked = skeletalAnimU.Baked;
foreach (var userDataU in skeletalAnimU.UserData)
{
var parser = new UserDataParser();
var userDataNX = new ResNX.UserData();
parser.Type = userDataU.Value.Type.ToString();
parser.UserDataName = userDataU.Value.Name;
userDataNX.Name = parser.UserDataName;
if (parser.Type == "Byte")
userDataNX.SetValue(parser.GetBytes());
if (parser.Type == "Single")
parser.LoadValues(userDataU.Value.GetValueSingleArray());
userDataNX.SetValue(parser.GetFloats());
if (parser.Type == "Int32")
userDataNX.SetValue(parser.GetInts());
if (parser.Type == "String")
userDataNX.SetValue(parser.GetStringASCII());
if (parser.Type == "WString")
userDataNX.SetValue(parser.GetStringUnicode());
ska.UserDatas.Add(userDataNX);
}
foreach (var boneAnimU in skeletalAnimU.BoneAnims)
{
var boneAnim = new ResNX.BoneAnim();