window position?

21 views
Skip to first unread message

miarmy

unread,
Jan 12, 2015, 6:27:30 AM1/12/15
to python_in...@googlegroups.com
hi....
how quary position of a window?
#example:
mc.window('test')
mc.showWindow()
now how quary position of test window in screen?

Todd Widup

unread,
Jan 12, 2015, 11:59:32 AM1/12/15
to python_in...@googlegroups.com
def gatherWindows(off = 25):
    tlc = [0,0]
    for win in pm.lsUI(type="window"): # loops thru all windows other than "main"
        if pm.window(win, ex =1):
            if pm.window(win, q=1,mw=1):
                tlc = pm.window(win, q=1,tlc=1)         
   
    for x,win in enumerate(pm.lsUI(type="window")):
        if not re.match("MayaWindow",str(win)):
            pm.window(win, e=1, tlc=[tlc[0] + off, tlc[1] + off]) # tlc = topLeftCorner
            off = off + 25   


that's a small util I wrote to deal with windows appearing off screen. 

you can easily query by using pm.windows(winName, q=1, tlc=1)
that will return in a list or tupple (not sure which) the top edge and the left side positions.



--
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/bfbf2eb1-ea97-49d4-8bff-bbfc5652d255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Todd Widup
Creature TD / Technical Artist
to...@toddwidup.com
todd....@gmail.com
www.toddwidup.com

miarmy

unread,
Jan 12, 2015, 6:10:17 PM1/12/15
to python_in...@googlegroups.com
yes!ok! and thank!
Reply all
Reply to author
Forward
0 new messages