Repository navigation
[BUGFIX] Fix ChBlender UV Export for Meshes with Per-Vertex UVs - #867
Merged
rserban merged 1 commit intoNov 14, 2026
Merged
Conversation
Member
|
Thanks, Noah! I don't think a unit test for this is needed at this time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
For a
ChTriangleMeshConnectedwith per-vertex UVs (m_UV.size() == m_vertices.size()and nom_face_uv_indices),ChBlenderwrote the UVs of every third triangle only, so the Blender add-on could not import the mesh. The loop in that branch stepped through the UV array in threes while indexing the face list. It now loops over the faces, writing the UV of each corner's vertex, as the per-corner branch above it does.Related Issue(s)
Fixes #865.
Author(s)
@Noah-Parsons (independent).
Licensing
By submitting this pull request, I agree, that my contribution will be included in Chrono and redistributed under the BSD-3-Clause License.
Backward Compatibility
No change to inputs or the API. Meshes with per-vertex UVs now export one UV pair per face corner, which is what the Blender add-on expects. The previous loop could also index past the end of
m_face_v_indicesfor a mesh with more vertices than triangles.Detailed Description
Verified on Linux (GCC 13.3, Release) against main at 652118b, by exporting a 4 x 4 vertex grid (16 vertices, 18 triangles, per-vertex UVs) with
ChBlender::ExportScriptand comparing theuvsblock in the generated assets script with the UV of each face corner's vertex:git clang-formatreports no changes. There are no unit tests for Chrono::Postprocess at present; I am happy to add one for this export undersrc/tests/unit_testsif that would be useful.Post Submission Checklist