Skip to content

Support for matte in RenderPass#2593

Merged
cpichard merged 5 commits intoAutodesk:masterfrom
cpichard:issue_2549_master
Mar 16, 2026
Merged

Support for matte in RenderPass#2593
cpichard merged 5 commits intoAutodesk:masterfrom
cpichard:issue_2549_master

Conversation

@cpichard
Copy link
Collaborator

Changes proposed in this pull request

  • In hydra2, use the active render pass to filter matted objects
  • Add kick -sceneload_arg render_pass /My/RenderPass/Path to pass the RenderPass prim path to use when rendering with kick

Issues fixed in this pull request
Fixes #2549

@cpichard cpichard marked this pull request as ready for review March 12, 2026 17:30
@cpichard cpichard requested review from Copilot and sebastienblor and removed request for sebastienblor March 12, 2026 17:30
sebastienblor
sebastienblor previously approved these changes Mar 12, 2026
Copy link
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 hydra2 RenderPass matte support by propagating RenderPass “matte” membership into Arnold primvars, and introduces a kick sceneload argument to select the active RenderPass prim to use during rendering.

Changes:

  • Apply RenderPass matte overrides in the render pass scene index (authoring arnold:matte primvar overrides).
  • Add render_pass sceneload arg support (plumbed to hydra2 via HdsiSceneGlobalsSceneIndex).
  • Add regression test coverage for matte in hydra2 render passes (#2549).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
testsuite/test_2549/ref/reference.tif New reference image for #2549 regression.
testsuite/test_2549/data/test.usda New USD scene defining a RenderPass with a matte collection.
testsuite/test_2549/README New test definition invoking kick with -scenoload_arg render_pass ....
plugins/scene_index/renderPassSIP.cpp Implements matte override as arnold:matte primvar when active RenderPass says so.
plugins/procedural/main.cpp Reads render_pass sceneload arg and forwards to the active reader.
libs/translator/reader/reader.h Adds SetRenderPass override (currently a no-op) to satisfy new interface.
libs/render_delegate/reader.h Declares SetRenderPass in hydra reader and adds SceneGlobals scene index member/include.
libs/render_delegate/reader.cpp Implements SetRenderPass and inserts HdsiSceneGlobalsSceneIndex in scene index chain.
libs/common/procedural_reader.h Extends ProceduralReader interface with SetRenderPass.
libs/common/constant_strings.h Adds arnold:matte and render_pass string tokens.
CHANGELOG.md Records the bug fix entry for #2549.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 79 to 83
HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex;
HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex;
HdsiSceneGlobalsSceneIndexRefPtr _sceneGlobalsSceneIndex;

Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

HdsiSceneGlobalsSceneIndexRefPtr appears to be a new type used here, but this header doesn’t declare it via TF_DECLARE_REF_PTRS(HdsiSceneGlobalsSceneIndex) (unlike other Hdsi types above). If the USD header doesn’t provide the typedef (and especially when ENABLE_SCENE_INDEX is off and the header isn’t included), this will be a compile error. Please add the corresponding TF_DECLARE_REF_PTRS declaration (or avoid the RefPtr typedef in this member).

Copilot uses AI. Check for mistakes.

author: cyril.pichard@autodesk.com

PARAMS: {'scene':'test.usda', 'kick_params': '-sceneload_arg render_pass /Render/Passes/renderpass2'}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This test is configured with a single ref/reference.tif, but the testsuite runner executes every test in all enabled passes (usd/hydra/hydra2) and will diff each pass output against the reference unless you provide pass-specific references. Since the README states this only works in hydra2, consider adding pass-specific reference images (e.g. reference.hydra2.tif, plus a non-hydra2 reference if needed) or otherwise adjusting the test so it won’t fail in the usd/hydra passes.

Suggested change
PARAMS: {'scene':'test.usda', 'kick_params': '-sceneload_arg render_pass /Render/Passes/renderpass2'}
PARAMS: {'scene':'test.usda', 'kick_params': '-sceneload_arg render_pass /Render/Passes/renderpass2'}
PASSES: hydra2

Copilot uses AI. Check for mistakes.
Comment on lines +443 to +449
void HydraArnoldReader::SetRenderPass(const std::string &renderPass) {
if (_sceneGlobalsSceneIndex) {
SdfPath renderPassPrimPath(renderPass);
if (!renderPassPrimPath.IsEmpty()) {
_sceneGlobalsSceneIndex->SetActiveRenderPassPrimPath(renderPassPrimPath);
}
}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

HydraArnoldReader::SetRenderPass calls HdsiSceneGlobalsSceneIndex::SetActiveRenderPassPrimPath, but this function is not guarded by #ifdef ARNOLD_SCENE_INDEX. In SCons builds where BUILD_SCENE_INDEX_PLUGIN is false, ENABLE_SCENE_INDEX (and thus the Hdsi headers) aren’t available, so this will fail to compile. Consider wrapping the implementation in #ifdef ARNOLD_SCENE_INDEX (and TF_UNUSED(renderPass) in the #else) or including the required Hdsi header unconditionally when this method is compiled.

Suggested change
void HydraArnoldReader::SetRenderPass(const std::string &renderPass) {
if (_sceneGlobalsSceneIndex) {
SdfPath renderPassPrimPath(renderPass);
if (!renderPassPrimPath.IsEmpty()) {
_sceneGlobalsSceneIndex->SetActiveRenderPassPrimPath(renderPassPrimPath);
}
}
void HydraArnoldReader::SetRenderPass(const std::string &renderPass) {
#ifdef ARNOLD_SCENE_INDEX
if (_sceneGlobalsSceneIndex) {
SdfPath renderPassPrimPath(renderPass);
if (!renderPassPrimPath.IsEmpty()) {
_sceneGlobalsSceneIndex->SetActiveRenderPassPrimPath(renderPassPrimPath);
}
}
#else
TF_UNUSED(renderPass);
#endif

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cpichard and others added 3 commits March 13, 2026 17:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cpichard cpichard merged commit ab99084 into Autodesk:master Mar 16, 2026
9 checks passed
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.

Implement matte for hydra2 render pass

3 participants