Merge pull request #317 from shukenmg/userdata

Import User data
This commit is contained in:
KillzXGaming 2020-12-26 12:47:23 -05:00 committed by GitHub
commit 746648e479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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();