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-873 - Adds write permission checks to layer system-locking #3626

Conversation

AramAzhari-adsk
Copy link
Collaborator

Some of the layer operations will refresh the system-lock based on the write permissions of those layers. The operations are as follows:

  • When the user initiates a layer reload (through the context menu in the usd layer editor)
  • When the user initiates a stage reload (through attribute editor)
  • When the user loads a stage from a file.
  • Anything that may cause a session stage change on the LayerTreeModel (including the case of stage reload).
  • Using script (refreshSystemLock)

Note that:

  • Anonymous layers are not checked for write permissions.
  • The check is executed regardless of changes on disk. Only the write permissions are checked (as per design).

@AramAzhari-adsk AramAzhari-adsk added enhancement New feature or request adsk Related to Autodesk plugin labels Feb 21, 2024
pierrebai-adsk
pierrebai-adsk previously approved these changes Feb 22, 2024
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, LGTM

…s-Write-Permission-Check-To-Layer-System-Locking

# Conflicts:
#	lib/usd/ui/layerEditor/abstractCommandHook.h
#	lib/usd/ui/layerEditor/mayaCommandHook.h
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AramAzhari-adsk AramAzhari-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 23, 2024
Comment on lines +113 to +121
def GetFullStageNameFromProxyShapeAttr(attr):
# Helper method which returns the full stage name
# First get the stage name from the input attribute.
stageName = attr.split('.')[0]
# Convert that into a long Maya path so we can get the USD stage.
res = cmds.ls(stageName, l=True)
fullStageName = res[0]

return(fullStageName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this function needed? Couldn't you just have called the one above and ignore the stage?
fullStageName,_ = GetStageFromProxyShapeAttr(filePathAttr)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I have an upcoming PR and I am taking note to address this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thanks. I'll merge this one then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@seando-adsk seando-adsk removed enhancement New feature or request adsk Related to Autodesk plugin labels Feb 23, 2024
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Feb 23, 2024
@seando-adsk seando-adsk merged commit cbe5aff into dev Feb 23, 2024
14 of 17 checks passed
@seando-adsk seando-adsk deleted the azharia/EMSUSD-873/Adds-Write-Permission-Check-To-Layer-System-Locking branch February 23, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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