diff --git a/lib/mayaUsd/commands/layerEditorCommand.cpp b/lib/mayaUsd/commands/layerEditorCommand.cpp index a30fbfd687..27e63a67de 100644 --- a/lib/mayaUsd/commands/layerEditorCommand.cpp +++ b/lib/mayaUsd/commands/layerEditorCommand.cpp @@ -825,8 +825,6 @@ class LockLayer : public BaseCmd if (!stage) return false; - saveSelection(); - std::set layersToUpdate; if (_includeSublayers) { // If _includeSublayers is True, we attempt to refresh the system lock status of all @@ -896,7 +894,6 @@ class LockLayer : public BaseCmd _proxyShapePath, _layers[layerIndex], _previousStates[layerIndex], true); } } - restoreSelection(); if (_updateEditTarget) { updateEditTarget(stage); @@ -919,36 +916,6 @@ class LockLayer : public BaseCmd return stage; } - void saveSelection() - { - // Make a copy of the global selection, to restore it on unlock. - auto globalSn = Ufe::GlobalSelection::get(); - _savedSn.replaceWith(*globalSn); - // Filter the global selection, removing items below our proxy shape. - // We know the path to the proxy shape has a single segment. Not - // using Ufe::PathString::path() for UFE v1 compatibility, which - // unfortunately reveals leading "world" path component implementation - // detail. - Ufe::Path path( - Ufe::PathSegment("world" + _proxyShapePath, MayaUsd::ufe::getMayaRunTimeId(), '|')); - globalSn->replaceWith(UsdUfe::removeDescendants(_savedSn, path)); - } - - void restoreSelection() - { - // Restore the saved selection to the global selection. If a saved - // selection item started with the proxy shape path, re-create it. - // We know the path to the proxy shape has a single segment. Not - // using Ufe::PathString::path() for UFE v1 compatibility, which - // unfortunately reveals leading "world" path component implementation - // detail. - Ufe::Path path( - Ufe::PathSegment("world" + _proxyShapePath, MayaUsd::ufe::getMayaRunTimeId(), '|')); - auto globalSn = Ufe::GlobalSelection::get(); - globalSn->replaceWith(UsdUfe::recreateDescendants(_savedSn, path)); - } - - Ufe::Selection _savedSn; std::vector _previousStates; SdfLayerHandleVector _layers; };