Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMSUSD-1098 Fixed saving vs locked layers #3669

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

Also EMSUSD-1097, EMSUSD-1099 and EMSUSD-1100

EMSUSD-1097 Refactor anonymous layer saving. There was code that was nearly identical between the Layer Editor item saveAnonymousLayer function, the saveSubLayer function and the generic saveAnonymousLayer function in utilSerialization.h. Refactor the layer editor item to use the generic one instead, avoiding having to fix problems in two places.

  • Remove the saveSubLayer function that is now entirely redundant.
  • Refactor the LayerTreeItem function to use the generic saveAnonymousLayer function.
  • All the code left in the LayerTreeItem is now specific the the layer editor or its session state.
  • Add a FileBackup helper class in the utilFileSystem to backup a file and possibly restore it if the new file is not commited as valid.
  • Add a parameter to the generic saveAnonymousLayer function to return an optional error message.
  • Improve error messages when saving
  • Prevent saving system-locked layers.
  • Add helper functions to transfer the muted and locked status of anonymous layers to their new layers.

EMSUSD-1100 preserve the locked and muted status of layer when saved. When transitioning from anonymous to non-anonymous, update the muted and locked status of the layers.

EMSUSD-1098 don't allow saving system-locked layer Prevent saving when double-clicking on a system-locked layer.

EMSUSD-1099 fix parent layer when converting anonynous layers. The parent layer that was passed to saveAnonymousLayer when converting anonymous layers into saved layers was incorrect. It was passing the parent of the parent instead. This lead to the stage root layer getting replaced by its oen sub-layer!

Add unit tests and Python wrappers

  • Add Python wrappers to lock, unlock and verify lock on layers.
  • Write unit tests to verify the behavior of locked layers.
  • Improve the tests for muted layers.

Also EMSUSD-1097, EMSUSD-1099 and EMSUSD-1100

EMSUSD-1097 Refactor anonymous layer saving. There was code that was
nearly identical between the Layer Editor item saveAnonymousLayer
function, the saveSubLayer function and the generic saveAnonymousLayer
function in utilSerialization.h. Refactor the layer editor item to use
the generic one instead, avoiding having to fix problems in two places.

- Remove the saveSubLayer function that is now entirely redundant.
- Refactor the LayerTreeItem function to use the generic
  saveAnonymousLayer function.
- All the code left in the LayerTreeItem is now specific the the layer
  editor or its session state.
- Add a FileBackup helper class in the utilFileSystem to backup a file
  and possibly restore it if the new file is not commited as valid.
- Add a parameter to the generic saveAnonymousLayer function to return
  an optional error message.
- Improve error messages when saving
- Prevent saving system-locked layers.
- Add helper functions to transfer the muted and locked status of
  anonymous layers to their new layers.

EMSUSD-1100 preserve the locked and muted status of layer when saved.
When transitioning from anonymous to non-anonymous, update the muted and
locked status of the layers.

EMSUSD-1098 don't allow saving system-locked layer Prevent saving when
double-clicking on a system-locked layer.

EMSUSD-1099 fix parent layer when converting anonynous layers. The
parent layer that was passed to saveAnonymousLayer when converting
anonymous layers into saved layers was incorrect. It was passing the
parent of the parent instead. This lead to the stage root layer getting
replaced by its oen sub-layer!

Add unit tests and Python wrappers

- Add Python wrappers to lock, unlock and verify lock on layers.
- Write unit tests to verify the behavior of locked layers.
- Improve the tests for muted layers.
@pierrebai-adsk pierrebai-adsk added bug Something isn't working adsk Related to Autodesk plugin labels Mar 20, 2024
@pierrebai-adsk pierrebai-adsk self-assigned this Mar 20, 2024
In older version of USD, the layer muting check can fail due to case change in the file path, even though on Windows the file paths are case-insensitive.
@pierrebai-adsk
Copy link
Collaborator Author

PF failure was files being left in tmp folder in one Windows build.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 21, 2024
@seando-adsk seando-adsk added workflows Related to in-context workflows and removed adsk Related to Autodesk plugin labels Mar 22, 2024
@seando-adsk seando-adsk merged commit 0ce478b into dev Mar 22, 2024
12 of 15 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-1098/save-vs-locked branch March 22, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants