Exemplo n.º 1
0
    def updateCards( self ):
        '''
        Updates the character cards.
        '''
        # Clear the lattice list first.
        clearLayout( self.scrollLayout )

        presetsPath = '{0}{1}/'.format( XMLUtility.FRAME_PRESETS_PATH, 'characters' )
        latticePresets = XMLUtility.getXMLInFolder( presetsPath )
        for lattice in latticePresets:
            description = 'From here you can search these documents. Enter your search words into the box below and click /"search/".'
            self.scrollLayout.addWidget( QTWidgets.latticeCard( 'characters', lattice, description, parent=self.scrollLayout ) )
Exemplo n.º 2
0
 def updateCards( self ):
     # Clear the lattice list first.
     clearLayout( self.scrollLayout )
     
     # Get all the active toggle buttons.
     for index in xrange( self.togLayout.count() ):
         button = self.togLayout.itemAt( index ).widget()
         if isinstance( button, QtGui.QToolButton ):
             if button.isChecked():
                 buttonType = button.text()
                 presetsPath = '{0}{1}/'.format( XMLUtility.FRAME_PRESETS_PATH, buttonType )
                 latticePresets = XMLUtility.getXMLInFolder( presetsPath )
                 for lattice in latticePresets:
                     description = 'From here you can search these documents. Enter your search words into the box below and click /"search/".'
                     self.scrollLayout.addWidget( latticeCard( buttonType, lattice, description, parent=self.scrollLayout ) )
Exemplo n.º 3
0
 def fillButtons( self, *args ):
     # This fills gridLayout with the appropriate buttons.        
     # Check if buttons already exist. If they do, delete them.
     gridChildren = cmds.gridLayout( self.frameGrid, query=True, childArray=True )
     if gridChildren is not None:
         for c in gridChildren:
             cmds.deleteUI( c )
     
     # Get the children of toggle buttons column.
     checkBoxChildren = cmds.rowColumnLayout( self.toggleColumn, query=True, childArray=True )
     for checkBox in checkBoxChildren:
         # Loop through the children to see if they are active.
         boxValue = cmds.symbolCheckBox( checkBox, query=True, value=True )
         if boxValue == True:
             # If the button is active then we need to make the appropriate frame
             # buttons in the grid layout.
             boxAnno = cmds.symbolCheckBox( checkBox, query=True, annotation=True )
             frameFiles = XMLUtility.getXMLInFolder( XMLUtility.FRAME_PRESETS_PATH+boxAnno+'/' )   
             for frame in frameFiles:
                 # Make the grid layout buttons. The label is the file name, while
                 # the annotation is the folder name.
                 cmds.button( parent=self.frameGrid, label=frame, annotation=boxAnno, command=lambda v, a1=frame, a2=boxAnno: buttonTest(v, a1, a2) )