Page MenuHome

Use Menus for operator search
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Mar 2 2020, 1:25 AM.
Tokens
"Like" token, awarded by valera."Love" token, awarded by mswf."Love" token, awarded by Tetone."Burninate" token, awarded by mywa880."Love" token, awarded by HooglyBoogly."Love" token, awarded by billreynish."Love" token, awarded by brecht.

Details

Summary

This is an initial test implementation of command search code that uses menu items.

Working

  • All menu definitions are scanned.
  • Short-cuts.
  • Menu shortcuts (even if the menu items don't have shortcuts).
  • Expanding menu item & paths.
  • Use the button context store, operator-context & operator-properties.
  • Listing properties (check-boxes & enums).
  • Expanding non "MenuType" menus (such as operator menus that expand operator options).
  • Support dynamic menu titles (context menus that have a blank menu label and instead rely on the first label).
  • Grey out menu items which would display greyed out in the menu.

Open Topics

  • When to use this, possibly allow switching between operator & menu search (noting this here, however I think this would be decided on closer to the patch being finished/accepted).
  • Better filtering based on context (this is a more general issue, as scanning all menus causes items to show up which don't make sense - file selector bookmark action showing up in the 3D view for example).
  • Currently opening all menus gives a lot of Python exceptions.

    Possible solutions:
    • Add poll functions for all menus which have this issue.
    • Don't scan all menus, instead scanning the header & keymaps, to find menus accessible in the current context.

Diff Detail

Repository
rB Blender
Branch
TEMP-MENU-SEARCH (branched from master)
Build Status
Buildable 7232
Build 7232: arc lint + arc unit

Event Timeline

  • Replace unsafe strcat use with BLI_dynstr
  • Remove unused code.
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

Show sub-menu shortcuts as well as menu item shortcuts

Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Use a constant string for drawstr_sep.
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) planned changes to this revision.Mar 2 2020, 4:03 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

Simplify string copying with utility functions

Campbell Barton (campbellbarton) retitled this revision from Use Menu's for operator search to Use Menus for operator search.Mar 3 2020, 12:33 AM
  • Use menu labels when the buttons have empty text
  • Include properties in the search (checkboxes and lists of enums).
  • Expand (non menu-type) menus such as a single operator that expands one of it's enum options.
  • Support dynamic menu titles (context menus that have a blank menu label and instead rely on the first label)
  • Support translations.
  • Fix use-after-free (supporting freeing the search data in uiAfterFunc)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)