Exemplo n.º 1
0
 def saveOptions(self, *args):
     '''
     save gui options for this tab. this can be directly supplied as a handler to control's "change value" events
     '''
     for group in self.controls.groups:
         Options.saveOption(self.getGroupVariable(group),
                            cmds.frameLayout(group, q=True, collapse=True))
Exemplo n.º 2
0
def create(parent, title, defaultCollapsed=False):
    '''
    creates collapsable UI group
    '''
    cmds.setParent(parent)

    optionName = "ngSkinTools_group%s_collapse" % title.replace(" ", "")

    def saveState():
        Options.saveOption(optionName,
                           cmds.frameLayout(group, q=True, collapse=True))

    group = uiWrappers.frameLayout(
        label=title,
        marginWidth=Constants.MARGIN_SPACING_HORIZONTAL,
        marginHeight=Constants.MARGIN_SPACING_VERTICAL,
        collapsable=True,
        expandCommand=saveState,
        collapseCommand=saveState)

    cmds.frameLayout(group,
                     e=True,
                     collapse=Options.loadOption(optionName,
                                                 1 if defaultCollapsed else 0))
    return cmds.columnLayout(adjustableColumn=1,
                             rowSpacing=Constants.MARGIN_SPACING_VERTICAL)
Exemplo n.º 3
0
 def __init__(self, annotation, name, value=None):
     self.annotation = annotation
     self.name = name
     self.intensityTexts = {0.0: "low", 0.33: "medium", 0.7: "high"}
     self.changeCommand = Signal()
     self.__value = Options.loadOption(name,
                                       1.0 if value is None else value)
Exemplo n.º 4
0
 def createUIGroup(self,layout,title):
     '''
     creates collapsable UI group
     '''
     cmds.setParent(layout)
     
     group = cmds.frameLayout(label=title, marginWidth=Constants.MARGIN_SPACING_HORIZONTAL,marginHeight=Constants.MARGIN_SPACING_VERTICAL, collapsable=True,
                              expandCommand=self.saveOptions,collapseCommand=self.saveOptions,
                              borderStyle='etchedIn')
     self.controls.groups.append(group)
     cmds.frameLayout(group,e=True,collapse = Options.loadOption(self.getGroupVariable(group), 0))
     return cmds.columnLayout(adjustableColumn=1,rowSpacing=Constants.MARGIN_SPACING_VERTICAL)
Exemplo n.º 5
0
    def createUIGroup(self, layout, title, defaultCollapsed=False):
        '''
        creates collapsable UI group
        '''
        cmds.setParent(layout)

        group = uiWrappers.frameLayout(
            label=title,
            marginWidth=Constants.MARGIN_SPACING_HORIZONTAL,
            marginHeight=Constants.MARGIN_SPACING_VERTICAL,
            collapsable=True,
            expandCommand=self.saveOptions,
            collapseCommand=self.saveOptions)
        self.lastCreatedGroup = group

        self.controls.groups.append(group)
        cmds.frameLayout(group,
                         e=True,
                         collapse=Options.loadOption(
                             self.getGroupVariable(group),
                             1 if defaultCollapsed else 0))
        return cmds.columnLayout(adjustableColumn=1,
                                 rowSpacing=Constants.MARGIN_SPACING_VERTICAL)
Exemplo n.º 6
0
 def saveState():
     Options.saveOption(optionName,
                        cmds.frameLayout(group, q=True, collapse=True))
Exemplo n.º 7
0
 def sliderChange(self, *args):
     self.updateIntensityDisplay()
     Options.saveOption(self.name, self.getIntensity())
     self.changeCommand.emit()
Exemplo n.º 8
0
 def __init__(self,annotation,name,value=None):
     self.annotation = annotation
     self.name = name
     self.intensityTexts = {0.0:"low",0.33:"medium",0.7:"high"}
     self.changeCommand = Signal()
     self.__value = Options.loadOption(name, 1.0 if value is None else value);
Exemplo n.º 9
0
 def sliderChange(self,*args):
     self.updateIntensityDisplay()
     Options.saveOption(self.name, self.getIntensity())
     self.changeCommand.emit()