def maya_main_window(): """Get Maya's main window Returns: QMainWindow: main window. """ main_window_ptr = omui.MQtUtil.mainWindow() if PY2: return QtCompat.wrapInstance(long(main_window_ptr), QtWidgets.QWidget) return QtCompat.wrapInstance(int(main_window_ptr), QtWidgets.QWidget)
def getMayaWindow(): """Gets Maya main window Returns: QMainWindow: Maya window """ ptr = OpenMayaUI.MQtUtil.mainWindow() return QtCompat.wrapInstance(long(ptr), QtWidgets.QMainWindow)
def connectMaya(self): # type: () -> None # script job callback # ptr = long(QtCompat.getCppPointer(self)[0]) # ptr = long(QtCompat.getCppPointer(self)) ptr = QtCompat.getCppPointer(self) gui = OpenMayaUI.MQtUtil.fullName(ptr) self.selJob = pm.scriptJob(e=("SelectionChanged", self.selectChanged), parent=gui)