Here is something fun to try (this only works on linux as far as I know). I
am sure there are alternative ways on other platforms.

# From the maya script editor,
# get the window ID of the persp panel
import maya.OpenMayaUI as mui
from PyQt4 import QtCore, QtGui
import sip

w = sip.wrapinstance(long(mui.MQtUtil.findControl("modelPanel4")),
QtGui.QWidget)
print w.winId()
# 96470814

# ---------------------------------

# Then in some standalone script or python terminal,
# hijack it into your own widget ##
container = QtGui.QX11EmbedContainer()
container.show()
# Use the window ID of the modelPanel4
container.embedClient(96470814)

You could probably launch an subprocess instance of maya in a full gui
session, hidden, and steal the windows :-)





On Mon, Jun 24, 2013 at 11:54 AM, Mathew Schwartz <[email protected]> wrote:

> does that mean maya has to be open and then assign a window to the qwidget
> or can it just be loaded through a python command?
>
> Does anyone know how to to this.  I imagine if justin doesnt, it will be
> hard to find someone who does :)
>
>
> On Fri, Jun 21, 2013 at 1:32 PM, Justin Israel <[email protected]>wrote:
>
>> I don't know exactly how to go about it, but I know it's possible to use
>> the window Id of a widget/window in maya and set it on a QWidget.
>>
>>
>> On Fri, Jun 21, 2013 at 3:07 PM, Mathew Schwartz <[email protected]>wrote:
>>
>>>  I remember reading that it is possible to run maya from a command line
>>> so I am wondering if it is possible to load a maya opengl window in a
>>> custom qt program just like a widget.  If so, can I also import the maya
>>> namespace and use maya functions?
>>>
>>> To be more specific, I have some python program using pyqt and I use
>>> some graphic widgets with matplotlib.  I would like to extend the
>>> capability and add more functions and was wondering if it is possible with
>>> maya.
>>>
>>> If so, are there any tutorials on how to do this?
>>>
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected]
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to