[Bf-blender-cvs] [e6838ecc260] master: Fix T53512: Vertices with index 0 were not being selected

Germano noreply at git.blender.org
Fri Dec 8 15:42:11 CET 2017


Commit: e6838ecc260441dcba0abfcd8a8292b94081df64
Author: Germano
Date:   Fri Dec 8 12:42:00 2017 -0200
Branches: master
https://developer.blender.org/rBe6838ecc260441dcba0abfcd8a8292b94081df64

Fix T53512: Vertices with index 0 were not being selected

Bug introduced on rB9f5bf197a0c3.
The offset for selection of vertices (`bm_vertoffs`) starts where the offset o edges ends (`bm_wireoffs`).
However, the `bm_wireoffs` depends on the offset of face selection (`bm_solidoffs`).

Before the commit that introduced the bug, the drawn of edges (in backbuff) was always computed along with the `bm_wireoffs`:
```
bm_wireoffs = bm_solidoffs + em->bm->totedge;
```

Now that the edges are not always drawn in backbuff, `bm_wireoffs` has to start from `bm_solidoffs`.

===================================================================

M	source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index a1075f7efcf..a1ddec7531e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -8433,8 +8433,9 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
 				bbs_mesh_solid_EM(em, scene, v3d, ob, dm, (ts->selectmode & SCE_SELECT_FACE) != 0);
 				if (ts->selectmode & SCE_SELECT_FACE)
 					bm_solidoffs = 1 + em->bm->totface;
-				else
+				else {
 					bm_solidoffs = 1;
+				}
 
 				ED_view3d_polygon_offset(rv3d, 1.0);
 
@@ -8443,6 +8444,10 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
 					bbs_mesh_wire(em, dm, bm_solidoffs);
 					bm_wireoffs = bm_solidoffs + em->bm->totedge;
 				}
+				else {
+					/* `bm_vertoffs` is calculated from `bm_wireoffs`. (otherwise see T53512) */
+					bm_wireoffs = bm_solidoffs;
+				}
 
 				/* we draw verts if vert select mode. */
 				if (ts->selectmode & SCE_SELECT_VERTEX) {



More information about the Bf-blender-cvs mailing list