Adjust the keyloader

This commit is contained in:
KillzXGaming 2022-05-25 16:36:10 -04:00
parent 6fe6dfed37
commit bc808202c7

View file

@ -48,7 +48,7 @@ namespace FirstPlugin
return tracks;
}
public static STAnimationTrack[] LoadVectorTrack(Gfbanim.FramedVectorTrack framedTrack)
public static STAnimationTrack[] LoadVectorTrack(Gfbanim.FramedVectorTrack16 framedTrack)
{
ushort[] frames = framedTrack.GetFramesArray();
@ -71,6 +71,29 @@ namespace FirstPlugin
return tracks;
}
public static STAnimationTrack[] LoadVectorTrack(Gfbanim.FramedVectorTrack8 framedTrack)
{
byte[] frames = framedTrack.GetFramesArray();
STAnimationTrack[] tracks = new STAnimationTrack[3];
tracks[0] = new STAnimationTrack(STInterpoaltionType.Linear);
tracks[1] = new STAnimationTrack(STInterpoaltionType.Linear);
tracks[2] = new STAnimationTrack(STInterpoaltionType.Linear);
for (int i = 0; i < framedTrack.ValuesLength; i++)
{
var vec = framedTrack.Values(i).Value;
int frame = i;
if (i < frames?.Length) frame = frames[i];
tracks[0].KeyFrames.Add(new STKeyFrame(frame, vec.X));
tracks[1].KeyFrames.Add(new STKeyFrame(frame, vec.Y));
tracks[2].KeyFrames.Add(new STKeyFrame(frame, vec.Z));
}
return tracks;
}
public static STAnimationTrack LoadBooleanTrack(Gfbanim.DynamicBooleanTrack framedTrack)
{
STAnimationTrack track = new STAnimationTrack(STInterpoaltionType.Step);