Grease Pencil - Stroke Sensitivity:

Sensitivity to mouse movement when drawing can now be customised in the User Prefs, under 'Edit Methods'.
This commit is contained in:
Joshua Leung 2008-09-18 11:49:57 +00:00
parent 8d1163c639
commit 423b053904
4 changed files with 27 additions and 6 deletions

@ -188,7 +188,8 @@ typedef struct UserDef {
char fontname[256]; // FILE_MAXDIR+FILE length char fontname[256]; // FILE_MAXDIR+FILE length
struct ListBase themes; struct ListBase themes;
short undosteps; short undosteps;
short undomemory, pad[3]; short undomemory;
short gp_manhattendist, gp_euclideandist, pad;
short curssize; short curssize;
short tb_leftmouse, tb_rightmouse; short tb_leftmouse, tb_rightmouse;
struct SolidLight light[3]; struct SolidLight light[3];

@ -992,11 +992,12 @@ void gpencil_convert_menu (void)
#define GP_STROKE_BUFFER_MAX 5000 #define GP_STROKE_BUFFER_MAX 5000
/* Hardcoded sensitivity thresholds... */ /* Hardcoded sensitivity thresholds... */
// TODO: one day, these might be added to the UI if it is necessary
/* minimum number of pixels mouse should move before new point created */ /* minimum number of pixels mouse should move before new point created */
#define MIN_MANHATTEN_PX 3 //#define MIN_MANHATTEN_PX 3
#define MIN_MANHATTEN_PX U.gp_manhattendist
/* minimum length of new segment before new point can be added */ /* minimum length of new segment before new point can be added */
#define MIN_EUCLIDEAN_PX 20 //#define MIN_EUCLIDEAN_PX 20
#define MIN_EUCLIDEAN_PX U.gp_euclideandist
/* ------ */ /* ------ */

@ -4056,6 +4056,19 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D"); &(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D");
uiBlockEndAlign(block); uiBlockEndAlign(block);
uiDefBut(block, LABEL,0,"Grease Pencil:",
(xpos+(2*edgsp)+(3*midsp)+(3*mpref)+spref),y6label,mpref,buth,
0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButS(block, NUM, 0, "Manhatten Dist:",
(xpos+(4*midsp)+(3*mpref)+mpref),y5,mpref,buth,
&(U.gp_manhattendist), 0, 100, 0, 0, "Pixels moved by mouse per axis when drawing stroke");
uiDefButS(block, NUM, 0, "Euclidean Dist:",
(xpos+(5*midsp)+(3*mpref)+(2*mpref)),y5,mpref,buth,
&(U.gp_euclideandist), 0, 100, 0, 0, "Distance moved by mouse when drawing stroke (in pixels) to include");
uiBlockEndAlign(block);
} else if(U.userpref == 2) { /* language & colors */ } else if(U.userpref == 2) { /* language & colors */
#ifdef INTERNATIONAL #ifdef INTERNATIONAL

@ -480,8 +480,10 @@ static void init_userdef_file(void)
if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) { if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) {
U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE; U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE;
} }
if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile < 1)) { if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile <= 2)) {
bTheme *btheme; bTheme *btheme;
/* adjust themes */
for (btheme= U.themes.first; btheme; btheme= btheme->next) { for (btheme= U.themes.first; btheme; btheme= btheme->next) {
char *col; char *col;
@ -499,6 +501,10 @@ static void init_userdef_file(void)
col = btheme->tv3d.vertex_select; col = btheme->tv3d.vertex_select;
SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255); SETCOL(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
} }
/* define grease-pencil distances */
U.gp_manhattendist= 3;
U.gp_euclideandist= 20;
} }
/* GL Texture Garbage Collection (variable abused above!) */ /* GL Texture Garbage Collection (variable abused above!) */