Blender Git Loki

Git Commits -> Revision da2ba40

Revision da2ba40 by Campbell Barton (master)
September 17, 2021, 02:57 (GMT)
UI: wait for input for operators that depend on cursor location

Support waiting for input so operators that depend on the
cursor location are usable from menus / buttons.

Use an operator type flag which the user interface code checks for,
waiting for input when run from a menu item.

This patch only supports this feature, there are no functional changes.

The motivation for this change is discoverability since some actions
were either hidden or broken when accessed from menus
(where the behavior of the operator depended on the menu location).

In general, waiting for input is *not* an efficient way to access tools,
however there are over 50 operators with a "wait_for_input" property
so this isn't introducing a new kind of interaction,
rather exposing this in a way that does not need to be hard-coded into
each operator, or having modal callbacks added for the sole purpose
of waiting for input.

Besides requiring boiler plate code using a "wait_for_input" property
has the added down-side of preventing key shortcuts from showing.
Only the menu items will enable the property,
causing them not to match key-map items.

Reviewed By: Severin

Ref D12255

Commit Details:

Full Hash: da2ba402689d7ed752b0b37ad49dce1a5851cc77
Parent Commit: 633c29f
Lines Changed: +234, -6

8 Modified Paths:

/source/blender/editors/interface/interface_handlers.c (+14, -5) (Diff)
/source/blender/editors/interface/interface_template_search_menu.c (+2, -1) (Diff)
/source/blender/makesrna/intern/rna_wm.c (+7, -0) (Diff)
/source/blender/windowmanager/intern/wm_cursors.c (+26, -0) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+166, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+6, -0) (Diff)
/source/blender/windowmanager/wm_cursors.h (+2, -0) (Diff)
/source/blender/windowmanager/WM_types.h (+11, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021