When Googling, I see various mentions of a UI overrride, to provide your
own UI initialization instead of getting the entire Maya app. But I dont
think you can do that from Maya standalone, which does not load any gui
stuffs


On Fri, Jul 5, 2013 at 4:34 PM, Mathew Schwartz <[email protected]> wrote:

> thanks justin, im on windows and could not find how to port the QX11Embed.
>  However, when running the maya side the result is : <sip.voidptr object at
> 0x161881A0>  which changes each time maya is loaded, so i guess there would
> need to be some autoloaded script that would communicate tcp/ip to my
> program to get the window?
>
> Do you know if it is possible to open a window from maya standalone?  I
> found this code that is working for me, so it would be nice if i could do
> all this from the standalone.
>
> import os
> import sys
>
> #====================================================================#
> #THESE ARE THE MISSING STUFF WHEN RUNNING python.exe compared with
> mayapy.exe
> #====================================================================#
>
> os.environ["MAYA_LOCATION"] = "C:\Program Files\Autodesk\Maya2013"
> os.environ["PYTHONHOME"]    = "C:\Program Files\Autodesk\Maya2013\Python"
> os.environ["PATH"] = "C:\\Program Files\\Autodesk\\Maya2013\\bin;" +
> os.environ["PATH"]
>
> sys.path.append("C:\Program Files\Autodesk\Maya2013\\bin\python26.zip")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\Python\DLLs")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\Python\lib")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\Python\lib\plat-win")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\Python\lib\lib-tk")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\\bin")
> sys.path.append("C:\Program Files\Autodesk\Maya2013\Python")
> sys.path.append("C:\Program
> Files\Autodesk\Maya2013\Python\lib\site-packages")
>
>
> import maya.standalone
> maya.standalone.initialize(name='python')
>
>
> On Mon, Jun 24, 2013 at 12:43 PM, Justin Israel <[email protected]>wrote:
>
>> 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.
>>
>>
>>
>
>  --
> 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