Skip to content

Commit

Permalink
Merge pull request #864 from Autodesk/sabrih/MAYA-107591/handle_inval…
Browse files Browse the repository at this point in the history
…idation_pseudo_root

MAYA-107591: Subtree invalidation support on StageProxy ( a.k.a pseudo-root ).
  • Loading branch information
Krystian Ligenza authored Oct 24, 2020
2 parents dc910a9 + 3d7f677 commit 17457c9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/mayaUsd/ufe/StagesSubject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,27 @@ void StagesSubject::stageChanged(UsdNotice::ObjectsChanged const& notice, UsdSta
// don't care about it. In those cases, the changePath will contain something like:
// "/<prim>.visibility"
// "/<prim>.xformOp:translate"
if (!changedPath.IsPrimPath())
if (changedPath.IsPropertyPath())
continue;

const std::string& usdPrimPathStr = changedPath.GetPrimPath().GetString();
// Assume proxy shapes (and thus stages) cannot be instanced. We can
// therefore map the stage to a single UFE path. Lifting this
// restriction would mean sending one add or delete notification for
// each Maya Dag path instancing the proxy shape / stage.
Ufe::Path ufePath = stagePath(sender) + Ufe::PathSegment(usdPrimPathStr, g_USDRtid, '/');
auto prim = stage->GetPrimAtPath(changedPath);
Ufe::Path ufePath;
UsdPrim prim;
if (changedPath == SdfPath::AbsoluteRootPath())
{
ufePath = stagePath(sender);
prim = stage->GetPseudoRoot();
}
else
{
const std::string& usdPrimPathStr = changedPath.GetPrimPath().GetString();
ufePath = stagePath(sender) + Ufe::PathSegment(usdPrimPathStr, g_USDRtid, '/');
prim = stage->GetPrimAtPath(changedPath);
}

if (prim.IsValid() && !InPathChange::inPathChange())
{
auto sceneItem = Ufe::Hierarchy::createItem(ufePath);
Expand Down

0 comments on commit 17457c9

Please sign in to comment.