Skip to content

Instantly share code, notes, and snippets.

@lapaev
Last active January 4, 2016 05:31
Show Gist options
  • Select an option

  • Save lapaev/a2509c9288cd6a1b7cc7 to your computer and use it in GitHub Desktop.

Select an option

Save lapaev/a2509c9288cd6a1b7cc7 to your computer and use it in GitHub Desktop.
Opens separate outliner window and filters materials
def RShowMatsOutliner():
#check if window exists
if (cmds.window("R_MaterialLister", exists=True)):
cmds.deleteUI("R_MaterialLister")
else:
# window and mainLayout
window = cmds.window("R_MaterialLister", title="Material Lister")
form = cmds.formLayout(numberOfDivisions=100, width=100)
panel = cmds.outlinerPanel()
outliner = cmds.outlinerPanel(panel, query=True,outlinerEditor=True)
cmds.outlinerEditor( outliner, edit=True, mainListConnection='worldList', selectionConnection='modelList', showShapes=False, showAttributes=False, showConnected=False, showAnimCurvesOnly=False, autoExpand=False, showDagOnly=False, ignoreDagHierarchy=False, expandConnections=False, showNamespace=True, showCompounds=True, showNumericAttrsOnly=False, highlightActive=True, autoSelectNewObjects=False, doNotSelectNewObjects=False, transmitFilters=False, showSetMembers=True, setFilter='defaultSetFilter' )
cmds.formLayout( form, edit=True, attachForm=[(panel, 'top', -48), (panel, 'left', 0), (panel, 'right', 0), (panel, 'bottom', 0)] )
cmds.showWindow(window)
#set material filter
sel_mem = cmds.ls(sl=True)
sceneshaders = cmds.ls(mat=True)
cmds.select(sceneshaders)
mel.eval('filterUIFilterSelection %s "filler"' %panel)
cmds.select(sel_mem)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment