Autodesk / Autodesk/maya-usd

[EMSUSD-3041] Maya scene file removed after cancelling USD save during Incremental Save

Open
#4,369 3 comments 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

### Describe the bug
The current Maya scene file is deleted from disk after cancelling the USD files save during `Incremental Save`.

### Steps to reproduce

1. Open an existing Maya scene that contains a proxyShape created from an existing USD file.
2. Verify the scene file exists on disk:
```python
fileLocation = maya.cmds.file(q=True, location=True)
print(f"# File exists: {maya.cmds.file(fileLocation, q=True, exists=True)}")
# File exists: True
```
3. Modify a file-backed USD layer (e.g., the root layer) so the stage becomes dirty.
4. Ensure the save dialogs will appear:
```python
maya.cmds.optionVar(iv=("mayaUsd_SerializedUsdEditsLocationPrompt", 1))
maya.cmds.optionVar(iv=("mayaUsd_ConfirmExistingFileSave", 1))
```
5. Trigger an incremental save via **File > Increment and Save**, or **File > Save Scene** with **Incremental Save** enabled.
6. In **Save USD Options**, choose **Save the Maya scene file and USD files** and click **Save**.
7. When the confirmation dialog appears, click **Cancel**.
8. Verify the scene file again, it has been removed:
```python
fileLocation = maya.cmds.file(q=True, location=True)
print(f"# File exists: {maya.cmds.file(fileLocation, q=True, exists=True)}")
# File exists: False
```

### Expected behavior
Clicking **Cancel** should abort the save and leave the original Maya scene file intact.

### Environment
- Rocky Linux 8.10
- Maya 2026.2
- Maya USD dev @ 386b4fd
- Pixar USD v24.11

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.