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/CAPamJi_dtGmz0M-Vhh4OMjZiUqoqeE8n%2BK3mP1btTnMpShtvWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to