Tuesday, November 08, 2011

Fixing Toolbar Issues in Maya 2012

One of the guys at work came to me with an odd problem: he couldn't get the Tool Settings dialog to appear. Clicking the middle button in the upper-right corner of Maya's main window normally makes this dockable dialog pop into view just to the left of the main viewport. In this case, it just made the viewport edge shift ever-so-slightly from left to right. It didn't create the usual drag bar, so we couldn't force the width using the mouse. Restarting Maya did no good. After digging into the UI elements, I found that the width of the dialog's main formLayout was at 0. However, forcing it to a different value did absolutely nothing.

I was pretty sure that Autodesk had to have created a way of keeping track of all those nifty dockables in Maya 2012, and it took a while to figure out where they put it. While the file where this data is stored is not exactly formatted for human eyeballs, I was able to read a bunch of things like "dockState," "dockControl," "dockWidget," and "toolBar", though, so I was pretty confident that I had the right thing. We closed Maya, renamed the file, opened Maya, and presto! The Tool Settings panel was working again!

If you run into this problem, the file in question is named "startupMainWindowState", and is the lone file stored in Maya's prefs/mainWindowStates folder. As I said above, it's not anything can can be edited manually (at least not easily). However, Autodesk did create a simple way to save and load the settings contained in this file. In the windowPref command, there are a couple flags that do the job: saveMainWindowState and restoreMainWindowState. If you make your own dockable windows or toolbars, those commands should let you save and restore their state so that you don't have to manually re-position them every time you make them. I haven't tested them yet, but I plan on doing so tomorrow, and will update this post with my findings.

3 comments:

Lee Dunham said...

another fix i found was simply open the tool settings for a tool (ie paint skin weights tool[options]) seemed to do the trick :)

Justin S Barrett said...

Thanks for the comment! However, the issue we had was that the tool settings wouldn't open. At all. The underlying PyQt interface had wigged out in such a way that it wouldn't come up, and the only way to fix that was to obliterate (or rename) the settings file that Maya uses to track that stuff.

Anonymous said...

Thanks for the hint - I was able to restore the panel by double-clicking one of the tools in the toolbar, which does the same thing Idunham suggested.