diff --git a/lib/usdUfe/ufe/Utils.cpp b/lib/usdUfe/ufe/Utils.cpp index acb8a7c334..db2d6eaf48 100644 --- a/lib/usdUfe/ufe/Utils.cpp +++ b/lib/usdUfe/ufe/Utils.cpp @@ -1087,7 +1087,15 @@ bool isPropertyMetadataEditAllowed( // Verify that the intended target layer is stronger than existing authored opinions. const auto strongestLayer = UsdUfe::getStrongerLayer(stage, targetLayer, topAuthoredLayer, true); - bool allowed = (strongestLayer == targetLayer); + /* + * Here there are two cases in which we want to allow the metadata edit: + * 1. the target layer of the edit is stronger than the strongest layer having an opinion on the matter + * 2. the strongest layer having an opinion on the matter is not stronger than the target layer + * + * The 2nd case appears mostly if the getStrongerLayer function fails to find which layer is stronger, + * returning an empty layer reference. + */ + bool allowed = (strongestLayer != topAuthoredLayer); if (!allowed && errMsg) { std::string strongName; if (strongestLayer) diff --git a/lib/usdUfe/utils/layers.cpp b/lib/usdUfe/utils/layers.cpp index ca3a0e94f2..a59325d0f9 100644 --- a/lib/usdUfe/utils/layers.cpp +++ b/lib/usdUfe/utils/layers.cpp @@ -17,6 +17,7 @@ #include #include +#include #include @@ -239,6 +240,12 @@ SdfLayerHandle getStrongerLayer( const SdfLayerHandle& layer2, bool compareSessionLayers) { + /* + * Here, the lack of context binder creates bug cases where some sublayers + * are not found during the recursive part of getStrongerLayer. + */ + const ArResolverContextBinder binder(stage->GetPathResolverContext()); + if (compareSessionLayers) { // Session Layer is the strongest in the stage, so check its hierarchy first // when enabled.