* Change to the working of the left mouse select preference
Previously, the implementation of this was quite awkward, with the preference swapping mouse buttons globally, rather than just selection, as is advertised on the pref. This had the effect of changing the painting in sculpt/texture paint/weight paint/etc to the left mouse button. This was totally silly, since when using a tablet, left mouse select is the sane way to go, but it meant that every time you wanted to sculpt or paint, you had to switch the mouse buttons around so you could actually use the tablet as normal. This commit fixes that, and makes the preference do just what it says, use left mouse for selection (i.e. in object/edit mode) and only that.
This commit is contained in:
@@ -1700,8 +1700,7 @@ void sculpt(void)
|
||||
mvalo[0]= mouse[0];
|
||||
mvalo[1]= mouse[1];
|
||||
|
||||
if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
|
||||
else mousebut = L_MOUSE;
|
||||
mousebut = L_MOUSE;
|
||||
|
||||
/* If modifier_calculations is true, then extra time must be spent
|
||||
updating the mesh. This takes a *lot* longer, so it's worth
|
||||
|
||||
@@ -1131,7 +1131,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
Object *ob= OBACT; /* do not change! */
|
||||
float *curs;
|
||||
int doredraw= 0, pupval;
|
||||
unsigned short event= evt->event, origevent= evt->event;
|
||||
unsigned short event= evt->event;
|
||||
short val= evt->val;
|
||||
char ascii= evt->ascii;
|
||||
|
||||
@@ -1148,9 +1148,16 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
|
||||
/* swap mouse buttons based on user preference */
|
||||
if (U.flag & USER_LMOUSESELECT) {
|
||||
/* only swap mouse button for selection, in modes where it is relevant.
|
||||
* painting/sculpting stays on LEFTMOUSE */
|
||||
if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) ||
|
||||
(G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT)) ||
|
||||
(G.obedit) )
|
||||
{
|
||||
if (event==LEFTMOUSE) event = RIGHTMOUSE;
|
||||
else if (event==RIGHTMOUSE) event = LEFTMOUSE;
|
||||
}
|
||||
}
|
||||
|
||||
if(!mouse_in_header(sa)) {
|
||||
if(!G.obedit && (G.f & G_SCULPTMODE)) {
|
||||
@@ -1538,7 +1545,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
vertex_paint();
|
||||
}
|
||||
else if (G.f & G_TEXTUREPAINT) {
|
||||
imagepaint_paint(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE, 1);
|
||||
imagepaint_paint(L_MOUSE, 1);
|
||||
}
|
||||
break;
|
||||
case MIDDLEMOUSE:
|
||||
@@ -4739,7 +4746,7 @@ static void changeimagepace(ScrArea *sa, void *spacedata)
|
||||
static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
{
|
||||
SpaceImage *sima= spacedata;
|
||||
unsigned short event= evt->event, origevent= evt->event;
|
||||
unsigned short event= evt->event;
|
||||
short val= evt->val;
|
||||
|
||||
if(val==0) return;
|
||||
@@ -4761,10 +4768,10 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
scrarea_queue_winredraw(sa);
|
||||
break;
|
||||
case LEFTMOUSE:
|
||||
imagepaint_paint(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE, 0);
|
||||
imagepaint_paint(L_MOUSE, 0);
|
||||
break;
|
||||
case RIGHTMOUSE:
|
||||
imagepaint_pick(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE);
|
||||
imagepaint_pick(R_MOUSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1089,7 +1089,7 @@ void weight_paint(void)
|
||||
float vpimat[3][3];
|
||||
int *indexar, index, totindex, alpha, totw;
|
||||
int vgroup_mirror= -1;
|
||||
short mval[2], mvalo[2], firsttime=1, mousebut;
|
||||
short mval[2], mvalo[2], firsttime=1;
|
||||
|
||||
if((G.f & G_WEIGHTPAINT)==0) return;
|
||||
if(G.obedit) return;
|
||||
@@ -1162,9 +1162,6 @@ void weight_paint(void)
|
||||
mvalo[0]= mval[0];
|
||||
mvalo[1]= mval[1];
|
||||
|
||||
if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
|
||||
else mousebut = L_MOUSE;
|
||||
|
||||
/* if mirror painting, find the other group */
|
||||
if(Gwp.flag & VP_MIRROR_X) {
|
||||
bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1);
|
||||
@@ -1190,7 +1187,7 @@ void weight_paint(void)
|
||||
}
|
||||
}
|
||||
|
||||
while (get_mbut() & mousebut) {
|
||||
while (get_mbut() & L_MOUSE) {
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
|
||||
@@ -1362,7 +1359,7 @@ void vertex_paint()
|
||||
float vpimat[3][3];
|
||||
unsigned int paintcol=0, *mcol, *mcolorig, fcol1, fcol2;
|
||||
int *indexar, index, alpha, totindex;
|
||||
short mval[2], mvalo[2], firsttime=1, mousebut;
|
||||
short mval[2], mvalo[2], firsttime=1;
|
||||
|
||||
if((G.f & G_VERTEXPAINT)==0) return;
|
||||
if(G.obedit) return;
|
||||
@@ -1405,10 +1402,7 @@ void vertex_paint()
|
||||
mvalo[0]= mval[0];
|
||||
mvalo[1]= mval[1];
|
||||
|
||||
if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE;
|
||||
else mousebut = L_MOUSE;
|
||||
|
||||
while (get_mbut() & mousebut) {
|
||||
while (get_mbut() & L_MOUSE) {
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) {
|
||||
|
||||
Reference in New Issue
Block a user