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

EMSUSD-85 - As a user, I'd like my 'Merge as USD' edits to be specified as overs when authoring to a stronger layer #3173

Merged
merged 3 commits into from
Jun 20, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions lib/usd/utils/MergePrims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,6 @@ bool mergeDiffPrims(
return SdfCopySpec(srcLayer, srcPath, dstLayer, dstPath, copyValue, copyChildren);
}

//----------------------------------------------------------------------------------------------------------------------
/// Create any missing parents as "over". Parents may be missing because we are targeting a
/// different layer than where the destination prim is authored. The SdfCopySpec function does not
/// automatically create the missing parent, unlike other functions like UsdStage::CreatePrim.
void createMissingParents(const SdfLayerRefPtr& dstLayer, const SdfPath& dstPath)
{
SdfJustCreatePrimInLayer(dstLayer, dstPath.GetParentPath());
}

//----------------------------------------------------------------------------------------------------------------------
// Augment a USD SdfPath with the variants selections currently active at all levels.
std::pair<SdfPath, UsdEditTarget> augmentPathWithVariants(
Expand Down Expand Up @@ -1022,7 +1013,11 @@ bool mergePrims(

UsdEditContext editCtx(dstStage, target);

createMissingParents(dstLayer, augmentedDstPath);
/// Create any missing prim in the dst hierarchy as "over". Prims may be missing because we are
/// targeting a different layer than where the destination prim is authored. The SdfCopySpec
/// function does not automatically create the missing parent, unlike other functions like
/// UsdStage::CreatePrim.
SdfJustCreatePrimInLayer(dstLayer, augmentedDstPath);

if (options.ignoreUpperLayerOpinions) {
auto tempStage = UsdStage::CreateInMemory();
Expand Down