Created
August 25, 2015 18:28
-
-
Save whoiscarlo/128b1687e70cd0b27c69 to your computer and use it in GitHub Desktop.
Get Maya Window for PyQt and PySide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PyQt | |
| import sip For pyQt | |
| from PyQt4 import QtGui | |
| try: | |
| import maya.OpenMayaUI as mui | |
| ptr = mui.MQtUtil.mainWindow() | |
| parent = sip.wrapinstance(long(ptr), QtCore.QObject) PyQt | |
| except: | |
| parent = None | |
| thisUI(parent=parent) | |
| ## For PySide | |
| import shiboken | |
| from PySide import QtGui | |
| try: | |
| import maya.OpenMayaUI as mui | |
| ptr = mui.MQtUtil.mainWindow() | |
| parent = shiboken.wrapInstance(long(ptr), QtGui.QWidget) | |
| except: | |
| parent = None | |
| thisUI(parent=parent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment