From 1b7aa5a215fa038fd2d444ef8cc1cd2c13dcf4fa Mon Sep 17 00:00:00 2001 From: Aram Azhari Date: Mon, 25 Sep 2023 15:22:29 -0400 Subject: [PATCH 1/3] EMSUSD-490 Fixes outerliner not refreshing when performing a UsdUndoVisibleCommand --- lib/usdUfe/ufe/StagesSubject.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/usdUfe/ufe/StagesSubject.cpp b/lib/usdUfe/ufe/StagesSubject.cpp index 80f0c7aec5..b4639a9c83 100644 --- a/lib/usdUfe/ufe/StagesSubject.cpp +++ b/lib/usdUfe/ufe/StagesSubject.cpp @@ -384,7 +384,7 @@ void StagesSubject::stageChanged( const auto& changedPath = *it; if (changedPath.IsPrimPropertyPath()) { // Special case to detect when an xformop is added or removed from a prim. - // We need to send some notifs so DCC can update (such as on undo + // We need to send some notifications so DCC can update (such as on undo // to move the transform manipulator back to original position). const TfToken nameToken = changedPath.GetNameToken(); auto usdPrimPathStr = changedPath.GetPrimPath().GetString(); @@ -395,7 +395,14 @@ void StagesSubject::stageChanged( notifyWithoutExceptions(ufePath); } } + // Special case when Undoing a visibility change, the notice.GetChangedInfoOnlyPaths() does not + // contain the change, hence handling visibility notification in re-synch path. + if (changedPath.GetNameToken() == UsdGeomTokens->visibility) { + Ufe::VisibilityChanged vis(ufePath); + notifyWithoutExceptions(vis); + } processAttributeChanges(ufePath, changedPath, it.base()->second); + // No further processing for this prim property path is required. continue; } From 51ce1d4cd15d17790051c1cd71828709a4f17d73 Mon Sep 17 00:00:00 2001 From: Aram Azhari Date: Mon, 25 Sep 2023 15:29:07 -0400 Subject: [PATCH 2/3] Fixed linting errors --- lib/usdUfe/ufe/StagesSubject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/usdUfe/ufe/StagesSubject.cpp b/lib/usdUfe/ufe/StagesSubject.cpp index b4639a9c83..103a6c1b55 100644 --- a/lib/usdUfe/ufe/StagesSubject.cpp +++ b/lib/usdUfe/ufe/StagesSubject.cpp @@ -395,14 +395,14 @@ void StagesSubject::stageChanged( notifyWithoutExceptions(ufePath); } } - // Special case when Undoing a visibility change, the notice.GetChangedInfoOnlyPaths() does not - // contain the change, hence handling visibility notification in re-synch path. + // Special case when Undoing a visibility change, the notice.GetChangedInfoOnlyPaths() + // does not contain the change, hence handling visibility notification in re-synch path. if (changedPath.GetNameToken() == UsdGeomTokens->visibility) { Ufe::VisibilityChanged vis(ufePath); notifyWithoutExceptions(vis); } processAttributeChanges(ufePath, changedPath, it.base()->second); - + // No further processing for this prim property path is required. continue; } From 58b33e85169cb979f9248cc7648da76c0fe0333d Mon Sep 17 00:00:00 2001 From: Aram Azhari Date: Tue, 26 Sep 2023 10:01:21 -0400 Subject: [PATCH 3/3] Moved the visibility notification to inside the event that triggers it to avoid sending duplicate notifications --- lib/usdUfe/ufe/StagesSubject.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/usdUfe/ufe/StagesSubject.cpp b/lib/usdUfe/ufe/StagesSubject.cpp index 103a6c1b55..98deab8ff6 100644 --- a/lib/usdUfe/ufe/StagesSubject.cpp +++ b/lib/usdUfe/ufe/StagesSubject.cpp @@ -162,6 +162,12 @@ void sendAttributeChanged( } } 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. + if (changedToken == UsdGeomTokens->visibility) { + Ufe::VisibilityChanged vis(ufePath); + notifyWithoutExceptions(vis); + } notifyWithoutExceptions( Ufe::AttributeRemoved(ufePath, changedToken.GetString())); } break; @@ -395,12 +401,7 @@ void StagesSubject::stageChanged( notifyWithoutExceptions(ufePath); } } - // Special case when Undoing a visibility change, the notice.GetChangedInfoOnlyPaths() - // does not contain the change, hence handling visibility notification in re-synch path. - if (changedPath.GetNameToken() == UsdGeomTokens->visibility) { - Ufe::VisibilityChanged vis(ufePath); - notifyWithoutExceptions(vis); - } + processAttributeChanges(ufePath, changedPath, it.base()->second); // No further processing for this prim property path is required.