Created
March 30, 2017 19:24
-
-
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
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 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