W_moveMenu v1.0
This location is for Registered Users Only.
Perhaps you need to login or register.
11.0, 10.5, 10.0, 9.0 or later


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
Append existing menus
Move items directly into the root menu
Works with all of Nuke's menus and toolbars
(like the 'Animation' context menu)
Move menu items between different menus and toolbars
Comments
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.
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
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"
RSS feed for comments to this post