コード例 #1
0
ファイル: mayautils.py プロジェクト: jubeyjose/maya-prefs
def get_maya_window():
    winptr = mui.MQtUtil.mainWindow()
    if winptr is None:
        raise RuntimeError("No maya window found.")
    window = wrapinstance(winptr)
    assert isinstance(window, QtWidgets.QMainWindow)
    return window
コード例 #2
0
ファイル: mayautils.py プロジェクト: Italic-/maya-scripts
def get_maya_window():
    winptr = mui.MQtUtil.mainWindow()
    if winptr is None:
        raise RuntimeError("No maya window found.")
    window = wrapinstance(winptr)
    assert isinstance(window, QtWidgets.QMainWindow)
    return window
コード例 #3
0
def getMayaWindow():
    ptr = mui.MQtUtil.mainWindow()
    if ptr is None:
        raise RuntimeError('No Maya window found.')
    window = wrapinstance(ptr)
    assert isinstance(window, QtGui.QMainWindow)
    return window
コード例 #4
0
def getMayaWindow():
    ptr = mui.MQtUtil.mainWindow()
    if ptr is None:
        raise RuntimeError('No Maya window found.')
    window = wrapinstance(ptr)
    assert isinstance(window, QtGui.QMainWindow)
    return window
コード例 #5
0
def get_maya_window():
    """Return the QMainWindow for the main Maya window."""
    winptr = OpenMayaUI.MQtUtil.mainWindow()
    if winptr is None:
        raise RuntimeError('No Maya window found.')
    window = wrapinstance(winptr)
    assert isinstance(window, QtGui.QMainWindow)
    return window
コード例 #6
0
def uipath_to_qtobject(pathstr):
    """Return the QtObject for a Maya UI path to a control,
    layout, or menu item.
    Return None if no item is found.
    """
    ptr = OpenMayaUI.MQtUtil.findControl(pathstr)
    if ptr is None:
        ptr = OpenMayaUI.MQtUtil.findLayout(pathstr)
    if ptr is None:
        ptr = OpenMayaUI.MQtUtil.findMenuItem(pathstr)
    if ptr is not None:
        return wrapinstance(ptr)
    return None