-
Notifications
You must be signed in to change notification settings - Fork 202
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
Restrict namespace edits to current stage #2977
Restrict namespace edits to current stage #2977
Conversation
This is needed for the calls to std::once_flag and std::call_once
When authoring namespace edits across layers, restrict the targets to layers within your current usd stage. This avoids trying the edit across references, inherits, payloads, etc, which will often times be illegal.
@@ -20,6 +20,8 @@ | |||
#include <pxr/usd/usd/tokens.h> | |||
#include <pxr/usd/usdUI/tokens.h> | |||
|
|||
#include <mutex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure why this file got modified, was this to fix a build issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I couldn't build locally without that change. It's PR'd here:
#2975
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always hard to imagine all possible scenarios that the change could affect, but the principle seems correct, so this is good to go. If we find cases that need to modify non-local layer stacks in the future, we'll revisit the design and API.
@@ -116,16 +116,33 @@ void enforceMutedLayer(const PXR_NS::UsdPrim& prim, const char* command) | |||
} | |||
} | |||
|
|||
static SdfPrimSpecHandleVector _GetLocalPrimStack(const UsdPrim& prim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ON second thought, maybe adding a comments on what this code is trying to avoid, like the description you gave in teh bug would be helpful for future coders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too the liberty of adding the comment myself to your branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!
Add a comment to explain the code that only affect local layers.
This will restrict namespace edits to your current usd stage. This avoids the issue of spanning references and inherits, etc, which will often be illegal operations. This addresses the issue I posted here:
#2953