def getMayaWindow(): ''' return maya window by Qt object.. ''' ptr = apiUI.MQtUtil_mainWindow() if ptr is not None: return sip.wrapinstance(long(ptr),QtCore.QObject)
def getMayaWindow(): ptr = apiUI.MQtUtil_mainWindow() if ptr is not None: if iv < 2017: return shiboken.wrapInstance(long(ptr), QtWidgets.QWidget) else: return shiboken2.wrapInstance(long(ptr), QtWidgets.QWidget)
def getMayaWindow(*args, **kw): ptr = apiUI.MQtUtil_mainWindow() if ptr is not None: try: return shiboken.wrapInstance(long(ptr), QtWidgets.QWidget) except: return shiboken2.wrapInstance(long(ptr), QtWidgets.QWidget)
def getMayaMainWindow(): """ :return: maya main window as a python object """ win = omui.MQtUtil_mainWindow() ptr = wrapInstance(int(win), QtWidgets.QMainWindow) return ptr
def get_maya_main_window(): # Get the memory address of the main window win = omui.MQtUtil_mainWindow() # Convert it into a wrap instance mainWindowPointer = wrapInstance(long(win), QtWidgets.QMainWindow) return mainWindowPointer
def getMainWindow(): '''This function should be overriden''' if BoilerDict['Environment'] == 'Maya': win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr if BoilerDict['Environment'] == '3dsMax': try: mainWindow = MaxPlus.GetQMaxWindow() except AttributeError: None None None mainWindow = MaxPlus.GetQMaxMainWindow() return mainWindow if BoilerDict['Environment'] == 'Houdini': return hou.qt.mainWindow() if BoilerDict['Environment'] == 'Nuke': for obj in QtWidgets.QApplication.instance().topLevelWidgets(): if ( obj.inherits("QMainWindow") and obj.metaObject().className() == "Foundry::UI::DockMainWindow" ): return obj else: raise RuntimeError("Could not find DockMainWindow instance") return None if BoilerDict['Environment'] == 'Hiero': return hiero.ui.mainWindow()
def get_maya_main_window(): """ Find the Maya main window and wrap it using shiboken2. :return: A QtWidget pointing to Maya main window """ win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): """ Returns: pointer QtWidgets.QMainWindow: The Maya MainWindow """ win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): """ Gets the memory adress of the main window to connect Qt dialog to it. Returns: (long) Memory Adress """ win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def get_maya_main_window(): """Function to get the maya's main window. Returns: QtWidgets.QMainWindow: The Maya MainWindow. """ # Using the OpenMayaUI API to get a reference to Maya's MainWindow win = _omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): """ Gets the memory adress of the main window to connect Qt dialog to it. Returns: (long) Memory Adress """ ## This will give the memory adress of the main window win = omui.MQtUtil_mainWindow() ## put memory adress into a long integer and wrap it as QMainWindow ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def GetMayaMainWindow(): from ... import Qt from ...Qt import QtWidgets if Qt.IsPySide2: import shiboken2 as shiboken else: import shiboken return shiboken.wrapInstance(long(OpenMayaUI.MQtUtil_mainWindow()), QtWidgets.QMainWindow)
def getMayaMainWindow(): """ Since Maya is Qt, we can parent our UIs to it. This means that we don't have to manage our UI and can leave it to Maya. Returns: QtWidgets.QMainWindow: The Maya MainWindow """ # open maya to get a reference to maya's main window win = omui.MQtUtil_mainWindow() # transform to something python can understand ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): """ Since maya is Qt, we can _parent our UIs to it. This means that we don't have to manage our UI and can leave it to maya. Returns: QtWidgets.QMainWindow: The maya MainWindow """ # Use the OpenMayaUI API to get a reference to Maya_tk's MainWindow win = omui.MQtUtil_mainWindow() # Use the wrapInstance method to convert it to something python can understand (QMainWindow) ptr = wrapInstance(long(win), QtWidgets.QMainWindow) # Return this to whoever wants it return ptr
def getMayaMainWindow(): """ Since Maya is Qt, we can parent our UIs to it. This means that we don't have to manage our UI and can leave it to Maya. Returns: QtWidgets.QMainWindow: The Maya MainWindow """ # We use the OpenMayaUI API to get a reference to Maya's MainWindow win = omui.MQtUtil_mainWindow() # Then we can use the wrapInstance method to convert it to something python can understand # In this case, we're converting it to a QMainWindow ptr = wrapInstance(long(win), QtWidgets.QMainWindow) # Finally we return this to whoever wants it return ptr
def getMayaMainWindow(size=True): """ Get the Qt main window from Maya @return ptr :QtWidgets.QMainWindow: The Maya MainWindow """ # We use the OpenMayaUI API to get a reference to Maya's MainWindow win = omui.MQtUtil_mainWindow() # Then we can use the wrapInstance method to convert it to something python can understand ptr = wrapInstance(long(win), QtWidgets.QMainWindow) if size: return [ptr.width(), ptr.height()] return ptr
def getMayaMainWindow(): """ Since Maya is Qt, we can parent our UIs to it. This means that we don't have to manage our UI and can leave it to Maya. Returns: QtWidgets.QMainWindow: The Maya MainWindow """ # Get a reference to Maya's MainWindow win = omui.MQtUtil_mainWindow() # Wrap the window reference into Qt ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMainWindow(): """This function should be overriden""" if BoilerDict["Environment"] == "Maya": win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr elif BoilerDict["Environment"] == "3dsMax": return MaxPlus.GetQMaxWindow() elif BoilerDict["Environment"] == "Houdini": return hou.qt.mainWindow() elif BoilerDict["Environment"] == "Nuke": # TODO // Needs a main window getter for nuke return None else: return None
def getMayaMainWindow(): if hasattr(Qt, "IsPySide2"): if Qt.IsPySide2: import shiboken2 as shiboken else: import shiboken # Qt version less than 1.0.0 elif hasattr(Qt, "__version_info__"): if Qt.__version_info__[0] >= 2: import shiboken2 as shiboken else: import shiboken else: try: import shiboken2 as shiboken except: import shiboken return shiboken.wrapInstance(long(OpenMayaUI.MQtUtil_mainWindow()), QtWidgets.QMainWindow)
def getMayaMainWindow(): # Get memory address of the main window and convert it to something our Python lib will understand win = omui.MQtUtil_mainWindow() # Convert address into a long integer ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): window = omui.MQtUtil_mainWindow() pointer = wrapInstance(long(window), QtWidgets.QMainWindow) return pointer
def getMayaWindow(): # get maya main window win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def GetMayaMainWindow(): win = opui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def maya_main_window(): """Return the Maya main window widget""" main_window = omui.MQtUtil_mainWindow() return wrapInstance(long(main_window), QtWidgets.QWidget)
def getMayaMainWindow(): win = omui.MQtUtil_mainWindow() #Convert memory address into long ptr = wrapInstance(long(win), QtWidgets.QMainWindow) return ptr
def getMayaMainWindow(): win = omui.MQtUtil_mainWindow() ptr = wrapInstance(long(win), QtWidgets.QMainWindow) # convert to Qt return ptr
def getMayaMainWindow(): maya_ptr = OpenMayaUI.MQtUtil_mainWindow() return shiboken.wrapInstance(maya_ptr, QtGui.QMainWindow)