Support for matte in RenderPass#2593
Conversation
…ath when using kick
There was a problem hiding this comment.
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:matteprimvar overrides). - Add
render_passsceneload arg support (plumbed to hydra2 viaHdsiSceneGlobalsSceneIndex). - 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.
| HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex; | ||
| HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex; | ||
| HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex; | ||
| HdsiSceneGlobalsSceneIndexRefPtr _sceneGlobalsSceneIndex; | ||
|
|
There was a problem hiding this comment.
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).
|
|
||
| author: cyril.pichard@autodesk.com | ||
|
|
||
| PARAMS: {'scene':'test.usda', 'kick_params': '-sceneload_arg render_pass /Render/Passes/renderpass2'} |
There was a problem hiding this comment.
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.
| 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 |
| void HydraArnoldReader::SetRenderPass(const std::string &renderPass) { | ||
| if (_sceneGlobalsSceneIndex) { | ||
| SdfPath renderPassPrimPath(renderPass); | ||
| if (!renderPassPrimPath.IsEmpty()) { | ||
| _sceneGlobalsSceneIndex->SetActiveRenderPassPrimPath(renderPassPrimPath); | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
| 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 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changes proposed in this pull request
kick -sceneload_arg render_pass /My/RenderPass/Pathto pass the RenderPass prim path to use when rendering with kickIssues fixed in this pull request
Fixes #2549