Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with multiple filters #4001

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could be more than one if another UFE data model cares about something more than "InactivePrims", especially if filters are alphabetically sorted and that other UFE data model cares about "Hidden" primitives.

// 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