Blender Git Loki

Git Commits -> Revision 8fd6f64

Revision 8fd6f64 by Ton Roosendaal (master)
February 2, 2009, 14:13 (GMT)
2.5

Sanitized the 'tweak' event.

Original idea was to have WM event system generating it
automatically. However, I first tested it via a handler
and operator, to check what kind of configurations would
be useful. It appeared to not work nice, also because
that inserting a tweak operator in a keymap is confusing.

Now 'tweaks' are generated automatically, and can be
catched by keymaps as any event. The current definition
of tweak is:

- if Left/Middle/Rightmouse pressed
if event wasn't handled by window queue (modal handlers)
start checking mousepositions

- while mousepositions are checked
- escape on any event other than mouse
- on mouse events:
- add tweak event if mousemove > 10 pixels
- stop checking for tweak if mousebutton released

- Tweak events have a define indicating mousebutton used
EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R

- In keymap definitions you can use _S or _A to map to
action or select mouse userdef.

- Event value in keymap should be KM_ANY for all tweaks,
or use one of the eight directions:
EVT_GESTURE_E, _SE, _S, _SW, _W, _NW, _N, _NE

- And of course you can add modifier checks in keymaps for it.

- Because tweaks are a result of mouse events, the handlers get
both to evaluate. That means that RMB-select + tweak will work
correctly.
In case you don't want both to be handled, for example the
CTRL+LMB 'extrude' and CTRL+LMB-tweak 'lasso select', you will
need to set the first acting on a EVT_RELEASE, this event only
gets passed on when tweak fails.

The current system allows all options, configurable, we had in 2.48,
and many more! A diagram of what's possible is on the todo. :)

Also in this commit: lasso select editmesh failed with 'zbuffer
occluded select'. Also circle-select failed.

Commit Details:

Full Hash: 8fd6f6433f0c75c94389eb78a5a35e048de8e407
SVN Revision: 18790
Parent Commit: c67952a
Lines Changed: +62, -90

17 Modified Paths:

/source/blender/blenloader/intern/readfile.c (+3, -1) (Diff)
/source/blender/editors/animation/anim_markers.c (+0, -3) (Diff)
/source/blender/editors/mesh/editmesh_mods.c (+3, -3) (Diff)
/source/blender/editors/mesh/mesh_ops.c (+2, -4) (Diff)
/source/blender/editors/space_action/action_ops.c (+0, -3) (Diff)
/source/blender/editors/space_ipo/ipo_ops.c (+0, -3) (Diff)
/source/blender/editors/space_node/node_ops.c (+0, -4) (Diff)
/source/blender/editors/space_sequencer/sequencer_ops.c (+0, -2) (Diff)
/source/blender/editors/space_view3d/view3d_ops.c (+0, -5) (Diff)
/source/blender/editors/space_view3d/view3d_select.c (+4, -0) (Diff)
/source/blender/editors/uvedit/uvedit_ops.c (+0, -3) (Diff)
/source/blender/makesdna/DNA_windowmanager_types.h (+4, -1) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+11, -16) (Diff)
/source/blender/windowmanager/intern/wm_keymap.c (+0, -9) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+31, -32) (Diff)
/source/blender/windowmanager/wm.h (+2, -0) (Diff)
/source/blender/windowmanager/WM_types.h (+2, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021