Improve fix of issue #147

This commit is contained in:
VaDiM
2026-10-19 14:31:58 +03:00
parent 9b3368f41d
commit e4b56b43f4
+4 -3
View File
@@ -895,6 +895,7 @@ namespace AssetStudio
{ {
Logger.Warning($"Cannot process mesh | PathID: {m_PathID} | Name: \"{m_Name}\"" + Logger.Warning($"Cannot process mesh | PathID: {m_PathID} | Name: \"{m_Name}\"" +
$"\n{ex.Message}"); $"\n{ex.Message}");
Logger.Debug(ex.StackTrace);
} }
finally finally
{ {
@@ -1247,9 +1248,9 @@ namespace AssetStudio
//IndexBuffer //IndexBuffer
if (m_CompressedMesh.m_Triangles.m_NumItems > 0) if (m_CompressedMesh.m_Triangles.m_NumItems > 0)
{ {
m_IndexBuffer = m_Use16BitIndices m_IndexBuffer = !m_Use16BitIndices && m_CompressedMesh.m_Triangles.m_NumItems / 2 == m_SubMeshes.Sum(x=> x.indexCount)
? Array.ConvertAll(m_CompressedMesh.m_Triangles.UnpackInts(), x => (uint)x) ? MemoryMarshal.Cast<byte, uint>(m_CompressedMesh.m_Triangles.m_Data).ToArray() // https://github.com/aelurum/AssetStudioMod/issues/147
: MemoryMarshal.Cast<byte, uint>(m_CompressedMesh.m_Triangles.m_Data).ToArray(); //sus : Array.ConvertAll(m_CompressedMesh.m_Triangles.UnpackInts(), x => (uint)x);
} }
//Color //Color
if (m_CompressedMesh.m_Colors?.m_NumItems > 0) if (m_CompressedMesh.m_Colors?.m_NumItems > 0)