public static ResU.SkeletalAnim FSKAConvertSwitchToWiiU(ResNX.SkeletalAnim skeletalAnimNX) { ResU.SkeletalAnim ska = new ResU.SkeletalAnim(); ska.Name = skeletalAnimNX.Name; ska.Path = skeletalAnimNX.Path; ska.FrameCount = skeletalAnimNX.FrameCount; ska.FlagsScale = ResU.SkeletalAnimFlagsScale.None; if (skeletalAnimNX.FlagsScale.HasFlag(ResNX.SkeletalAnimFlagsScale.Maya)) { ska.FlagsScale = ResU.SkeletalAnimFlagsScale.Maya; } if (skeletalAnimNX.FlagsScale.HasFlag(ResNX.SkeletalAnimFlagsScale.Softimage)) { ska.FlagsScale = ResU.SkeletalAnimFlagsScale.Softimage; } if (skeletalAnimNX.FlagsScale.HasFlag(ResNX.SkeletalAnimFlagsScale.Standard)) { ska.FlagsScale = ResU.SkeletalAnimFlagsScale.Standard; } ska.FrameCount = skeletalAnimNX.FrameCount; ska.BindIndices = skeletalAnimNX.BindIndices; ska.BakedSize = skeletalAnimNX.BakedSize; ska.Loop = skeletalAnimNX.Loop; ska.Baked = skeletalAnimNX.Baked; foreach (var boneAnimNX in skeletalAnimNX.BoneAnims) { var boneAnimU = new ResU.BoneAnim(); ska.BoneAnims.Add(boneAnimU); boneAnimU.Name = boneAnimNX.Name; boneAnimU.BeginRotate = boneAnimNX.BeginRotate; boneAnimU.BeginTranslate = boneAnimNX.BeginTranslate; boneAnimU.BeginBaseTranslate = boneAnimNX.BeginBaseTranslate; var baseData = new ResU.BoneAnimData(); baseData.Translate = boneAnimNX.BaseData.Translate; baseData.Scale = boneAnimNX.BaseData.Scale; baseData.Rotate = boneAnimNX.BaseData.Rotate; baseData.Flags = boneAnimNX.BaseData.Flags; boneAnimU.BaseData = baseData; boneAnimU.FlagsBase = (ResU.BoneAnimFlagsBase)boneAnimNX.FlagsBase; boneAnimU.FlagsCurve = (ResU.BoneAnimFlagsCurve)boneAnimNX.FlagsCurve; boneAnimU.FlagsTransform = (ResU.BoneAnimFlagsTransform)boneAnimNX.FlagsTransform; boneAnimU.Curves = ConvertAnimCurveSwitchToWiiU(boneAnimNX.Curves); } return(ska); }
public static ResNX.SkeletalAnim FSKAConvertWiiUToSwitch(ResU.SkeletalAnim skeletalAnimU) { ResNX.SkeletalAnim ska = new ResNX.SkeletalAnim(); ska.Name = skeletalAnimU.Name; ska.Path = skeletalAnimU.Path; ska.FrameCount = skeletalAnimU.FrameCount; ska.FlagsScale = ResNX.SkeletalAnimFlagsScale.None; if (skeletalAnimU.FlagsScale.HasFlag(ResU.SkeletalAnimFlagsScale.Maya)) { ska.FlagsScale = ResNX.SkeletalAnimFlagsScale.Maya; } if (skeletalAnimU.FlagsScale.HasFlag(ResU.SkeletalAnimFlagsScale.Softimage)) { ska.FlagsScale = ResNX.SkeletalAnimFlagsScale.Softimage; } if (skeletalAnimU.FlagsScale.HasFlag(ResU.SkeletalAnimFlagsScale.Standard)) { ska.FlagsScale = ResNX.SkeletalAnimFlagsScale.Standard; } ska.FrameCount = skeletalAnimU.FrameCount; ska.BindIndices = skeletalAnimU.BindIndices; 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(); ska.BoneAnims.Add(boneAnim); boneAnim.Name = boneAnimU.Name; boneAnim.BeginRotate = boneAnimU.BeginRotate; boneAnim.BeginTranslate = boneAnimU.BeginTranslate; boneAnim.BeginBaseTranslate = boneAnimU.BeginBaseTranslate; var baseData = new ResNX.BoneAnimData(); baseData.Translate = boneAnimU.BaseData.Translate; baseData.Scale = boneAnimU.BaseData.Scale; baseData.Rotate = boneAnimU.BaseData.Rotate; baseData.Flags = boneAnimU.BaseData.Flags; boneAnim.BaseData = baseData; boneAnim.FlagsBase = (ResNX.BoneAnimFlagsBase)boneAnimU.FlagsBase; boneAnim.FlagsCurve = (ResNX.BoneAnimFlagsCurve)boneAnimU.FlagsCurve; boneAnim.FlagsTransform = (ResNX.BoneAnimFlagsTransform)boneAnimU.FlagsTransform; boneAnim.Curves = ConvertAnimCurveWiiUToSwitch(boneAnimU.Curves); } return(ska); }