Ejemplo n.º 1
0
def remove_exists_window(object_name):
    from maya import OpenMaya
    from maya import OpenMayaUI
    wind = OpenMayaUI.MQtUtil()
    if wind.findWindow(object_name):
        mel_command = 'deleteUI \"%s\"' % object_name
        OpenMaya.MGlobal.executeCommand(mel_command, False, True)
Ejemplo n.º 2
0
def get_top_window():
    top_window = None
    try:
        from maya import OpenMayaUI as omui
        maya_main_window_ptr = omui.MQtUtil().mainWindow()
        top_window = QtCompat.wrapInstance(long(maya_main_window_ptr),
                                           QtWidgets.QWidget)
    except ImportError, e:
        pass
Ejemplo n.º 3
0
def get_app_window():
    top_window = None
    try:
        from maya import OpenMayaUI as omui
        maya_main_window_ptr = omui.MQtUtil().mainWindow()
        top_window = wrapInstance(long(maya_main_window_ptr), QtWidgets.QMainWindow)
    except ImportError as e:
        pass
    return top_window
Ejemplo n.º 4
0
def get_window():
    ptr = mui.MQtUtil().mainWindow()

    win = shiboken2.wrapInstance(long(ptr), QtWidgets.QMainWindow)
    return win
Ejemplo n.º 5
0
def remove_exists_window(object_name):
    from maya import OpenMayaUI
    from pymel import core
    wind = OpenMayaUI.MQtUtil()
    if wind.findWindow(object_name):
        core.deleteUI(object_name)
Ejemplo n.º 6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from PySide import QtCore, QtGui
from shiboken import wrapInstance
from maya import OpenMayaUI as omui
import maya.cmds as cmds
import maya.mel as mel
import os

maya_main_window_ptr = omui.MQtUtil().mainWindow()
maya_main_window = wrapInstance(long(maya_main_window_ptr), QtGui.QWidget)

class HadanHowTo(QtGui.QWidget):
	def __init__(self):
		QtGui.QWidget.__init__(self)
		self.__build_ui()

	def __build_ui(self):
		self.setGeometry(QtCore.QRect(100, 100, 450, 500))
		self.setWindowTitle(QtGui.QApplication.translate("Hadan", "破断", None, QtGui.QApplication.UnicodeUTF8))

		title_lbl = QtGui.QLabel(self)
		title_lbl.setGeometry(QtCore.QRect(10, 0, 75, 50))
		font = QtGui.QFont()
		font.setPointSize(16)
		title_lbl.setFont(font)
		title_lbl.setText("Help")

		split_options = QtGui.QFrame(self)
Ejemplo n.º 7
0
def remove_exists_window(object_name):
    wind = OpenMayaUI.MQtUtil()
    if not wind.findWindow(object_name):
        return
    mel_command = 'deleteUI \"%s\"' % object_name
    OpenMaya.MGlobal.executeCommand(mel_command, False, True)