Problem summary
Reordering menu items using 'index=0' does not work when creating a menu inside of the node toolbar using the "
nuke.menu("Nodes")" operation.
Customer reported version
nuke.10.0v4
Customer reported platform
centos7
Steps to reproduce
1) Copy the following code snippet into menu.py using a text editor and save
menubar = nuke.menu("Nuke")m = menubar.addMenu("TestMenu", icon="Blur.png", index=0)m.addCommand("A", "Test", index=1)m.addCommand("B", "Test", index=0)m.addCommand("C", "Test", index=2)m.addCommand("D", "Test", index=3)toolbar = nuke.menu("Nodes")t = toolbar.addMenu("TestMenu", icon="Blur.png", index=0)t.addCommand("A", "Test", index=1)t.addCommand("B", "Test", index=0)t.addCommand("C", "Test", index=2)t.addCommand("D", "Test", index=3)
2) Open Nuke
3) You will see there is now a 'blur' logo in the top left of the 'menubar' and one at the bottom of the 'toolbar'
4) Close Nuke
5) Open menu.py again in a text editor
6) Change the value of the 'index' in the menu bar to '5' like below
m = menubar.addMenu("TestMenu", icon="Blur.png", index=5)
7) Change the value of the 'index' in the toolbar menu to '5' like below
t = toolbar.addMenu("TestMenu", icon="Blur.png", index=5)
8) Save and close menu.py
9) Open Nuke and you will see in the 'menubar' that the index operation has moved the 'blur' logo over 5 items, but the toolbar has not moved the blur up 5 items.
Result: Menu in Toolbar does not move when index changed
10) After testing delete the added code into menu.py and re-save to open Nuke without added menu's
Workaround
Unknown.
Reproduced by support
This bug has been reproduced on:
Nuke 11.0v1 - CentOS 6.9 - Windows 7 - MacOSX 10.12
Nuke 10.5v5 - CentOS 6.9
Nuke 10.5v1 - CentOS 6.9
Nuke 10.0v5 - CentOS 6.9 - Windows 7 - MacOSX 10.12
Nuke 10.0v1 - CentOS 6.9
Nuke 9.0v9 - CentOS 6.9
Nuke 9.0v1 - CentOS 6.9
Nuke 8.0v7 - CentOS 6.9
Nuke 8.0v1 - CentOS 6.9
Nuke 7.0v10 - CentOS 6.9 - Windows 7 - MacOSX 10.12
Earliest version tested
Nuke 7.0v10 - Earliest required version for regression testing.
Expected behaviour
You should be able to re-order the toolbar items using the same command you can for menu items, index=0.
Actual behaviour
Using index=0 has no effect on the order of the toolbar items.