You didn't specify if you were actually using PyQt or not. I'm going to assume you want to just use Qt Designer,
and then be able to add your modelPanel to the window. There really isnt much different from creating this purely in the maya ui commands.
win = cmds.loadUI(f="windowTest.ui")
cmds.setParent(win)
cmds.paneLayout()
m = cmds.modelPanel()
cmds.modelPanel(m, e=True, cam="myCamera")
cmds.showWindow( win )
cmds.refresh(f=True)
In my "windowTest.ui" file, I simply created a dialog with nothing in it. And I have a camera in my scene called "myCamera"
Sometimes the new maya ui kinda lags in refreshing itself, so you would have to interact with the new dialog sometimes to
get the camera to redraw.
Are you trying to do this via PyQt? That would have a few more steps since you need to translate between maya node paths and actual Qt widgets.
-- justin
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
Panupat C.
# Error: 'parent' is not a Qt property or a signal
# Traceback (most recent call last):
# File "<maya console>", line 9, in <module>
# File "<maya console>", line 14, in __init__
# AttributeError: 'parent' is not a Qt property or a signal #
any idea ?
from PyQt4.QtGui import QWidget
import maya.cmds as cmds
from maya.OpenMayaUI import MQtUtil
def maya_window():
return sip.wrapinstance(long(MQtUtil.mainWindow()), QWidget)
def mk_view(name):
mw = QMainWindow(maya_window())
mw.setObjectName(name)
panel = cmds.modelPanel()
panel = sip.wrapinstance(long(MQtUtil.findControl(panel)), QWidget)
mw.setCentralWidget(panel)
mw.setWindowTitle(name)
mw.resize(1024, 800)
mw.update()
return mw
def main():
mk_view("MyNewWindow").show()
return 0
main()
def __init__(self, parent=None, **kwargs):
super(MyDialog, self).__init__(parent, **kwargs)
then its working and I am using 4.6
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe