How do I force a window to open to a specific size or location?
-topEdge’ and ‘
parameters used with a "window" command are used only when the window is opened for the first time. After
that Maya uses the last-used dimensions stored in your user preferences.
All is not lost, however. You can work around this in one of two ways:
- Disallow resizing of the window by using the "-sizeable false" flag. Of course, this
affects only size (‘
-width’ and ‘
-height’ parameters), and not position.
window -sizeable false -width 100 -height 100 myWindow;
- Tweak the window back to its desired dimensions after it is created.
window -e -width 100 -height 100 myWindow;
Disclaimer: You should only force these parameters when it is crucial to do so, or when it
markedly improves workflow. Circumventing user preferences is prone to annoy the users
of your tools.