Skip to content

Conversation

@isHarryh
Copy link
Contributor

Summary

This PR does some improvements to MeshHelper.

  1. Making flat_list_to_tuples an inline function.
  2. Introduces the lists_to_tuples function to fix the type error that List[List] produced by the zeros function cannot be assigned to tuple-member-lists such as List[Tuple3f] List[Tuple4f].
  3. Refactors the get_triangles function.
    1. Changes the way to generate triangles lists.
    2. Adds a indexCount fix for TriangleStrip submeshes, see AssetStudio's code.
    3. Removes the TODOs in the get_triangles function (I have tested that using NumPy as_strided function cannot realize a speed-up).

Copy link
Owner

@K0lb3 K0lb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@isHarryh
Copy link
Contributor Author

isHarryh commented Aug 2, 2025

Quite good points! All resolved.

In order to solve type issues and make the code more readable, I had changed the triangle list-assign to list-append, but making it ~5% slower, very stupid haha. Now reverted to list-assign style.

@isHarryh isHarryh requested a review from K0lb3 August 2, 2025 02:10
K0lb3
K0lb3 previously approved these changes Aug 9, 2025
@K0lb3 K0lb3 merged commit 677cc6e into K0lb3:master Aug 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants