def deexVrayFastAbout(self): myAge = self.calculateAge('26,9,1986') aboutMessage = 'Deex Vray Fast was created by Damien Bataille, alias DeeX.\n' aboutMessage += 'This tool is Free and can be found on www.deex.info\n' aboutMessage += "If you like this tool, don't hesitate to say thank and encourage me by email.\n" aboutMessage += 'I am a french lighting TD and lookDev TD, ' + myAge + '.\n' aboutMessage += 'I will look for a job in VFX in Canada or USA in 2012.\n' aboutMessage += 'If you are interested to work with me, contact me.\n' aboutMessage += 'Deex' pm.confirmDialog(title='About', message=aboutMessage, button=['Close'], defaultButton='Close', cancelButton='Close', dismissString='Close')
def initialize(self): if pm.objExists('vraySettings'): if pm.getAttr('defaultRenderGlobals.currentRenderer') == 'vray': self.arsenalQuality.initializeSet() if not self.initializePythonScript(): OpenMaya.MGlobal.displayError('[Arsenal] You must to upgrade your Vray') return False self.loadArsenalPlugin() return True else: result = pm.confirmDialog(title='Set Vray', message='Vray is not your current render engine, set Vray to the current engine ?\n', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') if result == 'OK': self.loadVray() self.arsenalQuality.initializeSet() if not self.initializePythonScript(): OpenMaya.MGlobal.displayError('[Arsenal] You must to upgrade your Vray') return False self.loadArsenalPlugin() return True OpenMaya.MGlobal.displayError('[Arsenal] Can not switch to Vray engine') return False elif pm.getAttr('defaultRenderGlobals.currentRenderer') == 'vray': result = pm.confirmDialog(title='Vray setting', message='Vray settings not found, reload Vray properly ?\n', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') if result == 'OK': self.loadVray() self.arsenalQuality.initializeSet() if not self.initializePythonScript(): OpenMaya.MGlobal.displayError('[Arsenal] You must to upgrade your Vray') return False self.loadArsenalPlugin() return True else: OpenMaya.MGlobal.displayError('[Arsenal] vraySetting not found') return False else: result = pm.confirmDialog(title='Load Vray', message='Vray is not your current render engine, load Vray ?\n(take some seconds)', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') if result == 'OK': self.loadVray() self.arsenalQuality.initializeSet() if not self.initializePythonScript(): OpenMaya.MGlobal.displayError('[Arsenal] You must to upgrade your Vray') return False self.loadArsenalPlugin() return True else: OpenMaya.MGlobal.displayError('[Arsenal] Vray not loaded') return False
def prompt(msg='', opts=None, typeToReturn=None, okOnly=False, returnEmptyStringAsNone=True, **kargs): """ Get a prompt and as soon as it's done, return the results. Can be told to return a string, int or float using: typeToReturn='string' or 'int' or 'float' By default if the user enters nothing, the return value will be: None Most of the time this is useful so the return value doesn't have to be checked to ensure it isn't an empty string. To return empty strings instead, set returnEmptyStringAsNone to False """ if opts is None: opts = kargs opts.setdefault('message', msg) opts.setdefault('title', 'Maya') if okOnly: opts.setdefault('button', ['OK']) else: opts.setdefault('button', ['OK', 'Cancel']) opts.setdefault('dismissString', 'Cancel') if okOnly: result = pm.confirmDialog(**opts) text = None else: if result == 'OK': text = pm.promptDialog(query=True, text=True) else: text = None if returnEmptyStringAsNone: ## at this point text should always be in string-like form ## or the None object ## it won't be an int or float or something yet ## so it's safe to test it this way if not text: text = None if not text is None: if typeToReturn == 'string': text = str(text) if typeToReturn == 'float': text = float(text) elif typeToReturn == 'int': text = int(text) return text else: return text
import PySide.QtGui as ModQtGui return ModQtGui.QDialog( mwin ) @classmethod def infoPrompt(cls, msg='message', title='Maya' ): cls.prompt( msg=msg, title=title, okOnly=True ) return None @staticmethod def prompt( msg='', opts=None, typeToReturn=None, okOnly=False, returnEmptyStringAsNone=True, **kargs ): """ Get a prompt and as soon as it's done, return the results. Can be told to return a string, int or float using: typeToReturn='string' or 'int' or 'float' By default if the user enters nothing, the return value will be: None Most of the time this is useful so the return value doesn't have to be checked to ensure it isn't an empty string. To return empty strings instead, set returnEmptyStringAsNone to False """ if opts is None: opts = kargs opts.setdefault( 'message', msg ) opts.setdefault( 'title', 'Maya' ) if okOnly: opts.setdefault( 'button', [ 'OK' ] ) else: opts.setdefault( 'button', [ 'OK', 'Cancel'] ) opts.setdefault( 'dismissString', 'Cancel' ) if okOnly: result = pm.confirmDialog(**opts) text = None else: result = pm.promptDialog(**opts) if result == 'OK': text = pm.promptDialog(query=True, text=True) else: text = None if returnEmptyStringAsNone: ## at this point text should always be in string-like form ## or the None object ## it won't be an int or float or something yet ## so it's safe to test it this way if not text: text = None
def message_win_ui(self, win_title, win_message): pm.confirmDialog(title=win_title, message=win_message, button='Ok', defaultButton='Ok') return None