Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-08-27 05:57:09 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-27 05:57:09 +0400
commit7994ff39b8acff9a7addbacb97a26387ce181025 (patch)
treebd5407c0adc40d31fe565c6a03012dcd3570e2fd /source/blender/editors/gpencil
parent65b7d58fa212377226f9a132cfd274a76328e2a6 (diff)
Grease Pencil: Another quick experiment - easier usage
* Changed the hotkey to simply be: Hold DKEY, click+drag using Left-Mouse (draw) or Right-Mouse (erase). How to get tablet erasers to work (via keymaps) is on todo... You can simply hold DKEY until you've finished drawing, thanks to the nice way that keymaps can support standard-key modifiers now. * Eraser works now too.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c10
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index c18c7bb3f78..347a611ee30 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -55,9 +55,9 @@ void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap)
/* Draw */
/* draw */
- WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
+ WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY);
/* erase */
- kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
+ kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, 0, DKEY);
RNA_enum_set(kmi->ptr, "mode", 1); // XXX need to make the defines for this public (this is GP_PAINTMODE_ERASER)
}
@@ -67,6 +67,10 @@ void ED_operatortypes_gpencil (void)
{
/* Drawing ----------------------- */
WM_operatortype_append(GPENCIL_OT_draw);
+
+ /* Editing (Buttons) ------------ */
+
+ /* Editing (Time) --------------- */
}
/* ****************************************** */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 059c3417a04..2f60efb2179 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1030,6 +1030,7 @@ static void gp_paint_cleanup (tGPsdata *p)
static int gpencil_draw_init (bContext *C, wmOperator *op)
{
tGPsdata *p;
+ wmWindow *win= CTX_wm_window(C);
int paintmode= RNA_enum_get(op->ptr, "mode");
/* check context */
@@ -1048,9 +1049,14 @@ static int gpencil_draw_init (bContext *C, wmOperator *op)
}
/* radius for eraser circle is defined in userprefs now */
- // TODO: make this more easily tweaked...
p->radius= U.gp_eraser;
+ /* set cursor */
+ if (p->paintmode == GP_PAINTMODE_ERASER)
+ WM_cursor_modal(win, BC_CROSSCURSOR); // XXX need a better cursor
+ else
+ WM_cursor_modal(win, BC_PAINTBRUSHCURSOR);
+
/* everything is now setup ok */
return 1;
}
@@ -1065,7 +1071,7 @@ static void gpencil_draw_exit (bContext *C, wmOperator *op)
G.f &= ~G_GREASEPENCIL;
/* restore cursor to indicate end of drawing */
- // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_STD);
+ WM_cursor_restore(CTX_wm_window(C));
/* check size of buffer before cleanup, to determine if anything happened here */
if (p->paintmode == GP_PAINTMODE_ERASER) {