Set Maya Active Window

289 views
Skip to first unread message

Wesley Chandler

unread,
Apr 16, 2015, 1:13:34 AM4/16/15
to python_in...@googlegroups.com
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! :)

Justin Israel

unread,
Apr 16, 2015, 2:31:19 AM4/16/15
to python_in...@googlegroups.com
This should work:
import maya.cmds as cmds
import maya.mel as mm

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


--
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/8d9a1601-56a3-41fe-81b1-3e02346b266d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wesley Chandler

unread,
Apr 16, 2015, 4:11:52 AM4/16/15
to python_in...@googlegroups.com
Thanks Justin! that is awesome :)

----------------------------
Wesley Chandler
www.wesleychandler.com
Animator/Visual Media Artist

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/Nt5o1DxAxSw/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAPGFgA2N3_ovZXdDY836r_uRkcdgrqYYr-rGoRmU8KCoXX_coA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages