fix(MeshHelper): get_triangles on meshes without indices · K0lb3/UnityPy@0429093 · GitHub
Skip to content

Commit 0429093

Browse files
nichinichisou0609K0lb3
authored andcommitted
fix(MeshHelper): get_triangles on meshes without indices
MeshHandler only copies a non-empty index buffer, so for a mesh without indices m_IndexBuffer stays None and get_triangles failed its first assertion. Such a mesh (vertices only, e.g. a placeholder mesh, or submeshes with indexCount 0) now gets an empty triangle list per submesh; a submesh that has indices while the mesh has no index buffer raises a ValueError.
1 parent d67692f commit 0429093

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

‎UnityPy/helpers/MeshHelper.py‎

Lines changed: 6 additions & 1 deletion

‎tests/test_mesh_helper.py‎

Lines changed: 47 additions & 0 deletions

0 commit comments

Comments
 (0)