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)
--To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ccf3f5ba-c641-485a-8aa3-65a9a6a7a3d3%40googlegroups.com.
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 python_inside_maya+unsub...@googlegroups.com.
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" <ruchitinn...@gmail.com> 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 python_inside_maya+unsubscribe@googlegroups.com.
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
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" <ces...@gmail.com> 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" <ruchitinn...@gmail.com> 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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ccf3f5ba-c641-485a-8aa3-65a9a6a7a3d3%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPamJi82Ce5rjZkz6LVdRvBwD%2BBs0zAbJH-DA1TTWYMqpoF7jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
@
Mahendra Gangaiwar
Thnxdict((w.objectName(), w) for w in QtWidgets.QApplication.allWidgets())
dict((w.objectName(), w) for w in QtWidgets.QApplication.allWindows())
is super useful to get objectName of all instance.But
mm.eval('GraphEditor')
Ge = QtWidgets.QApplication.activeWindow()
print Ge.windowTitle()
Ge.setWindowOpacity(0.5)
This is still not working (print Ge.windowTitle() #Result Script Editor
)
Let's take one more example, in ReferenceEditor if i want to select item02(i.e Test03RN Test03.ma) & item03(i.e Test04RN Test04.ma) inside refEdEditorPane. How can i do that via PySide ??
Before
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5b191296-a7e9-4768-86fb-9e8013861834%40googlegroups.com.