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

EMSUSD-490 Fixes Redo Visibility Visual Update in Outliner #3428

Merged
Merged
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
8 changes: 7 additions & 1 deletion lib/usdUfe/ufe/StagesSubject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,19 @@ void sendAttributeChanged(
notifyWithoutExceptions<Ufe::Camera>(ufePath);
}
} else {
// Special case when Redo-ing visibility change, the notice.GetChangedInfoOnlyPaths()
// does not contain the change, hence handling visibility notification in re-sync path.
if (changedToken == UsdGeomTokens->visibility) {
Ufe::VisibilityChanged vis(ufePath);
notifyWithoutExceptions<Ufe::Object3d>(vis);
}
AramAzhari-adsk marked this conversation as resolved.
Show resolved Hide resolved
notifyWithoutExceptions<Ufe::Attributes>(
Ufe::AttributeAdded(ufePath, changedToken.GetString()));
}
} break;
case AttributeChangeType::kRemoved: {
// Special case when Undoing a visibility change, the notice.GetChangedInfoOnlyPaths()
// does not contain the change, hence handling visibility notification in re-synch path.
// does not contain the change, hence handling visibility notification in re-sync path.
if (changedToken == UsdGeomTokens->visibility) {
Ufe::VisibilityChanged vis(ufePath);
notifyWithoutExceptions<Ufe::Object3d>(vis);
Expand Down
28 changes: 23 additions & 5 deletions test/lib/ufe/testObject3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,33 @@ def testVisibility(self):
object3d.setVisibility(False)
self.assertFalse(object3d.visibility())

# We should have got 'one' notification.
self.assertEqual(visObs.notifications(), 1)

if (ufeUtils.ufeFeatureSetVersion() >= 4):
# We should have got 'two' notifications. One for Add and one for ValueChange
# This occurs on the very first time the visibility token attribute is added.
self.assertEqual(visObs.notifications(), 2)
else:
# We should have got one notification. Only for ValueChange
self.assertEqual(visObs.notifications(), 1)

# Make it visible.
object3d.setVisibility(True)
self.assertTrue(object3d.visibility())

# We should have got one more notification.
self.assertEqual(visObs.notifications(), 2)
# We should have got one more notification. Only for ValueChange
if (ufeUtils.ufeFeatureSetVersion() >= 4):
self.assertEqual(visObs.notifications(), 3)
else:
self.assertEqual(visObs.notifications(), 2)

# Make it visible.
object3d.setVisibility(False)
self.assertFalse(object3d.visibility())

# We should have got one more notification. Only for ValueChange
if (ufeUtils.ufeFeatureSetVersion() >= 4):
self.assertEqual(visObs.notifications(), 4)
else:
self.assertEqual(visObs.notifications(), 3)

# Remove the observer.
ufe.Object3d.removeObserver(visObs)
Expand Down