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
path: root/source
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2017-12-04 17:05:06 +0300
committerGermano <germano.costa@ig.com.br>2017-12-04 17:05:06 +0300
commit9f5bf197a0c3d53af2bf438460e0b2433d3519dd (patch)
tree66e2b00e76a580015069e228d112836255cd6f63 /source
parentd974d254975df7aae20804f189b64c0741d52ba1 (diff)
Edit Mesh Selection: Draw the backbuff of edge selection only when requested
And make sure the width is 1
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mesh/editmesh_select.c8
-rw-r--r--source/blender/editors/space_view3d/drawobject.c9
2 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 3f443b49a5e..77a107534dd 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1573,9 +1573,17 @@ static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool de
mvalf[1] = (float)(vc.mval[1] = mval[1]);
em = vc.em;
+ /* Make sure that the edges are also considered for selection.
+ * TODO: cleanup: add `selectmode` as a parameter */
+ const short ts_selectmode = vc.scene->toolsettings->selectmode;
+ vc.scene->toolsettings->selectmode |= SCE_SELECT_EDGE;
+
/* no afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad */
ED_view3d_backbuf_validate(&vc);
+ /* restore `selectmode` */
+ vc.scene->toolsettings->selectmode = ts_selectmode;
+
eed = EDBM_edge_find_nearest_ex(&vc, &dist, NULL, true, true, NULL);
if (eed == NULL) {
return false;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index d7e3b78cdc3..a1075f7efcf 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -8273,6 +8273,7 @@ static DMDrawOption bbs_mesh_wire__setDrawOptions(void *userData, int index)
static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
{
drawBMOffset_userData data = {em->bm, offset};
+ glLineWidth(1);
dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, &data);
}
@@ -8437,9 +8438,11 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
ED_view3d_polygon_offset(rv3d, 1.0);
- /* we draw edges always, for loop (select) tools */
- bbs_mesh_wire(em, dm, bm_solidoffs);
- bm_wireoffs = bm_solidoffs + em->bm->totedge;
+ /* we draw edges if edge select mode */
+ if (ts->selectmode & SCE_SELECT_EDGE) {
+ bbs_mesh_wire(em, dm, bm_solidoffs);
+ bm_wireoffs = bm_solidoffs + em->bm->totedge;
+ }
/* we draw verts if vert select mode. */
if (ts->selectmode & SCE_SELECT_VERTEX) {