workaround for createTransEditVerts overwriting index data to fix mirror.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 26 Oct 2011 10:04:10 +0000 (10:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 26 Oct 2011 10:04:10 +0000 (10:04 +0000)
source/blender/editors/mesh/bmeshutils.c
source/blender/editors/transform/transform_conversions.c

index f70d3924f7a633fe9a242d49e429f26efe8d212d..622cf26fea89e66be91c42084ff6e586cf8e885a 100644 (file)
@@ -813,6 +813,16 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
        li = CustomData_get_named_layer_index(&em->bm->vdata, CD_PROP_INT, "__mirror_index");
        em->bm->vdata.layers[li].flag |= CD_FLAG_TEMPORARY;
 
+       /* BMESH_TODO, we should STOP overwriting the vertex index data with bad
+        * indicies, once createTransEditVerts() stops doing this, this loop can be
+        * removed - campbell */
+       i= 0;
+       BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
+               BM_SetIndex(v, i++);
+       }
+       /* END BMESH_TODO */
+
+
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                BMVert *mirr;
                int *idx = CustomData_bmesh_get_layer_n(&em->bm->vdata, v->head.data, li);
index 6e1fc6da5d78560d061f9736ab5c11a9854a8f67..4081ae128a3969f50cad2ab6d263661f2f30033a 100644 (file)
@@ -2084,6 +2084,9 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
                selectmode = SCE_SELECT_EDGE;
        }
 
+       /* BMESH_TODO, writing into the index values is BAD!, means we cant
+        * use the values for vertex mirror - campbell */
+
        // transform now requires awareness for select mode, so we tag the f1 flags in verts
        if(selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {