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

MAYA-122218 showing dactivated children #2265

Merged
merged 14 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 4 additions & 2 deletions lib/mayaUsd/ufe/UsdHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ bool UsdHierarchy::hasChildren() const
//
// I don't have data that proves we need to worry about performance in here,
// so going after maintainability.
return !children().empty();
const bool isFilteringInactive = false;
return !createUFEChildList(getUSDFilteredChildren(fItem), isFilteringInactive).empty();
seando-adsk marked this conversation as resolved.
Show resolved Hide resolved
}

Ufe::SceneItemList UsdHierarchy::children() const
{
return createUFEChildList(getUSDFilteredChildren(fItem), true /*filterInactive*/);
const bool isFilteringInactive = true;
return createUFEChildList(getUSDFilteredChildren(fItem), isFilteringInactive);
}

#ifdef UFE_V2_FEATURES_AVAILABLE
Expand Down
9 changes: 8 additions & 1 deletion test/lib/ufe/testChildFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def testFilteredChildren(self):
ball3Prim = mayaUsd.ufe.ufePathToPrim(ball3PathStr)
ball3Prim.SetActive(False)

# Props should now have 5 children and ball3 should not be one of them.
# Props children should have 5 children and ball3 should not be one of them.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you remove "now". The comment was correct. At line 84 we test that there are 6 children and now we are testing that there are 5.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took multiple passes to update the test and did not realized I dropped a word there.

children = propsHier.children()
self.assertEqual(5, len(children))
self.assertNotIn(ball3Item, children)
Expand All @@ -102,6 +102,13 @@ def testFilteredChildren(self):
usdHierHndlr = ufe.RunTimeMgr.instance().hierarchyHandler(ball3Item.runTimeId())
cf = usdHierHndlr.childFilter()

# Toggle "Inactive Prims" off and get the filtered children
# Props filtered children should have 5 children and ball3 should not be one of them.
cf[0].value = False
children = propsHier.filteredChildren(cf)
self.assertEqual(5, len(children))
self.assertNotIn(ball3Item, children)

# Toggle "Inactive Prims" on and get the filtered children
# (with inactive prims) and verify ball3 is one of them.
cf[0].value = True
Expand Down