Skip to content

Instantly share code, notes, and snippets.

@yamadaaaaaaa
Last active March 14, 2018 05:21
Show Gist options
  • Save yamadaaaaaaa/6a918f058be38505fecc545fddfed606 to your computer and use it in GitHub Desktop.
Save yamadaaaaaaa/6a918f058be38505fecc545fddfed606 to your computer and use it in GitHub Desktop.
clean up panel for maya
# -*- coding: utf-8 -*-
# python for maya
import maya.cmds as cmds ##cmd
import maya.mel as mel ##mel
def main():
mel.eval('panelEditor("Layout");')
layoutList = cmds.textScrollList( 'PanelEditorPanelsScrollList', q = 1, allItems = 1 )
defPanelList = [u'Top View', u'Side View', u'Front View', u'Persp View', u'Outliner', \
u'Graph Editor', u'Dope Sheet', u'Trax Editor', u'Camera Sequencer', \
u'Hypergraph Hierarchy', u'Hypershade', u'Visor', u'Node Editor', \
u'Create Node', u'UV Texture Editor', u'Render View', u'Blend Shape', \
u'Dynamic Relationships Editor', u'Relationship Editor', u'Reference Editor', \
u'Component Editor', u'Paint Effects', u'Script Editor', \
u'UV Editor', u'Profiler']
for ilayoutList in layoutList:
if not ilayoutList in defPanelList:
cmds.textScrollList( 'PanelEditorPanelsScrollList', e = 1, si = ilayoutList )
mel.eval( 'panelEd_DeletePanel;' )
mel.eval( 'deleteUI $gPanelEditorWnd;' )
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment