I'm really puzzled by this, it's not necessarily a scripting question, but it's a problem that prevents a script from working on multiple installs.
Problem: the material editor window width seems to differ randomly (probably not, but seems so) between different max installs on different computers. Some computers will have a wider editor on one Max install but a smaller one on another. Another PC has a smaller window than the other computer with the exact same max version...
the setting I'm talking about is the X-dimensions of the Compact material editor. You can check it in the 3DS Max.ini, under [MtlEditorPosition] is MainWindow= xposition yposition xsize ysize. The only relevant number is xsize, as you can move the window freely and rescale it freely in height (ysize). The X-size however, is locked from user interaction...
The result is our script's interface is cut off on many Max installs/pc's, without any way of checking/fixing this. We've personally checked 4 pc's, some have an xsize of 375, some are at 496, I've seen 367 pass by too.
Can anybody shed some light on this? Changing the ini doesn't help, as it resets back to the previous value on startup.
Replies
just found out a lot is possible so with the SetWindowPos function it might work
example
http://forums.cgsociety.org/showthread.php?t=898647
but an easier way would be to edit the max ini, it's strange that it resets
if you'd get it to work you could do a
setINISetting (getMAXIniFile()) "MtlEditorPosition" "MainWindow" "thesizesyouwanttogive"
to apply the size changes for each user using the script
The directx material's ui falls off the right of the rollout. I cannot specifically remember how we fixed it but it was fiddling with windows that sorted it.
Also, (this one makes me chuckle) we had some users who are not using aero theme in windows 7, who could not get quad menu to appear in uv unwrap window when it was located on the 2nd screen of a dual monitor setup (you know, like mostly all the artists in production probably). Fix = use aero theme.
Bah humbug!
Raven: thanks, the win32 stuff looks powerfull but some bits are beyond my understanding at the moment. I get the hwnd stuff and all, but not a lot of the supporting code.
I tried setting the ini through maxscript already: same result, you can change ALL other vars through script (x, y pos, y size) but not the xsize... great!
cw: so if i understand, you had something very similar and managed to fix it through windows settings? Would be cool if you had any more pointers?
LEt me know how it goes - I will ask around at work in case the victim can remember what I did,. I forget the exact details.