Created
October 24, 2019 22:27
-
-
Save splinecraft/c5fbd8453079304be1bbd75936a326f5 to your computer and use it in GitHub Desktop.
from animstate discord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as mc | |
import maya.mel as mm | |
def toggleMayaWindows(key): | |
# use toggleMayaWindows("GraphEditor"), toggleMayaWindows("DopeSheet"), etc | |
windDict = {"DopeSheet": ["dopeSheetPanel1Window", "DopeSheetEditor"], | |
"GraphEditor": ["graphEditor1Window", "GraphEditor"], | |
"TraxEditor": ["clipEditorPanel1Window", "CharacterAnimationEditor"], | |
"HyperShade": ["hyperShadePanel1Window", "HypershadeWindow"], | |
"Outliner": ["outlinerPanel1Window", "OutlinerWindow"], | |
"ScriptEditor": ["scriptEditorPanel1Window", "ScriptEditor"], | |
"ReferenceEditor": ["referenceEditorPanel1Window", "ReferenceEditor"], | |
"NodeEditor": ["nodeEditorPanel1Window", "NodeEditorWindow"], | |
"TimeEditor": ["timeEditorPanel1Window", "TimeEditorWindow"]} | |
if key in windDict: | |
v = windDict[key] | |
if mc.window(v[0], exists=True): | |
mc.deleteUI(v[0]) | |
else: | |
mm.eval(v[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment