def checkState():
# check if there are unsaved changes
fileCheckState = cmds.file(q=True, modified=True)
# if there are, save them first ... then we can proceed
if fileCheckState:
# This is maya's native call to save, with dialogs, etc.
# No need to write your own.
if dlg.warning("warning", "Scene Not Saved", "Scene Not Saved, Do you want to save it first?"):
cmds.SaveScene()
pass
else:
pass
评论列表
文章目录