First pass at setting up better hotkeys for sculptmode.
http://projects.blender.org/pipermail/bf-committers/2006-November/016311.html As recommended on bf-committers, I created an entirely separate section for sculptmode hotkeys, so none of the standard hotkeys in space.c carry over. (However, the standard hotkeys in toets.c are left unchanged.) There are probably some useful hotkeys that have been disabled with this commit, and other hotkeys that still need to be added, so this needs review.
This commit is contained in:
@@ -72,7 +72,7 @@ void sculptmode_undo_menu();
|
||||
void sculptmode_draw_interface_tools(struct uiBlock *block,unsigned short cx, unsigned short cy);
|
||||
void sculptmode_draw_interface_textures(struct uiBlock *block,unsigned short cx, unsigned short cy);
|
||||
void sculptmode_rem_tex(void*,void*);
|
||||
void sculptmode_propset_init(unsigned short key);
|
||||
void sculptmode_propset_init(PropsetMode mode);
|
||||
void sculptmode_propset(const unsigned short event);
|
||||
void sculptmode_selectbrush_menu();
|
||||
void sculptmode_draw_mesh(int);
|
||||
|
||||
@@ -4055,23 +4055,23 @@ uiBlock *view3d_sculptmenu(void *arg_unused_so_why_have_it/*?*/)
|
||||
uiDefIconTextBut(block, BUTM, 1, (G.vd->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mouse averaging", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_z ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_y ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_x ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_z ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry Z|Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_y ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry Y|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->symm_x ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Symmetry X|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
if(sd->brush_type!=GRAB_BRUSH)
|
||||
uiDefIconTextBut(block, BUTM, 1, (br->airbrush ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Airbrush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (br->airbrush ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Airbrush|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
|
||||
if(sd->brush_type!=SMOOTH_BRUSH && sd->brush_type!=GRAB_BRUSH) {
|
||||
uiDefIconTextBut(block, BUTM, 1, (br->dir==0 ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Sub", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (br->dir==1 ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Add", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
|
||||
}
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw|D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
|
||||
|
||||
|
||||
if(curarea->headertype==HEADERTOP) {
|
||||
|
||||
@@ -1298,7 +1298,7 @@ void sculptmode_propset_end(int cancel)
|
||||
}
|
||||
}
|
||||
|
||||
void sculptmode_propset_init(unsigned short key)
|
||||
void sculptmode_propset_init(PropsetMode mode)
|
||||
{
|
||||
PropsetData *pd= G.scene->sculptdata.propset;
|
||||
|
||||
@@ -1318,15 +1318,7 @@ void sculptmode_propset_init(unsigned short key)
|
||||
sculptmode_propset_calctex();
|
||||
}
|
||||
|
||||
switch(key) {
|
||||
case DKEY:
|
||||
if(pd->mode == PropsetNone)
|
||||
pd->mode= PropsetSize;
|
||||
else if(pd->mode == PropsetSize)
|
||||
pd->mode= PropsetStrength;
|
||||
else
|
||||
sculptmode_propset_end(1);
|
||||
}
|
||||
pd->mode= mode;
|
||||
}
|
||||
|
||||
void sculptmode_propset(unsigned short event)
|
||||
@@ -1337,10 +1329,6 @@ void sculptmode_propset(unsigned short event)
|
||||
float dist;
|
||||
|
||||
switch(event) {
|
||||
case DKEY:
|
||||
sculptmode_propset_init(DKEY);
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
break;
|
||||
case MOUSEX:
|
||||
case MOUSEY:
|
||||
getmouseco_areawin(mouse);
|
||||
|
||||
@@ -1114,7 +1114,61 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!G.obedit && (G.f & G_SCULPTMODE)) {
|
||||
SculptData *sd= &G.scene->sculptdata;
|
||||
BrushData *br= sculptmode_brush();
|
||||
switch(event) {
|
||||
case LEFTMOUSE:
|
||||
if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
|
||||
sculptmode_pmv(0);
|
||||
else if(!G.scene->sculptdata.propset)
|
||||
sculpt();
|
||||
break;
|
||||
case RIGHTMOUSE:
|
||||
if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
|
||||
sculptmode_pmv(1);
|
||||
break;
|
||||
/* Brush properties */
|
||||
case AKEY:
|
||||
br->airbrush= !br->airbrush;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case FKEY:
|
||||
if(G.qual==0)
|
||||
sculptmode_propset_init(PropsetSize);
|
||||
if(G.qual==LR_SHIFTKEY)
|
||||
sculptmode_propset_init(PropsetStrength);
|
||||
break;
|
||||
/* Set brush */
|
||||
case DKEY:
|
||||
sd->brush_type= DRAW_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case SKEY:
|
||||
sd->brush_type= SMOOTH_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case PKEY:
|
||||
sd->brush_type= PINCH_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case IKEY:
|
||||
sd->brush_type= INFLATE_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case GKEY:
|
||||
sd->brush_type= GRAB_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case LKEY:
|
||||
sd->brush_type= LAYER_BRUSH;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
/* Symmetry */
|
||||
case XKEY:
|
||||
sd->symm_x= !sd->symm_x;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case YKEY:
|
||||
sd->symm_y= !sd->symm_y;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
case ZKEY:
|
||||
sd->symm_z= !sd->symm_z;
|
||||
allqueue(REDRAWBUTSEDIT, 0); break;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (U.flag & USER_NONUMPAD) {
|
||||
event= convert_for_nonumpad(event);
|
||||
@@ -1137,12 +1191,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
if ((G.obedit) || !(G.f&(G_SCULPTMODE|G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) {
|
||||
mouse_cursor();
|
||||
}
|
||||
else if (G.f & G_SCULPTMODE) {
|
||||
if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
|
||||
sculptmode_pmv(0);
|
||||
else if(!G.scene->sculptdata.propset)
|
||||
sculpt();
|
||||
}
|
||||
else if (G.f & G_WEIGHTPAINT) {
|
||||
weight_paint();
|
||||
}
|
||||
@@ -1195,8 +1243,6 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
face_select();
|
||||
else if( G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))
|
||||
sample_vpaint();
|
||||
else if((G.f & G_SCULPTMODE) && G.qual==LR_SHIFTKEY+LR_CTRLKEY)
|
||||
sculptmode_pmv(1);
|
||||
else
|
||||
mouse_select(); /* does poses too */
|
||||
break;
|
||||
@@ -1455,16 +1501,12 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
imagestodisplist();
|
||||
}
|
||||
else if((G.qual==0)){
|
||||
if(G.f & G_SCULPTMODE)
|
||||
sculptmode_propset_init(DKEY);
|
||||
else {
|
||||
pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4|Textured Solid %x5");
|
||||
if(pupval>0) {
|
||||
G.vd->drawtype= pupval;
|
||||
doredraw= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case EKEY:
|
||||
|
||||
Reference in New Issue
Block a user