def showUI(model, ikfk_attr, uihost, fks, ik, upv, ikRot, *args): # type: (pm.nodetypes.Transform, str, str, List[str], str, str, *str) -> None try: for c in pyqt.maya_main_window().children(): if isinstance(c, IkFkTransfer): c.deleteLater() except RuntimeError: pass # Create minimal UI object ui = IkFkTransfer() ui.setModel(model) ui.setUiHost(uihost) ui.setSwitchedAttrShortName(ikfk_attr) ui.setCtrls(fks, ik, upv, ikRot) ui.setComboObj(None) ui.setComboBoxItemsFormList(["IK", "FK"]) # Delete the UI if errors occur to avoid causing winEvent # and event errors (in Maya 2014) try: ui.createUI(pyqt.maya_main_window()) ui.show() except Exception as e: import traceback ui.deleteLater() traceback.print_exc() mgear.log(e, mgear.sev_error)
def setup_channelWranglerWindow(self): self.mayaMainWindow = pyqt.maya_main_window() self.setObjectName(self.toolName) self.setWindowFlags(QtCore.Qt.Window) self.setWindowTitle("Channel Wrangler") self.resize(750, 525)
def setup_componentSettingWindow(self): self.mayaMainWindow = pyqt.maya_main_window() self.setObjectName(self.toolName) self.setWindowFlags(QtCore.Qt.Window) self.setWindowTitle(TYPE) self.resize(280, 350)
def __init__(self, guide_name="", parent=pyqt.maya_main_window()): super(DuplicateSymOptions, self).__init__(parent) self.setWindowTitle("Duplicate Symmetrical Options") self.setWindowFlags(self.windowFlags() ^ QtCore.Qt.WindowContextHelpButtonHint) self.guide_name = guide_name self.create_widgets() self.create_layout() self.create_connections() self.option = 0 # cancel
def doItByUI(self): # type: () -> None # gather settings from UI startFrame = self.startFrame_value.value() endFrame = self.endFrame_value.value() onlyKeyframes = self.onlyKeyframes_check.isChecked() # main body self.transfer(startFrame, endFrame, onlyKeyframes, self.hasIkRot) # set the new space value in the synoptic combobox if self.comboObj is not None: self.comboObj.setCurrentIndex(self.comboBoxSpaces.currentIndex()) for c in pyqt.maya_main_window().children(): if isinstance(c, anim_utils.AbstractAnimationTransfer): c.deleteLater()
def write_data_file(file_path, data={}, force=False): '''Write data to file # kwargs: file_path: the file path to write to data: the data to write f (bool): force write mode, if false, will ask for confirmation when overwriting existing files ''' # Ask for confirmation on existing file if os.path.exists(file_path) and not force: decision = basic.promptAcceptance(pyqt.maya_main_window(), "File already exists! Overwrite?", "YOU SURE?") if decision in [ QtWidgets.QMessageBox.Discard, QtWidgets.QMessageBox.Cancel ]: return # write file _exportData(data, file_path)