def open(): ''' just a shortcut method to construct and display main window ''' window = MainWindow.getInstance() if cmds.control(MainWindow.DOCK_NAME,q=True,exists=True): cmds.control(MainWindow.DOCK_NAME,e=True,visible=True) else: cmds.dockControl(MainWindow.DOCK_NAME,l=window.createWindowTitle(),content=MainWindow.WINDOW_NAME, area='right',allowedArea=['right', 'left'], width=window.preferedWidth.get(), floating=window.preferedFloating.get(), visibleChangeCommand=window.visibilityChanged) if window.preferedFloating.get(): cmds.window(MainWindow.DOCK_NAME,e=True, topEdge=window.preferedTop.get(),leftEdge=window.preferedLeft.get(), w=window.preferedWidth.get(),h=window.preferedHeight.get()) Utils.silentCheckForUpdates() # bring tab to front; evaluate lazily as sometimes UI can show other errors and this command somehow fails cmds.evalDeferred(lambda *args: cmds.dockControl(MainWindow.DOCK_NAME,e=True,r=True)); # a bit of a fake, but can't find a better place for an infrequent save LayerEvents.layerAvailabilityChanged.addHandler(window.savePrefs, MainWindow.DOCK_NAME) return window
def open(): ''' just a shortcut method to construct and display main window ''' window = MainWindow.getInstance() window.showWindow() # don't know where to fit this in, it's just an utility warning for those trying to run # this on a different maya version if Utils.getMayaVersion() == Utils.MAYAUNSUPPORTEDVERSION: Utils.displayError('unsupported Maya version detected.') Utils.silentCheckForUpdates() return window
def open(): ''' just a shortcut method to construct and display main window ''' window = MainWindow.getInstance() window.showWindow() # don't know where to fit this in, it's just an utility warning for those trying to run # this on a different maya version if Utils.getMayaVersion()==Utils.MAYAUNSUPPORTEDVERSION: Utils.displayError('unsupported Maya version detected.') Utils.silentCheckForUpdates() return window
def open(): ''' just a shortcut method to construct and display main window ''' window = MainWindow.getInstance() if cmds.control(MainWindow.DOCK_NAME, q=True, exists=True): cmds.control(MainWindow.DOCK_NAME, e=True, visible=True) else: cmds.dockControl(MainWindow.DOCK_NAME, l=window.createWindowTitle(), content=MainWindow.WINDOW_NAME, area='right', allowedArea=['right', 'left'], width=window.preferedWidth.get(), floating=window.preferedFloating.get(), visibleChangeCommand=window.visibilityChanged) if window.preferedFloating.get(): cmds.window(MainWindow.DOCK_NAME, e=True, topEdge=window.preferedTop.get(), leftEdge=window.preferedLeft.get(), w=window.preferedWidth.get(), h=window.preferedHeight.get()) Utils.silentCheckForUpdates() # bring tab to front; evaluate lazily as sometimes UI can show other errors and this command somehow fails cmds.evalDeferred(lambda *args: cmds.dockControl( MainWindow.DOCK_NAME, e=True, r=True)) # a bit of a fake, but can't find a better place for an infrequent save LayerEvents.layerAvailabilityChanged.addHandler( window.savePrefs, MainWindow.DOCK_NAME) return window