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

MAYA-107591: Subtree invalidation support on StageProxy ( a.k.a pseudo-root ). #864

Merged
merged 3 commits into from
Oct 24, 2020

Conversation

HamedSabri-adsk
Copy link
Contributor

This PR fixes the cases where subtree invalidation doesn't occur in the outliner where all the children are the descendant of stage proxy shape ( a.k.a pseudo-root).

This issue became obvious during the current ongoing work on reordering support where outliner stopped to refresh.

…the children are the descendant of StageProxy ( a.k.a pseudo-root ).
@@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsPrimPath() checks if a path identifies a prim but what we wanted here is to check if path identifies a property.

calling isPrimPath() on "/" would return false and therefore subtree invalidation never occurs.

ufePath = stagePath(sender) + Ufe::PathSegment(usdPrimPathStr, g_USDRtid, '/');
prim = stage->GetPrimAtPath(changedPath);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add conditional check to set ufePath and prim in the case where the changedPath is a pseduo-root.

Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks.

@HamedSabri-adsk HamedSabri-adsk added workflows Related to in-context workflows bug Something isn't working labels Oct 22, 2020
auto prim = stage->GetPrimAtPath(changedPath);
Ufe::Path ufePath;
UsdPrim prim;
if (changedPath.GetString() == "/")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we replace this with

changedPath == SdfPath::AbsoluteRootPath()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh... that's what I was looking for. :) Addressed in d109480

@kxl-adsk
Copy link

One bad news - IsAbsoluteRootPath is not available with 19.11. We are getting the following compilation error

E:\Dev\usd\_workspaces_latest\Pixar_USD_19.11\include\pxr/usd/pcp/primIndex.h(63): note: see declaration of 'pxrInternal_v0_19__pxrReserved__::SdfPath'

@kxl-adsk
Copy link

But looks like SdfPath::AbsoluteRootPath() is available - https://github.com/PixarAnimationStudios/USD/blob/4b1162957b2ad219e1635c81de8343be490e41fc/pxr/usd/lib/sdf/path.h#L295

@HamedSabri-adsk
Copy link
Contributor Author

HamedSabri-adsk commented Oct 22, 2020

@kxl-adsk Good catch! addressed in 3d7f677

…ching to SdfPath::AbsoluteRootPath() instead.
@HamedSabri-adsk HamedSabri-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 23, 2020
@kxl-adsk kxl-adsk merged commit 17457c9 into dev Oct 24, 2020
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-107591/handle_invalidation_pseudo_root branch October 24, 2020 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants