More seanim fixes
This commit is contained in:
parent
9b0883150a
commit
3ffc7d7f6d
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -44,19 +44,22 @@ namespace Switch_Toolbox.Library.Animations
|
||||
var rotationnKeys = seanim.AnimationRotationKeys[bone];
|
||||
foreach (SEAnimFrame animFrame in rotationnKeys)
|
||||
{
|
||||
var quat = ((SELib.Utilities.Quaternion)animFrame.Data);
|
||||
var euler = STMath.ToEulerAngles(quat.X, quat.Y, quat.Z, quat.W);
|
||||
|
||||
boneAnim.XROT.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).X,
|
||||
Value = euler.X,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
boneAnim.YROT.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).Y,
|
||||
Value = euler.Y,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
boneAnim.ZROT.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).Z,
|
||||
Value = euler.Z,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
}
|
||||
@ -66,26 +69,41 @@ namespace Switch_Toolbox.Library.Animations
|
||||
var scaleKeys = seanim.AnimationRotationKeys[bone];
|
||||
foreach (SEAnimFrame animFrame in scaleKeys)
|
||||
{
|
||||
var quat = ((SELib.Utilities.Quaternion)animFrame.Data);
|
||||
var euler = STMath.ToEulerAngles(quat.X, quat.Y, quat.Z, quat.W);
|
||||
|
||||
boneAnim.XSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = euler.X,
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).X,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
boneAnim.YSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = euler.Y,
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).Y,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
boneAnim.ZSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = euler.Z,
|
||||
Value = (float)((SELib.Utilities.Vector3)animFrame.Data).Z,
|
||||
Frame = animFrame.Frame,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boneAnim.XSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = 1,
|
||||
Frame = 0,
|
||||
});
|
||||
boneAnim.YSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = 1,
|
||||
Frame = 0,
|
||||
});
|
||||
boneAnim.ZSCA.Keys.Add(new Animation.KeyFrame()
|
||||
{
|
||||
Value = 1,
|
||||
Frame = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user