Command order in engine

Is there an official way to control how app commands are ordered in the engine menu?

I’ve modified engine.py in tk-core to use an ordered dict instead of an normal dict for __commands and __command_pool.

That at least preserves the order I register the commands in.
I’m not sure if that would break in more complicated setups.

Hi Joe

Looking at the Maya engine as an example, the engine is responsible for how the menu is ordered.

The group order is:

  • Context menu items
  • Favourites
  • All apps

But other than those three groupings, the order in Maya’s case is specifically sorted by name. Other engines may behave differently, though.
I’m not aware of a specific scenario where an ordered dictionary would break things, but you would have to test.

Best
Phil