Skip to content

Commit

Permalink
Fix issue with multiple filters
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Nov 15, 2024
1 parent 56d2b24 commit 8ca8461
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 8 additions & 6 deletions lib/mayaUsd/ufe/ProxyShapeHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ Ufe::SceneItemList ProxyShapeHierarchy::filteredChildren(const ChildFilter& chil

// Note: for now the only child filter flag we support is "Inactive Prims".
// See UsdHierarchyHandler::childFilter()
if ((childFilter.size() == 1) && (childFilter.front().name == "InactivePrims")) {
// See uniqueChildName() for explanation of USD filter predicate.
const bool showInactive = childFilter.front().value;
Usd_PrimFlagsPredicate flags
= showInactive ? UsdPrimIsDefined && !UsdPrimIsAbstract : kMayaUsdPrimDefaultPredicate;
return createUFEChildList(getUSDFilteredChildren(rootPrim, flags), !showInactive);
for (const auto& filter : childFilter) {
if (filter.name == "InactivePrims") {
// See uniqueChildName() for explanation of USD filter predicate.
const bool showInactive = filter.value;
Usd_PrimFlagsPredicate flags = showInactive ? UsdPrimIsDefined && !UsdPrimIsAbstract
: kMayaUsdPrimDefaultPredicate;
return createUFEChildList(getUSDFilteredChildren(rootPrim, flags), !showInactive);
}
}

UFE_LOG("Unknown child filter");
Expand Down
14 changes: 8 additions & 6 deletions lib/usdUfe/ufe/UsdHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ Ufe::SceneItemList UsdHierarchy::filteredChildren(const ChildFilter& childFilter
{
// Note: for now the only child filter flag we support is "Inactive Prims".
// See UsdHierarchyHandler::childFilter()
if ((childFilter.size() == 1) && (childFilter.front().name == "InactivePrims")) {
// See uniqueChildName() for explanation of USD filter predicate.
const bool showInactive = childFilter.front().value;
Usd_PrimFlagsPredicate flags
= showInactive ? UsdPrimIsDefined && !UsdPrimIsAbstract : kUsdUfePrimDefaultPredicate;
return createUFEChildList(getUSDFilteredChildren(_item, flags), !showInactive);
for (const auto& filter : childFilter) {
if (filter.name == "InactivePrims") {
// See uniqueChildName() for explanation of USD filter predicate.
const bool showInactive = filter.value;
Usd_PrimFlagsPredicate flags = showInactive ? UsdPrimIsDefined && !UsdPrimIsAbstract
: kUsdUfePrimDefaultPredicate;
return createUFEChildList(getUSDFilteredChildren(_item, flags), !showInactive);
}
}

UFE_LOG("Unknown child filter");
Expand Down

0 comments on commit 8ca8461

Please sign in to comment.