2.5
authorTon Roosendaal <ton@blender.org>
Sun, 16 Aug 2009 18:25:22 +0000 (18:25 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 16 Aug 2009 18:25:22 +0000 (18:25 +0000)
Another keymap goodie for test fun: Tweak events allow to be limited
to a direction, like North, South-West, etc.

Tested with View3D keymap for border, circle & lasso. Issue to look at
still is whether a border should start immediate, or first draw a cross...
this can be an operator property of course.

Note that tweak code can be extended to corner-gestures too (so you can
do a north+east, north+west, and so on... nice for later).

Time to get keymap saving work! :)

(Fixed bug in Mesh edit circle select, missing notifier)

source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_view3d/view3d_select.c

index e676b429687e5781e6a5c92d03ca62623f057607..ac47c518c469e26f89ca07b23395f732e6b5bd43 100644 (file)
@@ -5081,6 +5081,28 @@ static char *keymap_tweak_menu(void)
        return string;
 }
 
+static char *keymap_tweak_dir_menu(void)
+{
+       static char string[500];
+       static char formatstr[] = "|%s %%x%d";
+       char *str= string;
+       
+       str += sprintf(str, "Tweak Direction %%t");
+       
+       str += sprintf(str, formatstr, "Any", KM_ANY);
+       str += sprintf(str, formatstr, "North", EVT_GESTURE_N);
+       str += sprintf(str, formatstr, "North-East", EVT_GESTURE_NE);
+       str += sprintf(str, formatstr, "East", EVT_GESTURE_E);
+       str += sprintf(str, formatstr, "Sout-East", EVT_GESTURE_SE);
+       str += sprintf(str, formatstr, "South", EVT_GESTURE_S);
+       str += sprintf(str, formatstr, "South-West", EVT_GESTURE_SW);
+       str += sprintf(str, formatstr, "West", EVT_GESTURE_W);
+       str += sprintf(str, formatstr, "North-West", EVT_GESTURE_NW);
+       
+       return string;
+}
+
+
 static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v)
 {
        wmKeymapItem *kmi= kmi_v;
@@ -5158,6 +5180,9 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
                                                str= keymap_tweak_menu();
                                                uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->type, 0, 0, 0, 0,  "Tweak gesture"); 
                                                xstart+= butw2+5;
+                                               str= keymap_tweak_dir_menu();
+                                               uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, OL_H-1, &kmi->val, 0, 0, 0, 0,  "Tweak gesture direction");        
+                                               xstart+= butw2+5;
                                                break;
                                }
                                
index a3785b3621e28e28e1eaf42abd876b1a26c7f038..7743ede399bbe01b10af600e4d25d9ca8561da53 100644 (file)
@@ -1800,8 +1800,10 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
                mval[1]= y;
                selecting= LEFTMOUSE==RNA_int_get(op->ptr, "event_type"); // XXX solve
 
-               if(CTX_data_edit_object(C))
+               if(CTX_data_edit_object(C)) {
                        obedit_circle_select(&vc, selecting, mval, (float)radius);
+                       WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obact);
+               }
                else
                        return PE_circle_select(C, selecting, mval, (float)radius);
        }