Add support for holeIndices#2655
Open
cpichard wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for USD holeIndices on UsdGeomMesh (for non-subdivided meshes) by filtering out hole faces from the generated Arnold mesh topology and associated per-face / face-varying data, rather than trying to map directly to polygon_holes.
Changes:
- Introduces
MeshHoleFilterutility to remove hole faces from uniform and face-varying arrays (and commonVtValueprimvar payloads). - Updates the USD procedural mesh reader and Hydra render delegate mesh sync to apply hole filtering to topology, primvars, normals indices, and
shidxs. - Adds a regression test scene + reference log for issue #2632 and documents the feature in the changelog.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
libs/common/shape_utils.h |
Adds MeshHoleFilter API for filtering hole faces from mesh-related arrays/values. |
libs/common/shape_utils.cpp |
Implements MeshHoleFilter build/clear and VtValue filtering helpers. |
libs/translator/reader/read_geometry.cpp |
Procedural mesh reader now drops hole faces from nsides/vidxs and related data for non-subdiv meshes. |
libs/render_delegate/mesh.h |
Caches a MeshHoleFilter on HdArnoldMesh for hole handling during sync. |
libs/render_delegate/mesh.cpp |
Render delegate mesh sync filters topology and primvars based on holeIndices (non-subdiv). |
testsuite/test_2632/data/scene.usda |
Adds a USD scene exercising holeIndices. |
testsuite/test_2632/README |
Adds test description/params for the new regression test. |
testsuite/test_2632/ref/reference.log |
Captures reference output for the new test. |
CHANGELOG.md |
Adds a feature note for holeIndices support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Features | ||
|
|
||
| - [usd#2632](https://github.com/Autodesk/arnold-usd/issues/2610) - Support holeIndices in UsdGeomMesh for non-subdivided meshes |
Comment on lines
+263
to
+270
| /// Filter a per-face (uniform) array (one entry per face). | ||
| /// Returns true if filtering was applied (also when no-op due to size mismatch). | ||
| template <typename T> | ||
| bool FilterUniformArray(VtArray<T>& arr) const | ||
| { | ||
| if (Empty()) return false; | ||
| if (arr.size() != _isHole.size()) return false; | ||
| // Read via const cdata() to avoid COW detach on a possibly-shared |
Comment on lines
+403
to
+404
| std::vector<unsigned int> nsides_uint(filteredNsides.begin(), filteredNsides.end()); | ||
| AiNodeSetArray(node, str::nsides, AiArrayConvert(nsides_uint.size(), 1, AI_TYPE_UINT, nsides_uint.data())); |
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.
Changes proposed in this pull request
Issues fixed in this pull request
Fixes #2632