Might aswell share the other shims…
3DSMax
import MaxPlus
from Qt import QtWidgets
class UI(QtWidgets.QDialog):
def __init__(self, parent=MaxPlus.GetQMaxMainWindow()):
super(UI, self).__init__(parent)
Maya
import maya.OpenMayaUI as apiUI
import shiboken2
from Qt import QtWidgets
class UI(QtWidgets.QDialog):
def __init__(self):
ptr = apiUI.MQtUtil.mainWindow()
main_maya_window = shiboken2.wrapInstance(long(ptr), QtWidgets.QWidget)
super(UI, self).__init__(parent=main_maya_window)
MotionBuilder
import Qt
from Qt import QtGui, QtWidgets
class UI(QtWidgets.QDialog):
def __init__(self, parent=QtWidgets.QApplication.activeWindow()):
super(UI, self).__init__(parent)
Substance Designer
from Qt import QtWidgets
import sd
app = sd.getContext().getSDApplication()
uiMgr = app.getQtForPythonUIMgr()
class UI(QtWidgets.QDialog):
def __init__(self, parent=uiMgr.getMainWindow()):
super(UI, self).__init__(parent)
Blender (using bqt from the Tech-Artists.org git)
import bqt
from Qt import QtWidgets
class UI(QtWidgets.QDialog):
def __init__(self):
parent = bqt.instantiate_application().blender_widget
super(UI, self).__init__(parent)
1 Like