Skip to content

Commit

Permalink
Only use curves for more that one key frame
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Dec 15, 2023
1 parent 6a15971 commit 46b9e87
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,20 @@ static BoneAnim CreateBoneAnim(IOAnimation animation, STSkeleton skeleton, Setti
break;
}
}

switch (track.ChannelType)
if (track.KeyFrames.Count > 1)
{
case IOAnimationTrackType.PositionX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionX)); break;
case IOAnimationTrackType.PositionY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionY)); break;
case IOAnimationTrackType.PositionZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionZ)); break;
case IOAnimationTrackType.RotationEulerX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateX)); break;
case IOAnimationTrackType.RotationEulerY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateY)); break;
case IOAnimationTrackType.RotationEulerZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateZ)); break;
case IOAnimationTrackType.ScaleX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleX)); break;
case IOAnimationTrackType.ScaleY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleY)); break;
case IOAnimationTrackType.ScaleZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleZ)); break;
switch (track.ChannelType)
{
case IOAnimationTrackType.PositionX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionX)); break;
case IOAnimationTrackType.PositionY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionY)); break;
case IOAnimationTrackType.PositionZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.PositionZ)); break;
case IOAnimationTrackType.RotationEulerX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateX)); break;
case IOAnimationTrackType.RotationEulerY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateY)); break;
case IOAnimationTrackType.RotationEulerZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.RotateZ)); break;
case IOAnimationTrackType.ScaleX: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleX)); break;
case IOAnimationTrackType.ScaleY: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleY)); break;
case IOAnimationTrackType.ScaleZ: boneAnim.Curves.Add(CreateCurve(track, AnimTarget.ScaleZ)); break;
}
}
}

Expand Down

0 comments on commit 46b9e87

Please sign in to comment.