From 480be71514a010549b62c302e2bb1216c4339b0c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 30 Jan 2009 18:18:41 +0000 Subject: 2.5 - Edit mesh: Add ctrl+click add vertex or extrude. I've made it not move the 3d cursor in that case. Also found out tweak events conflicted with existing keymap definitions; on tweak failure (= no mousemove) it now passes on the mouse event as 'mouse down' for the remaining keymaps to check. These then actually respond to mouse-up instead of down... The location in the keymaps where tweaks get generated remains important. Examples: 1 - 'select' mouse-handler, operator return pass-through 2 - tweak handler checks, and makes tweak event 3 - grabber responds to tweak event 1 - ctrl+mouse tweak handler checks, makes tweak event, or passes event on 2 - if tweak event, it runs lasso 3 - else when passed on, ctrl+click extrude happens In the first case, select works on mouse-down, immediate. In the second case, extrude happens on mouse-release, even though the keymap defined mouse-press. This will make designing nice balanced keymaps still not simple; especially because you can't tell operators to pass on the key... although we can add the convention that select-mouse operators always pass on to enable tweaks. Still a good reason to wait with custom keymaps when this is fully settled! --- source/blender/editors/space_view3d/view3d_ops.c | 8 +++++--- source/blender/editors/space_view3d/view3d_select.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/space_view3d') diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 049c6564429..81c87260af1 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -153,8 +153,8 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "type", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_borderselect", BKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_lasso_select", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_lasso_select", LEFTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", 1); + WM_keymap_add_item(keymap, "VIEW3D_OT_lasso_select", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_lasso_select", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "type", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_circle_select", CKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_clipping", BKEY, KM_PRESS, KM_ALT, 0); @@ -182,7 +182,9 @@ void view3d_keymap(wmWindowManager *wm) transform_keymap_for_space(wm, keymap, SPACE_VIEW3D); /* generates event, in end to make select work */ - WM_keymap_verify_item(keymap, "WM_OT_tweak_gesture", SELECTMOUSE, KM_PRESS, 0, 0); + WM_keymap_tweak(keymap, SELECTMOUSE, KM_PRESS, 0, 0); + /* tweak event for border, lasso, etc */ + WM_keymap_tweak(keymap, ACTIONMOUSE, KM_PRESS, KM_CTRL, 0); } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 49d941f3d36..73ceb5c7fdb 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -702,13 +702,16 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) } RNA_END; - /* setup view context for argument to callbacks */ - view3d_set_viewcontext(C, &vc); - - select= RNA_enum_is_equal(op->ptr, "type", "SELECT"); - view3d_lasso_select(&vc, mcords, i, select); - - return OPERATOR_FINISHED; + if(i>1) { + /* setup view context for argument to callbacks */ + view3d_set_viewcontext(C, &vc); + + select= RNA_enum_is_equal(op->ptr, "type", "SELECT"); + view3d_lasso_select(&vc, mcords, i, select); + + return OPERATOR_FINISHED; + } + return OPERATOR_PASS_THROUGH; } void VIEW3D_OT_lasso_select(wmOperatorType *ot) -- cgit v1.2.3