Skip to content

Add support for holeIndices#2655

Open
cpichard wants to merge 5 commits into
Autodesk:masterfrom
cpichard:issue_2632
Open

Add support for holeIndices#2655
cpichard wants to merge 5 commits into
Autodesk:masterfrom
cpichard:issue_2632

Conversation

@cpichard
Copy link
Copy Markdown
Collaborator

Changes proposed in this pull request

  • A direct mapping to polygon_holes doesn't work, holeIndices and polygon_holes have different semantics.
  • We filter the faces, primvars, etc from the geometry instead

Issues fixed in this pull request
Fixes #2632

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 MeshHoleFilter utility to remove hole faces from uniform and face-varying arrays (and common VtValue primvar 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.

Comment thread CHANGELOG.md Outdated

### Features

- [usd#2632](https://github.com/Autodesk/arnold-usd/issues/2610) - Support holeIndices in UsdGeomMesh for non-subdivided meshes
Comment thread libs/common/shape_utils.h
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()));
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.

Support holeIndices for USD meshes

2 participants