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

Commit

Permalink
- [Core] fix parsing issues [ExA]
Browse files Browse the repository at this point in the history
  • Loading branch information
Razmoth committed Feb 29, 2024
1 parent 8a3517f commit 6c64b41
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 18 deletions.
56 changes: 39 additions & 17 deletions AssetStudio/Classes/AnimationClip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ public HumanPose(ObjectReader reader)
if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up
{
m_TDoFArray = reader.ReadVector3Array();
}
}
}

public static HumanPose ParseGI(ObjectReader reader)
{
Expand Down Expand Up @@ -1118,7 +1118,7 @@ public static DenseClip ParseGI(ObjectReader reader)
return denseClip;
}
}
public class ArkDenseClip : DenseClip
public class ACLDenseClip : DenseClip
{
public int m_ACLType;
public byte[] m_ACLArray;
Expand All @@ -1130,21 +1130,38 @@ public class ArkDenseClip : DenseClip
public uint m_nRotationCurves;
public uint m_nEulerCurves;
public uint m_nScaleCurves;
public uint m_nGenericCurves;

public ArkDenseClip(ObjectReader reader) : base(reader)
public ACLDenseClip(ObjectReader reader) : base(reader)
{
m_ACLType = reader.ReadInt32();
m_ACLArray = reader.ReadUInt8Array();
reader.AlignStream();
m_PositionFactor = reader.ReadSingle();
m_EulerFactor = reader.ReadSingle();
m_ScaleFactor = reader.ReadSingle();
m_FloatFactor = reader.ReadSingle();
m_nPositionCurves = reader.ReadUInt32();
m_nRotationCurves = reader.ReadUInt32();
m_nEulerCurves = reader.ReadUInt32();
m_nScaleCurves = reader.ReadUInt32();

if (reader.Game.Type.IsArknightsEndfield())
{
m_ACLArray = reader.ReadUInt8Array();
reader.AlignStream();
m_PositionFactor = reader.ReadSingle();
m_EulerFactor = reader.ReadSingle();
m_ScaleFactor = reader.ReadSingle();
m_FloatFactor = reader.ReadSingle();
m_nPositionCurves = reader.ReadUInt32();
m_nRotationCurves = reader.ReadUInt32();
m_nEulerCurves = reader.ReadUInt32();
m_nScaleCurves = reader.ReadUInt32();
}
else if (reader.Game.Type.IsExAstris())
{
m_nPositionCurves = reader.ReadUInt32();
m_nRotationCurves = reader.ReadUInt32();
m_nEulerCurves = reader.ReadUInt32();
m_nScaleCurves = reader.ReadUInt32();
m_nGenericCurves = reader.ReadUInt32();
m_PositionFactor = reader.ReadSingle();
m_EulerFactor = reader.ReadSingle();
m_ScaleFactor = reader.ReadSingle();
m_FloatFactor = reader.ReadSingle();
m_ACLArray = reader.ReadUInt8Array();
reader.AlignStream();
}
Process();
}

Expand Down Expand Up @@ -1181,7 +1198,7 @@ private void Process()
{
sampleArray.Add(ReadCurve(aclSpan, m_ScaleFactor, ref index));
}
var m_nFloatCurves = m_CurveCount - (m_nPositionCurves + m_nRotationCurves + m_nEulerCurves + m_nScaleCurves);
var m_nFloatCurves = m_CurveCount - (m_nPositionCurves + m_nRotationCurves + m_nEulerCurves + m_nScaleCurves + m_nGenericCurves);
for (int j = 0; j < m_nFloatCurves; j++)
{
sampleArray.Add(ReadCurve(aclSpan, m_FloatFactor, ref index));
Expand Down Expand Up @@ -1299,9 +1316,9 @@ public Clip(ObjectReader reader)
{
var version = reader.version;
m_StreamedClip = new StreamedClip(reader);
if (reader.Game.Type.IsArknightsEndfield())
if (reader.Game.Type.IsArknightsEndfield() || reader.Game.Type.IsExAstris())
{
m_DenseClip = new ArkDenseClip(reader);
m_DenseClip = new ACLDenseClip(reader);
}
else
{
Expand Down Expand Up @@ -1866,6 +1883,11 @@ public AnimationClip(ObjectReader reader) : base(reader)
m_CompressedRotationCurves.Add(new CompressedAnimationCurve(reader));
}

if (reader.Game.Type.IsExAstris())
{
var m_aclType = reader.ReadInt32();
}

if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up
{
int numEulerCurves = reader.ReadInt32();
Expand Down
7 changes: 6 additions & 1 deletion AssetStudio/Classes/Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public VertexData(ObjectReader reader)
m_Streams = new List<StreamInfo>();
for (int i = 0; i < numStreams; i++)
{
m_Streams[i] = new StreamInfo(reader);
m_Streams.Add(new StreamInfo(reader));
}

if (version[0] < 4) //4.0 down
Expand Down Expand Up @@ -706,6 +706,11 @@ public Mesh(ObjectReader reader) : base(reader)
int m_CollisionVertexCount = reader.ReadInt32();
}

if (reader.Game.Type.IsExAstris())
{
var m_ColliderType = reader.ReadInt32();
}

int m_MeshUsageFlags = reader.ReadInt32();

if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up
Expand Down
4 changes: 4 additions & 0 deletions AssetStudio/Classes/Texture2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public GLTextureSettings(ObjectReader reader)
m_FilterMode = reader.ReadInt32();
m_Aniso = reader.ReadInt32();
m_MipBias = reader.ReadSingle();
if (reader.Game.Type.IsExAstris())
{
var m_TextureGroup = reader.ReadInt32();
}
if (version[0] >= 2017)//2017.x and up
{
m_WrapMode = reader.ReadInt32(); //m_WrapU
Expand Down

0 comments on commit 6c64b41

Please sign in to comment.