Skip to content

Commit

Permalink
Merge pull request #1172 from Autodesk/spinell/MAYA-109618/crash_edit…
Browse files Browse the repository at this point in the history
…or_muted_layer

MAYA-109618 - Crash when target layer is muted and a prim on a differ…
  • Loading branch information
Krystian Ligenza committed Feb 11, 2021
2 parents fd7a058 + b941447 commit 21d410c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/mayaUsd/ufe/UsdTransform3dMayaXformStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,15 @@ Ufe::Transform3d::Ptr UsdTransform3dMayaXformStackHandler::editTransform3d(
return nullptr;
}

auto stage = usdItem->prim().GetStage();
if (stage) {
const SdfLayerHandle& editLayer = stage->GetEditTarget().GetLayer();
if (editLayer && stage->IsLayerMuted(editLayer->GetIdentifier())) {
MGlobal::displayError("Editing a muted layer is not allowed.");
return nullptr;
}
}

return createTransform3d(
item, [&]() { return _nextHandler->editTransform3d(item UFE_V2(, hint)); });
}
Expand Down

0 comments on commit 21d410c

Please sign in to comment.