Change shelf height automatically for certain shelves?


#1

Hello. I’m growing tired of manually resizing the shelf height with hotkeys and would like a way to make it autoadjust for shelves that contain more than one row. Best case scenario would be for it to manage it all on its own, but setting a number of rows for specified shelves would also work.

I figured a scriptjob would solve it, but it seems there are no flags called “shelf tab change”
I need an event to make it fire off my function in the first place. The function would just look at the selected shelf and if its name matches the name with the shelf I want to adjust, it will add one row(or how many else I’d need). Changing to another shelf after that makes it go back to one row again.

I’ve been using hjChangeShelfHeight.mel with the command shelfHeightAdd and it works great since it goes back to one row when switching shelves.

Any help, please!

Best regards, Dag


#2

Ah, so I found a solution. I’ve modified my menuChangedCallback script and just put the rezizing in there for this one shelf. It works as long as I use the F2 key. good enough for now.


#3

Better yet!
Found the script shelf.mel in the install directory, copied and modified that so now it works all the time since the procedure shelfTabChange runs whenever you change shelf using any method you use to change the shelf.


#4

Perhaps a better option to copying the shelf.mel file is to simply create a new script with a copy of the shelfTabChange global proc and source that script. It should redefine the shelfTabChange global proc.

This way if shelf.mel were to ever change (short of changing shelfTabChange itself), your Maya won’t break.

The best way to ensure that shelfTabChange is overwritten with your copy is to source shelf.mel just before you redefine the proc.


#5

Ah yes, wise!
Thanks!