-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Thank you!! |
||
{ | ||
SdfPrimSpecHandleVector primSpecs; | ||
|
||
UsdStagePtr stage = prim.GetStage(); | ||
if (!stage) | ||
return primSpecs; | ||
|
||
for (const SdfLayerHandle& layer : stage->GetLayerStack()) { | ||
const SdfPrimSpecHandle primSpec = layer->GetPrimAtPath(prim.GetPath()); | ||
if (primSpec) | ||
primSpecs.push_back(primSpec); | ||
} | ||
|
||
return primSpecs; | ||
} | ||
|
||
void applyToAllPrimSpecs(const UsdPrim& prim, const PrimSpecFunc& func) | ||
{ | ||
const SdfPrimSpecHandleVector primStack = prim.GetPrimStack(); | ||
const SdfPrimSpecHandleVector primStack = _GetLocalPrimStack(prim); | ||
for (const SdfPrimSpecHandle& spec : primStack) | ||
func(prim, spec); | ||
} | ||
|
||
void applyToAllLayersWithOpinions(const UsdPrim& prim, PrimLayerFunc& func) | ||
{ | ||
const SdfPrimSpecHandleVector primStack = prim.GetPrimStack(); | ||
const SdfPrimSpecHandleVector primStack = _GetLocalPrimStack(prim); | ||
for (const SdfPrimSpecHandle& spec : primStack) { | ||
const auto layer = spec->GetLayer(); | ||
func(prim, layer); | ||
|
@@ -137,7 +154,7 @@ void applyToSomeLayersWithOpinions( | |
const std::set<SdfLayerRefPtr>& layers, | ||
PrimLayerFunc& func) | ||
{ | ||
const SdfPrimSpecHandleVector primStack = prim.GetPrimStack(); | ||
const SdfPrimSpecHandleVector primStack = _GetLocalPrimStack(prim); | ||
for (const SdfPrimSpecHandle& spec : primStack) { | ||
const auto layer = spec->GetLayer(); | ||
if (layers.count(layer) == 0) | ||
|
@@ -215,4 +232,4 @@ SdfLayerHandle getStrongerLayer( | |
return getStrongerLayer(stage->GetRootLayer(), layer1, layer2); | ||
} | ||
|
||
} // namespace MAYAUSD_NS_DEF | ||
} // namespace MAYAUSD_NS_DEF |
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