W_moveMenu v1.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Wouter Gilsing
Reorganize your toolbars and menus by grouping items together and by moving items from one menu into another. The items will be removed from their original location and reappear in a location defined by the user. Check the full description for examples.
Requirements:
11.0, 10.5, 10.0, 9.0 or later
04 Jul 2017
302

W_moveMenu

Reorganize your toolbars by grouping items together and by moving items from one menu into another. The items will be removed from their original location and reappear in a location defined by the user. Ceck the full description for examples.

Having several plugins installed, or working for a studio with a bunch of custom tools, you might you might find yourself using a Nuke with an interface packed with extra icons and menus. Sometimes those extra menus might take up quite a lot of space while not being used particularly often. There might be no room left for a user’s personal tools, or the toolbar might simply appear kinda messy and distracting.

Deleting menu items is not really a good idea however, so with W_moveMenu you now have the option to simply move them instead.

After being moved, all items will preserve their shortcuts and icons, and menus will preserve all of their contents and submenus. Item will remain accessible through the tab menu, so everything will continue to work as expected.

 

Make sure to check to pdf (included in the download) for more detailed examples and instructions on how to use the tool.

 

A bunch of examples to give an impression of the possibilities:

 

Group menus together into a new menu

menu01

 

 

Append existing menus

menu

 

 

Move items directly into the root menu

anaglyph

 

 

Works with all of Nuke's menus and toolbars

(like the 'Animation' context menu)

animMenu

 

Move menu items between different menus and toolbars

crosstoolbarscombined

 

 

Please login in order to download these files.

Comments   

 
0 # Erwan Leroy 2017-07-05 19:48
Hi Wouter.
We have a similar function we're using at work, although we're using the nuke.menu().act ion() to get the QT action.
Similar to you, we had to defer the menu move after nuke has finished loading, causing a visual jump when opening nuke.
We have a bug ID 273305. Without this bug we could move the menus earlier and make it invisible for the users. This is my current pet peeve, especially with OFX plugins not letting you define where to load the menus.
 
 
0 # Wouter Gilsing 2017-07-06 09:36
Hi Erwan,

I'm using the .action() method to grab the QT action as well.

However, I found that I had to 'rebuild' the menu (loop over the items, grab the QT action per item and add it back in the destination menu), as grabbing the whole menu at once (one QT action for the whole menu, including children) would not properly update the tab menu for some reason. Besides that the moved items did not get listed any longer when trying to call them using Python, (like calling menu.items()), whilst actually being visible when looking at the menu. This is now logged as bug ID 280683.

So yea, I came across the same problems as you did ;)

I had not seen the bug report you just mentioned though. I just looked it up and the terminology in our codes (I assume the sample menu.py in the bug report was written by you) is very similar. Well, 'Great minds think alike', I guess?

Cheers
 
 
0 # Erwan Leroy 2017-07-06 12:04
We originally had a non QT way of moving the menus by looping over all the submenu. It was kind of working better in terms of behavior, however I couldn't find a way to extract the icons path, and it felt slow at startup. If you know a way to get an icon path maybe we could come up with a new solution.
 
 
0 # Cameron Smither 2021-10-04 13:57
Hi Wouter, Are you planning on updating this to work with nuke 13? Thanks
 
 
0 # Pete Zzz 2023-07-29 15:29
Hi Cameron!
I decided to post a solution that I'd found here.
You need to change "basestring" to "str" inside this great Wouter's script. There's only one instance of it inside. Error is happened because there's no "basestring" definition in Python 3, that's why it has to be changed to "str"
 

You have no rights to post comments

We have 2955 guests and 117 members online