Now seanim animation imports should work

This commit is contained in:
KillzXGaming 2019-05-26 11:48:30 -04:00
parent 3ffc7d7f6d
commit 7bad5175ef
7 changed files with 6 additions and 3 deletions

Binary file not shown.

View file

@ -125,7 +125,7 @@ namespace Bfres.Structs
{
STSkeleton skeleton = GetActiveSkeleton();
if (GetResFileU() != null)
if (SkeletalAnimU != null)
BrawlboxHelper.FSKAConverter.Fska2Chr0(ConvertWiiUToSwitch(SkeletalAnimU), FileName);
else
BrawlboxHelper.FSKAConverter.Fska2Chr0(SkeletalAnim, FileName);
@ -278,7 +278,7 @@ namespace Bfres.Structs
{
ska.Name = Text;
if (GetResFileU() != null)
if (SkeletalAnimU != null)
{
SkeletalAnimU = ConvertSwitchToWiiU(ska);
LoadAnim(SkeletalAnimU);

View file

@ -11,10 +11,13 @@ namespace Switch_Toolbox.Library.Animations
var seanim = SEAnim.Read(FileName);
anim.FrameCount = seanim.FrameCount;
anim.CanLoop = seanim.Looping;
foreach (var bone in seanim.Bones)
{
var boneAnim = new Animation.KeyNode(bone);
boneAnim.RotType = Animation.RotationType.EULER;
boneAnim.UseSegmentScaleCompensate = false;
anim.Bones.Add(boneAnim);
if (seanim.AnimationPositionKeys.ContainsKey(bone))
@ -66,7 +69,7 @@ namespace Switch_Toolbox.Library.Animations
}
if (seanim.AnimationScaleKeys.ContainsKey(bone))
{
var scaleKeys = seanim.AnimationRotationKeys[bone];
var scaleKeys = seanim.AnimationScaleKeys[bone];
foreach (SEAnimFrame animFrame in scaleKeys)
{
boneAnim.XSCA.Keys.Add(new Animation.KeyFrame()