Manage order of custom menu items

Hi all,

I’m looking for some advice on controlling the order of custom menu items created across several Modes of a single package.

Currently, we have package which implements multiple Modes. Each mode adds menu items to a specific top level menu in the main menu bar. I would like to control the order those menu items appear. I can obviously control the order within a single mode, but not across multiple modes.

So far, I haven’t been able to find any way to control this, or identify any logic to the way they currently appear. I’ve tried specifying the order of the modes in package rvload2 file, but that doesn’t appear to have any impact on menu item order.

Any tips are much appreciated.

You probably want package ordering in your init calls. Note that this also affects the order that overlapping events are handled, so if you don’t reject() an event the lower modes in the stack won’t get those.

See 12.6
https://help.autodesk.com/view/SGSUB/ENU/?guid=SG_RV_rv_manuals_rv_reference_manual_chapter_twelve_html

Note that we use the sortKey “source_setup” and the sortOrder “20”. This will ensure that our additional sourceSetup runs after the default color management.The included optional package “ocio_source_setup” is a good example of a package that does additional source setup.

(note, I haven’t validated that, but likely a good candidate and only takes one extra line on each package to test, please let us know if that worked)

Much appreciated @Michael.Kessler, that was exactly what I was after!

1 Like