Example #1
0
 def setCurrentItemFromMaya(self):
     """Sets the current item of the combo box to the current units)"""
     
     index = 0
     currentUnits = SwitchUnitsFunctions.getCurrentUnits()
     
     if OpenMaya.MDistance.kMeters == currentUnits:
         index = self.comboBox_SelectUnits.findText(comboBoxItems['Meters'])           
     elif OpenMaya.MDistance.kCentimeters == currentUnits:
         index = self.comboBox_SelectUnits.findText(comboBoxItems['Centimeters'])
     elif OpenMaya.MDistance.kMillimeters == currentUnits:
         index = self.comboBox_SelectUnits.findText(comboBoxItems['Millimeters'])
 
     self.comboBox_SelectUnits.setCurrentIndex(index)
Example #2
0
 def switchUnits(self):
     
     currentIndex = self.comboBox_SelectUnits.currentIndex()
     currentText = self.comboBox_SelectUnits.currentText()
     
     if "Meters" == currentText:
         SwitchUnitsFunctions.switchUnitsToMeters()
     elif "Centimeters" == currentText:
         SwitchUnitsFunctions.switchUnitsToCentimeters()
     elif "Millimeters" == currentText:
         SwitchUnitsFunctions.switchUnitsToMillimeters()
 def doIt(self, args):
     """Command execution"""
     
     SwitchUnitsFunctions.switchUnitsToMeters()
Example #4
0
 def doIt(self, args):
     """Command execution"""
     
     SwitchUnitsFunctions.destroyHeadsUpDisplay()