Skip to content

Commit

Permalink
HYDRA-747 : Simplify code as _GetInputSceneIndex is always valid
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Jan 9, 2024
1 parent 23ee144 commit 62c2514
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/flowViewport/API/samples/fvpFilteringSceneIndexExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool FilteringSceneIndexExample::IsFiltered(const SdfPath& primPath) const

void FilteringSceneIndexExample::UpdateFilteringStatus(const SdfPath& primPath)
{
if (_GetInputSceneIndex() && ShouldBeFiltered(_GetInputSceneIndex()->GetPrim(primPath))) {
if (ShouldBeFiltered(_GetInputSceneIndex()->GetPrim(primPath))) {
_filteredPrims.insert(primPath);
} else {
_filteredPrims.erase(primPath);
Expand All @@ -96,15 +96,11 @@ FilteringSceneIndexExample::FilteringSceneIndexExample(const HdSceneIndexBaseRef

HdSceneIndexPrim FilteringSceneIndexExample::GetPrim(const SdfPath& primPath) const
{
if (!_GetInputSceneIndex()) {
return HdSceneIndexPrim();
}

return IsFiltered(primPath) ? HdSceneIndexPrim() : _GetInputSceneIndex()->GetPrim(primPath);
}

SdfPathVector FilteringSceneIndexExample::GetChildPrimPaths(const SdfPath& primPath) const {
if (!_GetInputSceneIndex()) {
if (IsFiltered(primPath)) {
return SdfPathVector();
}

Expand All @@ -115,7 +111,7 @@ SdfPathVector FilteringSceneIndexExample::GetChildPrimPaths(const SdfPath& primP
childPaths.end(),
[this](const SdfPath& childPath) -> bool { return IsFiltered(childPath); }),
childPaths.end());
return IsFiltered(primPath) ? SdfPathVector() : childPaths;
return childPaths;
}

void FilteringSceneIndexExample::_PrimsAdded(
Expand Down

0 comments on commit 62c2514

Please sign in to comment.