This should work:

import maya.cmds as cmdsimport maya.mel as mm

name = mm.eval("$tmp=$gMainWindow")
cmds.showWindow(name)

​
Justin


On Thu, Apr 16, 2015 at 5:13 PM Wesley Chandler <[email protected]> wrote:

> Hi guys,
>
> Does anyone know a simple way to activate Maya's Interface as the active
> window?  I have my own pop up window UI with scripts on it.  When I press a
> button on the UI, I'd like it to run a few commands, and then set the maya
> window as the active one.
>
> I've dabbled with modelEditor but it seems to only set viewport active and
> not window active.
>
> Any help is super appreciated!!
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/8d9a1601-56a3-41fe-81b1-3e02346b266d%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/8d9a1601-56a3-41fe-81b1-3e02346b266d%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/CAPGFgA2N3_ovZXdDY836r_uRkcdgrqYYr-rGoRmU8KCoXX_coA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to