Skip to content

Instantly share code, notes, and snippets.

@vidjuheffex
Created March 30, 2017 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vidjuheffex/9f739d6e9a7bcb99ef7d8e8e55c5ba82 to your computer and use it in GitHub Desktop.
Save vidjuheffex/9f739d6e9a7bcb99ef7d8e8e55c5ba82 to your computer and use it in GitHub Desktop.
finds all quick selection sets in the scene. Adds them to a panel to make selecting them easier
import maya.cmds as cmds
from functools import partial
class selectionSetGUI(object):
def __init__(self):
return None
def select(self, set, *args):
print set
cmds.select(set)
def populate(self):
setArray = []
setObjects = cmds.ls(exactType="objectSet")
for set in setObjects:
if cmds.sets(set, q=True, text=True) == "gCharacterSet":
setArray.append(set)
for set in setArray:
cmds.button(label=set, parent=self.mainLayout, command=partial(self.select, set))
def show(self):
self.create()
self.populate()
def create(self):
self.winID = 'Selection Set Picker'
if cmds.window(self.winID, query=True, exists=True):
cmds.deleteUI(self.winID)
self.window = cmds.window(self.winID, rtf=True, title="Selection Set Picker")
self.mainLayout = cmds.columnLayout(adj=True)
cmds.showWindow(self.window)
ssG = selectionSetGUI()
ssG.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment