Skip to content

Commit

Permalink
LayerManager: Prevent unintended overwriting of unmodified USD layers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jufrantz committed Dec 3, 2024
1 parent 8883de1 commit 4c75bee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mayaUsd/nodes/layerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,8 @@ BatchSaveResult LayerDatabase::saveUsdToUsdFiles()
const auto& allLayers = info.stage->GetUsedLayers(true);
for (auto layer : allLayers) {
if (TF_VERIFY(layer)) {
if (layer != sessionLayer && layer->PermissionToSave()) {
if (layer != sessionLayer && layer->PermissionToSave()
&& layer->IsDirty()) {
if (!MayaUsd::utils::saveLayerWithFormat(layer)) {
MString errMsg;
MString layerName(layer->GetDisplayName().c_str());
Expand Down

0 comments on commit 4c75bee

Please sign in to comment.