From bfa6963b613328c01e6e70ae4d45c2d46400aed8 Mon Sep 17 00:00:00 2001 From: deboisj Date: Tue, 28 Nov 2023 21:37:34 -0500 Subject: [PATCH 1/2] Send subtree invalidate on undo mark instanceable. --- lib/usdUfe/ufe/StagesSubject.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/usdUfe/ufe/StagesSubject.cpp b/lib/usdUfe/ufe/StagesSubject.cpp index 7fe9bafb3a..aaf45489d4 100644 --- a/lib/usdUfe/ufe/StagesSubject.cpp +++ b/lib/usdUfe/ufe/StagesSubject.cpp @@ -467,19 +467,16 @@ void StagesSubject::stageChanged( sentNotif = true; break; } - // Note : Do nothing here with didRemoveInertPrim and didRemoveNonInertPrim. - // Indeed, we can get these if prim specs are removed from some layers, but it + // Note : Do not send ObjectDelete notifs when didRemoveInertPrim or didRemoveNonInertPrim + // are set. Indeed, we can get these if prim specs are removed from some layers, but it // does not mean that the prim is no longer in the composed stage. If the prim // was actually gone, we would either get an invalid prim (in which case we // would not even get here, and would send a object destroyed" notif in the else - // below), or we would fall into the "HasInfoChange : Active" case below. If - // nothing else sends a notif in the loop (typically via the info change : - // active) we do not want to send the fallback notif, so act as if a notif was - // sent. - else if ( - entry->flags.didRemoveInertPrim || entry->flags.didRemoveNonInertPrim) { - sentNotif = true; - } + // below), or we would fall into the "HasInfoChange : Active" case below. However, + // let the fallback SubtreeInvalidate notif be sent, as it is sometimes required (for + // example when unmarking a prim as instanceable - we get entries with the inert prim + // removed, as its instanced version is removed, but it is still there as a regular prim + // and needs to be invalidated. // Special case for "active" metadata. if (entry->HasInfoChange(SdfFieldKeys->Active)) { From 263f1c1d11844919c09aae1cd3b3d50aae9b3618 Mon Sep 17 00:00:00 2001 From: deboisj Date: Tue, 28 Nov 2023 22:15:51 -0500 Subject: [PATCH 2/2] Lint --- lib/usdUfe/ufe/StagesSubject.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/usdUfe/ufe/StagesSubject.cpp b/lib/usdUfe/ufe/StagesSubject.cpp index aaf45489d4..dff5419ca2 100644 --- a/lib/usdUfe/ufe/StagesSubject.cpp +++ b/lib/usdUfe/ufe/StagesSubject.cpp @@ -467,16 +467,17 @@ void StagesSubject::stageChanged( sentNotif = true; break; } - // Note : Do not send ObjectDelete notifs when didRemoveInertPrim or didRemoveNonInertPrim - // are set. Indeed, we can get these if prim specs are removed from some layers, but it - // does not mean that the prim is no longer in the composed stage. If the prim - // was actually gone, we would either get an invalid prim (in which case we - // would not even get here, and would send a object destroyed" notif in the else - // below), or we would fall into the "HasInfoChange : Active" case below. However, - // let the fallback SubtreeInvalidate notif be sent, as it is sometimes required (for - // example when unmarking a prim as instanceable - we get entries with the inert prim - // removed, as its instanced version is removed, but it is still there as a regular prim - // and needs to be invalidated. + // Note : Do not send ObjectDelete notifs when didRemoveInertPrim or + // didRemoveNonInertPrim are set. Indeed, we can get these if prim + // specs are removed from some layers, but it does not mean that the prim is no + // longer in the composed stage. If the prim was actually gone, we would either + // get an invalid prim (in which case we would not even get here, and would send + // a object destroyed" notif in the else below), or we would fall into the + // "HasInfoChange : Active" case below. However, let the fallback + // SubtreeInvalidate notif be sent, as it is sometimes required (for example + // when unmarking a prim as instanceable - we get entries with the inert prim + // removed, as its instanced version is removed, but it is still there as a + // regular prim and needs to be invalidated. // Special case for "active" metadata. if (entry->HasInfoChange(SdfFieldKeys->Active)) {