Skip to content

Commit

Permalink
Merge pull request #4027 from jufrantz/prevent_unintended_layer_file_…
Browse files Browse the repository at this point in the history
…overwrites

LayerManager: Prevent unintended overwriting of unmodified USD layers at Maya save.
  • Loading branch information
seando-adsk authored Dec 6, 2024
2 parents 4e01a71 + 4c75bee commit 7c22372
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 7c22372

Please sign in to comment.