src/jmLightToolkit.py
def __lightOptimizer__toggleSync(self):
        """ Connect 'lightOptimizer' UI if button is checked. """
        if pm.pluginInfo("mtoa", q=True, loaded=True):
            if self.pushButton_lightOptimizer_sync.isChecked():
                self.pushButton_lightOptimizer_sync.setStyleSheet(self.default_stylesheet)
                self.pushButton_lightOptimizer_sync.setIcon(self.icon_sync_on)

                self.comboBox_lightOptimizer_attributes.currentIndexChanged.connect(self.__lightOptimizer__populateGrid)
                self.comboBox_lightOptimizer_attributes.currentIndexChanged.connect(self.__lightOptimizer__adaptSlider)
                self.horizontalSlider_lightOptimizer_min.valueChanged.connect(self.__lightOptimizer__populateGrid)
                self.horizontalSlider_lightOptimizer_max.valueChanged.connect(self.__lightOptimizer__populateGrid)
                self.pushButton_lightOptimizer_setValue.clicked.connect(self.__lightOptimizer__populateGrid)
                self.__lightOptimizer__populateGrid()

            else:
                    self.pushButton_lightOptimizer_sync.setStyleSheet(self.default_stylesheet)
                    self.pushButton_lightOptimizer_sync.setIcon(self.icon_sync_off)

                    try:
                        self.comboBox_lightOptimizer_attributes.currentIndexChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.comboBox_lightOptimizer_attributes.currentIndexChanged.disconnect(self.__lightOptimizer__adaptSlider)
                        self.horizontalSlider_lightOptimizer_min.valueChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.horizontalSlider_lightOptimizer_max.valueChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.pushButton_lightOptimizer_setValue.clicked.disconnect(self.__lightOptimizer__populateGrid)
                    except RuntimeError:
                        pass

                    self.listWidget_lightOptimizer.clear()

        else:
            pm.confirmDialog(title=__name__, icn="warning", message="'lightOptimizer' was designed for MtoA.", button=['OK'])
 Connect 'lightOptimizer' UI if button is checked. 
Connect 'lightOptimizer' UI if button is checked.
Connect ' lightOptimizer ' UI if button is checked .
def __lightOptimizer__toggleSync(self):
        if pm.pluginInfo("mtoa", q=True, loaded=True):
            if self.pushButton_lightOptimizer_sync.isChecked():
                self.pushButton_lightOptimizer_sync.setStyleSheet(self.default_stylesheet)
                self.pushButton_lightOptimizer_sync.setIcon(self.icon_sync_on)
                self.comboBox_lightOptimizer_attributes.currentIndexChanged.connect(self.__lightOptimizer__populateGrid)
                self.comboBox_lightOptimizer_attributes.currentIndexChanged.connect(self.__lightOptimizer__adaptSlider)
                self.horizontalSlider_lightOptimizer_min.valueChanged.connect(self.__lightOptimizer__populateGrid)
                self.horizontalSlider_lightOptimizer_max.valueChanged.connect(self.__lightOptimizer__populateGrid)
                self.pushButton_lightOptimizer_setValue.clicked.connect(self.__lightOptimizer__populateGrid)
                self.__lightOptimizer__populateGrid()
            else:
                    self.pushButton_lightOptimizer_sync.setStyleSheet(self.default_stylesheet)
                    self.pushButton_lightOptimizer_sync.setIcon(self.icon_sync_off)
                    try:
                        self.comboBox_lightOptimizer_attributes.currentIndexChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.comboBox_lightOptimizer_attributes.currentIndexChanged.disconnect(self.__lightOptimizer__adaptSlider)
                        self.horizontalSlider_lightOptimizer_min.valueChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.horizontalSlider_lightOptimizer_max.valueChanged.disconnect(self.__lightOptimizer__populateGrid)
                        self.pushButton_lightOptimizer_setValue.clicked.disconnect(self.__lightOptimizer__populateGrid)
                    except RuntimeError:
                        pass
                    self.listWidget_lightOptimizer.clear()
        else:
            pm.confirmDialog(title=__name__, icn="warning", message="'lightOptimizer' was designed for MtoA.", button=['OK'])
def __lightOptimizer__toggleSync ( self ) : if pm . pluginInfo ( "mtoa" , q = True , loaded = True ) : if self . pushButton_lightOptimizer_sync . isChecked ( ) : self . pushButton_lightOptimizer_sync . setStyleSheet ( self . default_stylesheet ) self . pushButton_lightOptimizer_sync . setIcon ( self . icon_sync_on ) self . comboBox_lightOptimizer_attributes . currentIndexChanged . connect ( self . __lightOptimizer__populateGrid ) self . comboBox_lightOptimizer_attributes . currentIndexChanged . connect ( self . __lightOptimizer__adaptSlider ) self . horizontalSlider_lightOptimizer_min . valueChanged . connect ( self . __lightOptimizer__populateGrid ) self . horizontalSlider_lightOptimizer_max . valueChanged . connect ( self . __lightOptimizer__populateGrid ) self . pushButton_lightOptimizer_setValue . clicked . connect ( self . __lightOptimizer__populateGrid ) self . __lightOptimizer__populateGrid ( ) else : self . pushButton_lightOptimizer_sync . setStyleSheet ( self . default_stylesheet ) self . pushButton_lightOptimizer_sync . setIcon ( self . icon_sync_off ) try : self . comboBox_lightOptimizer_attributes . currentIndexChanged . disconnect ( self . __lightOptimizer__populateGrid ) self . comboBox_lightOptimizer_attributes . currentIndexChanged . disconnect ( self . __lightOptimizer__adaptSlider ) self . horizontalSlider_lightOptimizer_min . valueChanged . disconnect ( self . __lightOptimizer__populateGrid ) self . horizontalSlider_lightOptimizer_max . valueChanged . disconnect ( self . __lightOptimizer__populateGrid ) self . pushButton_lightOptimizer_setValue . clicked . disconnect ( self . __lightOptimizer__populateGrid ) except RuntimeError : pass self . listWidget_lightOptimizer . clear ( ) else : pm . confirmDialog ( title = __name__ , icn = "warning" , message = "'lightOptimizer' was designed for MtoA." , button = [ 'OK' ] )
Connect 'lightOptimizer' UI if button is checked.
Connect ' lightOptimizer ' UI if button is checked .
""" Connect 'lightOptimizer' UI if button is checked. """
self