Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
- [Core] Fix issue with parsing AnimationClip [SR]
Browse files Browse the repository at this point in the history
  • Loading branch information
Razmoth committed Oct 18, 2023
1 parent 5842e40 commit a3489cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion AssetStudio/Classes/AnimationClip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ public class ClipMuscleConstant : IYAMLExportable
public bool m_KeepOriginalPositionY;
public bool m_KeepOriginalPositionXZ;
public bool m_HeightFromFeet;
public static bool HasShortIndexArray(SerializedType type) => type.Match("E708B1872AE48FD688AC012DF4A7A178");
public ClipMuscleConstant() { }

public ClipMuscleConstant(ObjectReader reader)
Expand Down Expand Up @@ -1265,7 +1266,14 @@ public ClipMuscleConstant(ObjectReader reader)
m_CycleOffset = reader.ReadSingle();
m_AverageAngularSpeed = reader.ReadSingle();

m_IndexArray = reader.ReadInt32Array();
if (reader.Game.Type.IsSR() && HasShortIndexArray(reader.serializedType))
{
m_IndexArray = reader.ReadInt16Array().Select(x => (int)x).ToArray();
}
else
{
m_IndexArray = reader.ReadInt32Array();
}
if (version[0] < 4 || (version[0] == 4 && version[1] < 3)) //4.3 down
{
var m_AdditionalCurveIndexArray = reader.ReadInt32Array();
Expand Down

0 comments on commit a3489cf

Please sign in to comment.