Skip to content

Instantly share code, notes, and snippets.

@cardin
Last active December 16, 2015 13:19
Show Gist options
  • Save cardin/5440515 to your computer and use it in GitHub Desktop.
Save cardin/5440515 to your computer and use it in GitHub Desktop.
Closes all Maya application windows in the scene, leaving only the main Maya window and the Script Editor.
// MEL
$allWindows = `lsUI -windows`;
for ($window in $allWindows)
if ($window != "MayaWindow" && $window!= "scriptEditorPanel1Window")
deleteUI $window;
evalDeferred "deleteUI scriptEditorPanel1Window";
# Python
import maya.cmds as cmds
allWindows = cmds.lsUI (windows=True)
window = [name for name in allWindows if name != "MayaWindow"]
cmds.evalDeferred('cmds.deleteUI(window)');
@cardin
Copy link
Author

cardin commented Apr 23, 2013

Script now is able to close Script Editor as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment