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.

1 Like

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

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

If I want my module’s “source-group-complete” event to be called after all other modules (especially after the official shotgrid ones) would a sortKey “zzz” and sortOrder “99” ensure that?

The question is related to doing post-processing after screening room completes its work