Skip to content
Open
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
15 changes: 15 additions & 0 deletions lib/mayaUsd/ufe/MayaStagesSubject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//
#include "MayaStagesSubject.h"

#include "MayaUsdHierarchy.h"

#include <mayaUsd/nodes/proxyShapeBase.h>
#include <mayaUsd/ufe/ProxyShapeHandler.h>
#include <mayaUsd/ufe/UsdStageMap.h>
Expand Down Expand Up @@ -84,6 +86,17 @@ MayaStagesSubject::RefPtr MayaStagesSubject::create()
return TfCreateRefPtr(new MayaStagesSubject);
}

void MayaStagesSubject::stageChanged(
UsdNotice::ObjectsChanged const& notice,
UsdStageWeakPtr const& sender)
{
// Override to bracket the stageChanged notification with
// mayaUsdHierarchyStageChangedBegin/End calls.
mayaUsdHierarchyStageChangedBegin();
StagesSubject::stageChanged(notice, sender);
mayaUsdHierarchyStageChangedEnd();
}

bool MayaStagesSubject::isInNewScene() const { return _isInNewScene; }

void MayaStagesSubject::setInNewScene(bool b)
Expand Down Expand Up @@ -190,12 +203,14 @@ void MayaStagesSubject::setupListeners()
}

// Now we can send the notifications about stage change.
mayaUsdHierarchyStageChangedBegin();
for (auto& path : _invalidStages) {
Ufe::SceneItem::Ptr sceneItem = Ufe::Hierarchy::createItem(path);
if (sceneItem) {
sendSubtreeInvalidate(sceneItem);
}
}
mayaUsdHierarchyStageChangedEnd();

_invalidStages.clear();

Expand Down
4 changes: 4 additions & 0 deletions lib/mayaUsd/ufe/MayaStagesSubject.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class MAYAUSD_CORE_PUBLIC MayaStagesSubject : public UsdUfe::StagesSubject
static MayaStagesSubject::RefPtr create();

protected:
void stageChanged(
PXR_NS::UsdNotice::ObjectsChanged const& notice,
PXR_NS::UsdStageWeakPtr const& sender) override;

bool isInNewScene() const;
void setInNewScene(bool b);

Expand Down
Loading