secondlife / secondlife/viewer
glTF Mesh Import - Improved Handling of Physics Mesh Too Dense or Degenerate Triangles
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 299
- Forks
- 146
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 88
Description
Suggestion to have an option (tick box on physics tab) to ignore small/dense meshes or degenerate triangles when selecting a physics mesh for a model.
When using a separate mesh model or a LOD from the uploaded model to provide for Physics/Colliders the message that the mesh is too dense or contains degenerate triangles may appear. Using Analyze as suggested usually also leads to an error:
MAV_FOUND_DEGENERATIVE_TRIANGLES
MAV_MAX_HULLS_EXCEEDED (why does the popup say "MissingString:" rather than "Messsage:"?
It would be helpful if the MAX_HULLS_EXCEEDED message gave the number found in the model and the limit too.
Note no information appears in the mesh uploader Log tab at all. Secondlife.log is not very useful when within the viewer as it seems to only update when you exit the viewer which makes debugging difficult. Anyway, it would be helpful if the SecondLife.log file AND the Log Tab of the Mesh Uploader specified the mesh part name(s) that are too small or degenerate, etc.
Currently a generic name for "physics_mesh" block or "physics_convex" are the only items logged against these error messages in SecondLife.log.
2025-08-03T08:38:02Z WARNING #Mesh# newview/llmeshrepository.cpp(842) log_upload_error : error: {'error':'INVALID_ASSET_MULTIPLE','errors':[{'BlockName':'physics_mesh','Context':'validateDecompressedPhysicsMeshData','ErrorCode':i21,'FaceIndex':i0,'MeshIndex':i1,'TriangleIndex':i43,'Vertex0':[r0.03719,r-0.184646,r-0.0683032],'Vertex1':[r0.0650606,r-0.223945,r-0.0643969],'Vertex2':[r0.0675174,r-0.227417,r-0.0643969],'message':'MAV_FOUND_DEGENERATE_TRIANGLES'},{'BlockName':'physics_mesh','Context':'validateDecompressedPhysicsMeshData','ErrorCode':i21,'FaceIndex':i0,'MeshIndex':i2,'TriangleIndex':i14,'Vertex0':[r0.0202907,r-0.159567,r0.00644311],'Vertex1':[r0.0193294,r-0.158515,r0.00644311],'Vertex2':[r0.0182917,r-0.157378,r-0.0202297],'message':'MAV_FOUND_DEGENERATE_TRIANGLES'}],'identifier':'Upload_InvalidAsset','message':'Multiple errors while validating asset.'}
2025-08-03T08:40:49Z WARNING #Mesh# newview/llmeshrepository.cpp(842) log_upload_error : error: {'error':'INVALID_ASSET_MULTIPLE','errors':[{'BlockName':'physics_convex','Context':'validateDecomposition','ErrorCode':i15,'MeshIndex':i1,'SubBlockName':'HullList','message':'MAV_MAX_HULLS_EXCEEDED'},{'BlockName':'physics_convex','Context':'validateDecomposition','ErrorCode':i15,'MeshIndex':i2,'SubBlockName':'HullList','message':'MAV_MAX_HULLS_EXCEEDED'}],'identifier':'Upload_InvalidAsset','message':'Multiple errors while validating asset.'}
Test Plan
Try some test meshes with various LODs chosen for the physics mesh.
Observe the workflow would be much easier of it was possible to simply tick a box to have the uploader ignore elements for the physics mesh that are out of scope.
A test model fallingwater-x1-physics-opt.glb is attached as one example.
fallingwater-x1-physics-opt.zip
Use various options to select LODs for the physics model, or try to use this mesh as a selected physics model when uploading another mesh.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100 (replace 100 with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/try to let everyone know!🙌 And when they open the PR, they can comment
/claim #4482 either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @aiaustin (replace 20 with the amount, and @aiaustin with the user to tip).📖 If you want to learn more, check out our documentation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with newview/llmeshrepository.cpp around log_upload_error and reproduce the reported validation failures using the attached fallingwater-x1-physics-opt.glb test model. Trace the mesh uploader physics-mesh selection and Log tab workflow described in the issue. Done means the requested physics-mesh handling and useful mesh-part, hull-limit, and error details are visible in the uploader or SecondLife.log, with the test workflow succeeding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100