[FIX] Correct vertex index calculation in meshes_to_subsurface method | GEN-13490 #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

TL;DR
Fixed a bug in the mesh indexing logic when converting meshes to subsurface format.
What changed?
Modified the
meshes_to_subsurfacemethod to correctly calculate the index offset when combining multiple meshes. Instead of using the maximum value in the current simplex array, the code now adds the number of vertices in each mesh to properly increment the index counter.How to test?
Test the
meshes_to_subsurfacemethod with multiple meshes of different sizes to verify that the vertex indices are correctly offset and that no index overlapping occurs between different meshes.Why make this change?
The previous implementation incorrectly calculated the index offset by using the maximum value in the current simplex array. This could lead to index overlapping or gaps when combining meshes with non-sequential vertex indices. The new approach ensures that indices are properly incremented based on the actual number of vertices in each mesh, resulting in correctly connected mesh structures.