diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-10-23 22:56:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-10-23 22:56:43 +0400 |
commit | 6210fe5ad6098a6f6500f6aacf2bf84c55cae721 (patch) | |
tree | a787b3b8b87bc6dc54a6e8e589678329d1ac5e58 | |
parent | 1362b210c6405926c6b04b56ca843e24c3d648e1 (diff) |
made drawing curve handles in the 3d view optional - this is much nicer for editing curves with Automatic handles so you dont select a handle by mistake and change its type.
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_editing.c | 13 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 31 | ||||
-rw-r--r-- | source/blender/src/header_view3d.c | 2 |
4 files changed, 32 insertions, 18 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 467397e749e..1d2ff1d0bf2 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -599,10 +599,12 @@ typedef struct Scene { #define SCE_SNAP_TARGET_MEDIAN 2 /* sce->selectmode */ -#define SCE_SELECT_VERTEX 1 +#define SCE_SELECT_VERTEX 1 /* for mesh */ #define SCE_SELECT_EDGE 2 #define SCE_SELECT_FACE 4 +#define SCE_SELECT_CU_HANDLES_HIDE 8 /* for curve, when flagged hide handles */ + /* sce->recalc (now in use by previewrender) */ #define SCE_PRV_CHANGED 1 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 86d518f5467..f779d494895 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2943,13 +2943,16 @@ static void editing_panel_curve_tools1(Object *ob, Curve *cu) uiDefBut(block, BUT, B_SPINNURB, "Spin", 400,160,150,20, 0, 0, 0, 0, 0, "Spin selected 360 degrees"); } uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_HIDE, "Hide", 400,120,150,18, 0, 0, 0, 0, 0, "Hides selected faces"); - uiDefBut(block, BUT,B_REVEAL, "Reveal", 400,100,150,18, 0, 0, 0, 0, 0, "Reveals selected faces"); - uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 400,80,150,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces"); + uiDefBut(block, BUT,B_HIDE, "Hide", 400,140,150,18, 0, 0, 0, 0, 0, "Hides selected faces"); + uiDefBut(block, BUT,B_REVEAL, "Reveal", 400,120,150,18, 0, 0, 0, 0, 0, "Reveals selected faces"); + uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 400,100,150,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces"); uiBlockEndAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 400, 40, 150, 19, &G.scene->editbutsize, 0.001, 1.0, 10, 0, "Normal size for drawing"); - + uiBlockBeginAlign(block); + uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 400, 60, 150, 19, &G.scene->editbutsize, 0.001, 1.0, 10, 0, "Normal size for drawing"); + uiDefButBitI(block, TOGN, SCE_SELECT_CU_HANDLES_HIDE, REDRAWVIEW3D, "Draw Handles", 400, 40, 150, 19, &G.scene->selectmode, 0, 0, 0, 0, "Draw curve handles in 3D view"); + uiBlockEndAlign(block); + if(G.obedit) { uiBut *but; uiBlockBeginAlign(block); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index f057525a4ef..a64a49a7268 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -1357,12 +1357,17 @@ void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt = &nu->bezt[i]; if(bezt->hide==0) { - view3d_project_short_clip(curarea, bezt->vec[0], s, pmat, vmat); - func(userData, nu, NULL, bezt, 0, s[0], s[1]); - view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat); - func(userData, nu, NULL, bezt, 1, s[0], s[1]); - view3d_project_short_clip(curarea, bezt->vec[2], s, pmat, vmat); - func(userData, nu, NULL, bezt, 2, s[0], s[1]); + if (G.scene->selectmode & SCE_SELECT_CU_HANDLES_HIDE) { + view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat); + func(userData, nu, NULL, bezt, 1, s[0], s[1]); + } else { + view3d_project_short_clip(curarea, bezt->vec[0], s, pmat, vmat); + func(userData, nu, NULL, bezt, 0, s[0], s[1]); + view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat); + func(userData, nu, NULL, bezt, 1, s[0], s[1]); + view3d_project_short_clip(curarea, bezt->vec[2], s, pmat, vmat); + func(userData, nu, NULL, bezt, 2, s[0], s[1]); + } } } } @@ -2962,8 +2967,8 @@ static void tekenhandlesN(Nurb *nu, short sel) float *fp; unsigned int *col; int a; - - if(nu->hide) return; + + if(nu->hide || (G.scene->selectmode & SCE_SELECT_CU_HANDLES_HIDE)) return; glBegin(GL_LINES); @@ -3030,9 +3035,13 @@ static void tekenvertsN(Nurb *nu, short sel) a= nu->pntsu; while(a--) { if(bezt->hide==0) { - if((bezt->f1 & 1)==sel) bglVertex3fv(bezt->vec[0]); - if((bezt->f2 & 1)==sel) bglVertex3fv(bezt->vec[1]); - if((bezt->f3 & 1)==sel) bglVertex3fv(bezt->vec[2]); + if (G.scene->selectmode & SCE_SELECT_CU_HANDLES_HIDE) { + if((bezt->f2 & 1)==sel) bglVertex3fv(bezt->vec[1]); + } else { + if((bezt->f1 & 1)==sel) bglVertex3fv(bezt->vec[0]); + if((bezt->f2 & 1)==sel) bglVertex3fv(bezt->vec[1]); + if((bezt->f3 & 1)==sel) bglVertex3fv(bezt->vec[2]); + } } bezt++; } diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 534c87a093a..75c769ca12a 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -5184,7 +5184,7 @@ void view3d_buttons(void) } xco+= 20; } - + uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE_DEHLT, xco,0,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (hold CTRL for anim)"); if (ob && (ob->flag & OB_POSEMODE)) { |