I think what you are looking for is:
QtWidgets.QApplication.allWidgets()
QtWidgets.QApplication.allWindows()
Or
QtWidgets.QApplication.activrWindow()
mm.eval('GraphEditor')
Ge = QtWidgets.QApplication.activrWindow()
print Ge.windowTitle()
Ge.setWindowOpacity(0.5)
-M
On Thu 7 Sep, 2017, 2:50 PM Cesar Saez <[email protected]> wrote:
> Reading again, I guess it doesn't work because you are wrapping a layout
> (assuming there's an instance matching that name on the session) into a
> qwidget, I would try casting on a matching class so the bindings can do
> their job mapping the python calls to the cpp equivalent (same internal
> structure).
>
> On Sep 7, 2017 7:15 PM, "Cesar Saez" <[email protected]> wrote:
>
> In that snippet findLayout is returning the memory address of a layout
> with certain objectName (this is on the cpp side, maya is a qt application
> so all widgets have an objectName). Wrapinstance basically cast/wrap
> whatever is in that memory address into the python class you pass in (they
> have to match!), returning an instance that you can modify using the api as
> usual (we are at the python side now).
>
> Hope it makes sense,
> Cheers
>
>
> On Sep 7, 2017 3:29 PM, "Ruchit Bhatt" <[email protected]>
> wrote:
>
> See this basic test
>
> import maya.cmds as mc
> import maya.mel as mm
> import maya.OpenMayaUI as omUI
> from PySide import QtGui, QtCore
> from shiboken import wrapInstance
>
> mm.eval('GraphEditor')
>
>
> def getGraphEdtr():
> graphEdtrPtr = omUI.MQtUtil.findLayout(
> "graphEditor1Window|TearOffPane|graphEditor1")
> return wrapInstance(long(graphEdtrPtr), QtGui.QWidget)
>
> graphEdtr = getGraphEdtr()
> graphEdtr.setWindowOpacity(0.4)
>
>
> No idea why its not working
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/ccf3f5ba-c641-485a-8aa3-65a9a6a7a3d3%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/ccf3f5ba-c641-485a-8aa3-65a9a6a7a3d3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPamJi82Ce5rjZkz6LVdRvBwD%2BBs0zAbJH-DA1TTWYMqpoF7jg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPamJi82Ce5rjZkz6LVdRvBwD%2BBs0zAbJH-DA1TTWYMqpoF7jg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Best,
-M
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CA%2B7MZWuWDWNCfF8TUkARLEw2X-xaV6mX83tw50m2VjyD-vEBMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.