rename BMINDEX_GET/SET to BM_GetIndex/BM_SetIndex
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 May 2011 10:49:26 +0000 (10:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 May 2011 10:49:26 +0000 (10:49 +0000)
29 files changed:
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/editderivedbmesh.c
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_inline.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/operators/bevel.c
source/blender/bmesh/operators/createops.c
source/blender/bmesh/operators/edgesplitop.c
source/blender/bmesh/operators/mesh_conv.c
source/blender/bmesh/operators/mirror.c
source/blender/bmesh/operators/removedoubles.c
source/blender/bmesh/operators/utils.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/mesh/bmeshutils.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/knifetool.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/util/crazyspace.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/modifiers/intern/MOD_array.c

index e1d9b7e4853179482dc7632ef743517d7f30a053..08cb0ccc23a14fc192174065f7d1a59fe5247063 100644 (file)
@@ -1915,7 +1915,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
        /* set vert index */
        eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for (i=0; eve; eve=BMIter_Step(&iter), i++)
-               BMINDEX_SET(eve, i);
+               BM_SetIndex(eve, i);
 
        index = dm->getVertDataArray(dm, CD_ORIGINDEX);
 
@@ -1925,7 +1925,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
 
                VECCOPY(mv->co, eve->co);
 
-               BMINDEX_SET(eve, i);
+               BM_SetIndex(eve, i);
 
                mv->no[0] = eve->no[0] * 32767.0;
                mv->no[1] = eve->no[1] * 32767.0;
@@ -1946,10 +1946,10 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
        for (i=0; eed; eed=BMIter_Step(&iter), i++, index++) {
                MEdge *med = &medge[i];
 
-               BMINDEX_SET(eed, i);
+               BM_SetIndex(eed, i);
 
-               med->v1 = BMINDEX_GET(eed->v1);
-               med->v2 = BMINDEX_GET(eed->v2);
+               med->v1 = BM_GetIndex(eed->v1);
+               med->v2 = BM_GetIndex(eed->v2);
                med->flag = ME_EDGEDRAW|ME_EDGERENDER;
 
                if (has_crease)
@@ -1965,7 +1965,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
 
        efa = BMIter_New(&iter, bm, BM_FACES_OF_MESH, NULL);
        for (i=0; efa; i++, efa=BMIter_Step(&iter)) {
-               BMINDEX_SET(efa, i);
+               BM_SetIndex(efa, i);
        }
 
        index = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
@@ -1974,14 +1974,14 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
                BMLoop **l = em->looptris[i];
                efa = l[0]->f;
 
-               mf->v1 = BMINDEX_GET(l[0]->v);
-               mf->v2 = BMINDEX_GET(l[1]->v);
-               mf->v3 = BMINDEX_GET(l[2]->v);
+               mf->v1 = BM_GetIndex(l[0]->v);
+               mf->v2 = BM_GetIndex(l[1]->v);
+               mf->v3 = BM_GetIndex(l[2]->v);
                mf->v4 = 0;
                mf->mat_nr = efa->mat_nr;
                mf->flag = BMFlags_To_MEFlags(efa);
                
-               *index = add_orig ? BMINDEX_GET(efa) : *(int*)CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_ORIGINDEX);
+               *index = add_orig ? BM_GetIndex(efa) : *(int*)CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_ORIGINDEX);
 
                loops_to_customdata_corners(bm, &dm->faceData, i, l, numCol, numTex);
                test_index_face(mf, &dm->faceData, i, 3);
@@ -2000,8 +2000,8 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
                mp->mat_nr = efa->mat_nr;
                
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) {
-                       mloop->v = BMINDEX_GET(l->v);
-                       mloop->e = BMINDEX_GET(l->e);
+                       mloop->v = BM_GetIndex(l->v);
+                       mloop->e = BM_GetIndex(l->e);
                        CustomData_from_bmesh_block(&bm->ldata, &dm->loopData, l->head.data, j);
 
                        j++;
index d1773632aeb445668923ff205a98213edfd9722c..894fb2185b995034e060a734d3290fb06e5deff2 100644 (file)
@@ -391,14 +391,14 @@ static void bmDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData,
 
                eve = BMIter_New(&viter, bmdm->tc->bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&viter), i++) {
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
                }
 
                eed = BMIter_New(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
                for(i=0; eed; i++,eed=BMIter_Step(&iter))
                        func(userData, i, 
-                            bmdm->vertexCos[BMINDEX_GET(eed->v1)], 
-                            bmdm->vertexCos[BMINDEX_GET(eed->v2)]);
+                            bmdm->vertexCos[BM_GetIndex(eed->v1)], 
+                            bmdm->vertexCos[BM_GetIndex(eed->v2)]);
        } else {
                eed = BMIter_New(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
                for(i=0; eed; i++,eed=BMIter_Step(&iter))
@@ -420,15 +420,15 @@ static void bmDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
 
                eve = BMIter_New(&viter, bmdm->tc->bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&viter), i++) {
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
                }
 
                glBegin(GL_LINES);
                eed = BMIter_New(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
                for(i=0; eed; i++,eed=BMIter_Step(&iter)) {
                        if(!setDrawOptions || setDrawOptions(userData, i)) {
-                               glVertex3fv(bmdm->vertexCos[BMINDEX_GET(eed->v1)]);
-                               glVertex3fv(bmdm->vertexCos[BMINDEX_GET(eed->v2)]);
+                               glVertex3fv(bmdm->vertexCos[BM_GetIndex(eed->v1)]);
+                               glVertex3fv(bmdm->vertexCos[BM_GetIndex(eed->v2)]);
                        }
                }
                glEnd();
@@ -463,16 +463,16 @@ static void bmDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(vo
 
                eve = BMIter_New(&iter, bmdm->tc->bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
 
                glBegin(GL_LINES);
                eed = BMIter_New(&iter, bmdm->tc->bm, BM_EDGES_OF_MESH, NULL);
                for(i=0; eed; i++,eed=BMIter_Step(&iter)) {
                        if(!setDrawOptions || setDrawOptions(userData, i)) {
                                setDrawInterpOptions(userData, i, 0.0);
-                               glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(eed->v1)]);
+                               glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(eed->v1)]);
                                setDrawInterpOptions(userData, i, 1.0);
-                               glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(eed->v2)]);
+                               glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(eed->v2)]);
                        }
                }
                glEnd();
@@ -543,7 +543,7 @@ static void bmDM__calcFaceCent(BMesh *bm, BMFace *efa, float cent[3],
        if (vertexCos) {
                l = BMIter_New(&iter, bm, BM_LOOPS_OF_FACE, efa);
                for (; l; l=BMIter_Step(&iter)) {
-                       VECADD(cent, cent, vertexCos[BMINDEX_GET(l->v)]);
+                       VECADD(cent, cent, vertexCos[BM_GetIndex(l->v)]);
                        tot++;
                }
        } else {
@@ -570,7 +570,7 @@ static void bmDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use
        if (bmdm->vertexCos) {
                eve = BMIter_New(&iter, bmdm->tc->bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
        }
 
        efa = BMIter_New(&iter, bmdm->tc->bm, BM_FACES_OF_MESH, NULL);
@@ -599,11 +599,11 @@ static void bmDM_drawMappedFaces(DerivedMesh *dm,
                
                eve = BMIter_New(&iter, bmdm->tc->bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
 
                efa = BMIter_New(&iter, bmdm->tc->bm, BM_FACES_OF_MESH, NULL);
                for (i=0; efa; efa=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(efa, i);
+                       BM_SetIndex(efa, i);
 
                for (i=0; i<bmdm->tc->tottri; i++) {
                        BMLoop **l = bmdm->tc->looptris[i];
@@ -612,7 +612,7 @@ static void bmDM_drawMappedFaces(DerivedMesh *dm,
                        efa = l[0]->f;
                        drawSmooth = (efa->head.flag & BM_SMOOTH);
 
-                       draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BMINDEX_GET(efa), &drawSmooth);
+                       draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_GetIndex(efa), &drawSmooth);
                        if(draw) {
                                if (draw==2) { /* enabled with stipple */
                                        glEnable(GL_POLYGON_STIPPLE);
@@ -625,16 +625,16 @@ static void bmDM_drawMappedFaces(DerivedMesh *dm,
 
                                if (!drawSmooth) {
                                        glNormal3fv(bmdm->faceNos[i]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[0]->v)]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[1]->v)]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[2]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[0]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[1]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[2]->v)]);
                                } else {
-                                       glNormal3fv(bmdm->vertexNos[(int) BMINDEX_GET(l[0]->v)]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[0]->v)]);
-                                       glNormal3fv(bmdm->vertexNos[(int) BMINDEX_GET(l[1]->v)]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[1]->v)]);
-                                       glNormal3fv(bmdm->vertexNos[(int) BMINDEX_GET(l[2]->v)]);
-                                       glVertex3fv(bmdm->vertexCos[(int) BMINDEX_GET(l[2]->v)]);
+                                       glNormal3fv(bmdm->vertexNos[(int) BM_GetIndex(l[0]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[0]->v)]);
+                                       glNormal3fv(bmdm->vertexNos[(int) BM_GetIndex(l[1]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[1]->v)]);
+                                       glNormal3fv(bmdm->vertexNos[(int) BM_GetIndex(l[2]->v)]);
+                                       glVertex3fv(bmdm->vertexCos[(int) BM_GetIndex(l[2]->v)]);
                                }
                                glEnd();
 
@@ -645,7 +645,7 @@ static void bmDM_drawMappedFaces(DerivedMesh *dm,
        } else {
                efa = BMIter_New(&iter, bmdm->tc->bm, BM_FACES_OF_MESH, NULL);
                for (i=0; efa; efa=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(efa, i);
+                       BM_SetIndex(efa, i);
 
                for (i=0; i<bmdm->tc->tottri; i++) {
                        BMLoop **l = bmdm->tc->looptris[i];
@@ -654,7 +654,7 @@ static void bmDM_drawMappedFaces(DerivedMesh *dm,
                        efa = l[0]->f;
                        drawSmooth = (efa->head.flag & BM_SMOOTH);
                        
-                       draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BMINDEX_GET(efa), &drawSmooth);
+                       draw = setDrawOptions==NULL ? 1 : setDrawOptions(userData, BM_GetIndex(efa), &drawSmooth);
                        if(draw) {
                                if (draw==2) { /* enabled with stipple */
                                        glEnable(GL_POLYGON_STIPPLE);
@@ -731,12 +731,12 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
        
        i = 0;
        BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL)
-               BMINDEX_SET(efa, i++);
+               BM_SetIndex(efa, i++);
 
        if (vertexCos) {
                i = 0;
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                       BMINDEX_SET(eve, i++);
+                       BM_SetIndex(eve, i++);
                                
                glBegin(GL_TRIANGLES);
                for (i=0; i<em->tottri; i++) {
@@ -761,7 +761,7 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
                        if(drawParams)
                                flag= drawParams(&mtf, has_vcol, efa->mat_nr);
                        else if(drawParamsMapped)
-                               flag= drawParamsMapped(userData, BMINDEX_GET(efa));
+                               flag= drawParamsMapped(userData, BM_GetIndex(efa));
                        else
                                flag= 1;
 
@@ -779,32 +779,32 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
                                        
                                        glTexCoord2fv(luv[0]->uv);
                                        glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[0]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[0]->v)]);
 
                                        glTexCoord2fv(luv[1]->uv);
                                        glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[1]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[1]->v)]);
 
                                        glTexCoord2fv(luv[2]->uv);
                                        glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[2]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[2]->v)]);
                                } else {
                                        bmdm_get_tri_tex(bm, ls, luv, lcol, has_uv, has_vcol);
                                        
                                        glTexCoord2fv(luv[0]->uv);
                                        glColor3ub(lcol[0]->b, lcol[0]->g, lcol[0]->r);
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ls[0]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[0]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ls[0]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[0]->v)]);
 
                                        glTexCoord2fv(luv[1]->uv);
                                        glColor3ub(lcol[1]->b, lcol[1]->g, lcol[1]->r);
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ls[1]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[1]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ls[1]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[1]->v)]);
 
                                        glTexCoord2fv(luv[2]->uv);
                                        glColor3ub(lcol[2]->b, lcol[2]->g, lcol[2]->r);
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ls[2]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ls[2]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ls[2]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ls[2]->v)]);
                                }
                        }
                }
@@ -812,7 +812,7 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
        } else {
                i = 0;
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                       BMINDEX_SET(eve, i++);
+                       BM_SetIndex(eve, i++);
                                
                for (i=0; i<em->tottri; i++) {
                        BMLoop **ls = em->looptris[i];
@@ -836,7 +836,7 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
                        if(drawParams)
                                flag= drawParams(&mtf, has_vcol, efa->mat_nr);
                        else if(drawParamsMapped)
-                               flag= drawParamsMapped(userData, BMINDEX_GET(efa));
+                               flag= drawParamsMapped(userData, BM_GetIndex(efa));
                        else
                                flag= 1;
 
@@ -953,12 +953,12 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
        /* always use smooth shading even for flat faces, else vertex colors wont interpolate */
        glShadeModel(GL_SMOOTH);
        BM_ITER_INDEX(eve, &iter, bm, BM_VERTS_OF_MESH, NULL, i) {
-                BMINDEX_SET(eve, i);
+                BM_SetIndex(eve, i);
        }
 
 #define PASSATTRIB(loop, eve, vert) {                                                                                  \
        if(attribs.totorco) {                                                                                                           \
-               float *orco = attribs.orco.array[BMINDEX_GET(eve)];                                             \
+               float *orco = attribs.orco.array[BM_GetIndex(eve)];                                             \
                glVertexAttrib3fvARB(attribs.orco.glIndex, orco);                                               \
        }                                                                                                                                                       \
        for(b = 0; b < attribs.tottface; b++) {                                                                         \
@@ -978,7 +978,7 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
        }
        
        BM_ITER_INDEX(efa, &iter, bm, BM_FACES_OF_MESH, NULL, i) {
-               BMINDEX_SET(efa, i);
+               BM_SetIndex(efa, i);
        }
        
        for (i=0, ltri=em->looptris[0]; i<em->tottri; i++, ltri += 3) {
@@ -987,7 +987,7 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
                efa = ltri[0]->f;
                drawSmooth= BM_TestHFlag(efa, BM_SMOOTH);
                
-               if(setDrawOptions && !setDrawOptions(userData, BMINDEX_GET(efa)))
+               if(setDrawOptions && !setDrawOptions(userData, BM_GetIndex(efa)))
                        continue;
 
                new_matnr = efa->mat_nr + 1;
@@ -1017,21 +1017,21 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
                                else glNormal3fv(efa->no);
 
                                PASSATTRIB(ltri[0], ltri[0]->v, 0);
-                               if(vertexCos) glVertex3fv(vertexCos[BMINDEX_GET(ltri[0]->v)]);
+                               if(vertexCos) glVertex3fv(vertexCos[BM_GetIndex(ltri[0]->v)]);
                                else glVertex3fv(ltri[0]->v->co);
 
                                PASSATTRIB(ltri[1], ltri[1]->v, 1);
-                               if(vertexCos) glVertex3fv(vertexCos[BMINDEX_GET(ltri[1]->v)]);
+                               if(vertexCos) glVertex3fv(vertexCos[BM_GetIndex(ltri[1]->v)]);
                                else glVertex3fv(ltri[1]->v->co);
 
                                PASSATTRIB(ltri[2], ltri[2]->v, 2);
-                               if(vertexCos) glVertex3fv(vertexCos[BMINDEX_GET(ltri[2]->v)]);
+                               if(vertexCos) glVertex3fv(vertexCos[BM_GetIndex(ltri[2]->v)]);
                                else glVertex3fv(ltri[2]->v->co);
                        } else {
                                PASSATTRIB(ltri[0], ltri[0]->v, 0);
                                if(vertexCos) {
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ltri[0]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ltri[0]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ltri[0]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ltri[0]->v)]);
                                }
                                else {
                                        glNormal3fv(ltri[0]->v->no);
@@ -1040,8 +1040,8 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
 
                                PASSATTRIB(ltri[1], ltri[1]->v, 1);
                                if(vertexCos) {
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ltri[1]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ltri[1]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ltri[1]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ltri[1]->v)]);
                                }
                                else {
                                        glNormal3fv(ltri[1]->v->no);
@@ -1050,8 +1050,8 @@ static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
 
                                PASSATTRIB(ltri[2], ltri[2]->v, 2);
                                if(vertexCos) {
-                                       glNormal3fv(vertexNos[BMINDEX_GET(ltri[2]->v)]);
-                                       glVertex3fv(vertexCos[BMINDEX_GET(ltri[2]->v)]);
+                                       glNormal3fv(vertexNos[BM_GetIndex(ltri[2]->v)]);
+                                       glVertex3fv(vertexCos[BM_GetIndex(ltri[2]->v)]);
                                }
                                else {
                                        glNormal3fv(ltri[2]->v->no);
@@ -1240,7 +1240,7 @@ static void bmDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
        /* store vertex indices in tmp union */
        ev = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for (i=0; ev; ev=BMIter_Step(&iter), i++)
-               BMINDEX_SET(ev, i);
+               BM_SetIndex(ev, i);
 
        ee = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, NULL);
        for( ; ee; ee=BMIter_Step(&iter)) {
@@ -1260,8 +1260,8 @@ static void bmDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
                if (!ee->f2) edge_r->flag |= ME_LOOSEEDGE;
 #endif
 
-               edge_r->v1 = (int)BMINDEX_GET(ee->v1);
-               edge_r->v2 = (int)BMINDEX_GET(ee->v2);
+               edge_r->v1 = (int)BM_GetIndex(ee->v1);
+               edge_r->v2 = (int)BM_GetIndex(ee->v2);
        }
 }
 
@@ -1278,7 +1278,7 @@ static void bmDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
        /* store vertexes indices in tmp union */
        ev = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for (i=0; ev; ev=BMIter_Step(&iter), i++)
-               BMINDEX_SET(ev, i);
+               BM_SetIndex(ev, i);
 
        for (i=0; i<bmdm->tc->tottri; i++) {
                l = bmdm->tc->looptris[i];
@@ -1289,9 +1289,9 @@ static void bmDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
                /*HACK/TODO: need to convert this*/
                face_r->flag = ef->head.flag;
 
-               face_r->v1 = BMINDEX_GET(l[0]->v);
-               face_r->v2 = BMINDEX_GET(l[1]->v);
-               face_r->v3 = BMINDEX_GET(l[2]->v);
+               face_r->v1 = BM_GetIndex(l[0]->v);
+               face_r->v2 = BM_GetIndex(l[1]->v);
+               face_r->v3 = BM_GetIndex(l[2]->v);
                face_r->v4 = 0;
 
                test_index_face(face_r, NULL, 0, 3);
@@ -1400,8 +1400,8 @@ static void bmDM_loopIterStep(void *self)
 
        bmvert_to_mvert(iter->bm, iter->l->v, &iter->head.v);
        iter->head.index++;
-       iter->head.vindex = BMINDEX_GET(iter->l->v);
-       iter->head.eindex = BMINDEX_GET(iter->l->e);
+       iter->head.vindex = BM_GetIndex(iter->l->v);
+       iter->head.eindex = BM_GetIndex(iter->l->e);
 }
 
 static void *bmDM_getLoopCDData(void *self, int type, int layer)
@@ -1447,8 +1447,8 @@ static DMLoopIter *bmDM_newLoopsIter(void *faceiter)
        iter->head.getVertCDData = bmDM_getVertCDData;
 
        bmvert_to_mvert(iter->bm, iter->l->v, &iter->head.v);
-       iter->head.vindex = BMINDEX_GET(iter->l->v);
-       iter->head.eindex = BMINDEX_GET(iter->l->e);
+       iter->head.vindex = BM_GetIndex(iter->l->v);
+       iter->head.eindex = BM_GetIndex(iter->l->e);
 
        return (DMLoopIter*) iter;
 }
@@ -1476,13 +1476,13 @@ static DMFaceIter *bmDM_getFaceIter(DerivedMesh *dm)
        /*set up vert/edge indices*/
        i = 0;
        BM_ITER(v, &biter, iter->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
                i++;
        }
 
        i = 0;
        BM_ITER(e, &biter, iter->bm, BM_EDGES_OF_MESH, NULL) {
-               BMINDEX_SET(e, i);
+               BM_SetIndex(e, i);
                i++;
        }
 
@@ -1651,22 +1651,22 @@ DerivedMesh *getEditDerivedBMesh(BMEditMesh *em, Object *UNUSED(ob),
                
                eve=BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; eve; eve=BMIter_Step(&iter), i++)
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
 
                bmdm->vertexNos = MEM_callocN(sizeof(*bmdm->vertexNos)*i, "bmdm_vno");
                bmdm->faceNos = MEM_mallocN(sizeof(*bmdm->faceNos)*totface, "bmdm_vno");
 
                for (i=0; i<bmdm->tc->tottri; i++) {
                        BMLoop **l = bmdm->tc->looptris[i];
-                       float *v1 = vertexCos[(int) BMINDEX_GET(l[0]->v)];
-                       float *v2 = vertexCos[(int) BMINDEX_GET(l[1]->v)];
-                       float *v3 = vertexCos[(int) BMINDEX_GET(l[2]->v)];
+                       float *v1 = vertexCos[(int) BM_GetIndex(l[0]->v)];
+                       float *v2 = vertexCos[(int) BM_GetIndex(l[1]->v)];
+                       float *v3 = vertexCos[(int) BM_GetIndex(l[2]->v)];
                        float *no = bmdm->faceNos[i];
                        
                        normal_tri_v3( no,v1, v2, v3);
-                       add_v3_v3v3(bmdm->vertexNos[BMINDEX_GET(l[0]->v)], bmdm->vertexNos[BMINDEX_GET(l[0]->v)], no);
-                       add_v3_v3v3(bmdm->vertexNos[BMINDEX_GET(l[1]->v)], bmdm->vertexNos[BMINDEX_GET(l[1]->v)], no);
-                       add_v3_v3v3(bmdm->vertexNos[BMINDEX_GET(l[2]->v)], bmdm->vertexNos[BMINDEX_GET(l[2]->v)], no);
+                       add_v3_v3v3(bmdm->vertexNos[BM_GetIndex(l[0]->v)], bmdm->vertexNos[BM_GetIndex(l[0]->v)], no);
+                       add_v3_v3v3(bmdm->vertexNos[BM_GetIndex(l[1]->v)], bmdm->vertexNos[BM_GetIndex(l[1]->v)], no);
+                       add_v3_v3v3(bmdm->vertexNos[BM_GetIndex(l[2]->v)], bmdm->vertexNos[BM_GetIndex(l[2]->v)], no);
                }
 
                eve=BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
index 48b54a21140f0db90bdefd32192eab3bdb659120..99c63c0c2f5ec733b7d5641feb7689d3c4f68754 100644 (file)
@@ -153,8 +153,8 @@ BM_INLINE void BM_ClearHFlag(void *element, int flag);
 
 /*stuff for dealing BM_ToggleHFlag header flags*/
 BM_INLINE void BM_ToggleHFlag(void *element, int flag);
-BM_INLINE void BMINDEX_SET(void *element, int index);
-BM_INLINE int BMINDEX_GET(void *element);
+BM_INLINE void BM_SetIndex(void *element, int index);
+BM_INLINE int BM_GetIndex(void *element);
 
 /*copies loop data from adjacent faces*/
 void BM_Face_CopyShared ( BMesh *bm, BMFace *f );
index 76141c354a05d408042ba1c022b4dbb46706c7f0..30c3b627628341809b0526768d40349656e504ee 100644 (file)
@@ -63,7 +63,7 @@ typedef struct BMHeader {
        struct BMFlagLayer *flags;
        short type; /*element geometric type (verts/edges/loops/faces)*/
        short flag; /*this would be a CD layer, see below*/
-       int index; /*note: use BMINDEX_GET/SET macros for index*/
+       int index; /*note: use BM_GetIndex/SetIndex macros for index*/
 } BMHeader;
 
 /*note: need some way to specify custom locations for custom data layers.  so we can
index d52af69f300adfb61d0c5e8f43bfc9acbb063e37..56a046989aaa335713c1fdd24eb74b41691ade2d 100644 (file)
@@ -503,21 +503,21 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
 
                vtable[BLI_array_count(vtable)-1] = v2;
 
-               BMINDEX_SET(v, i);
-               BMINDEX_SET(v2, i);
+               BM_SetIndex(v, i);
+               BM_SetIndex(v2, i);
        }
        
        e = BMIter_New(&iter, bmold, BM_EDGES_OF_MESH, NULL);
        for (i=0; e; e=BMIter_Step(&iter), i++) {
-               e2 = BM_Make_Edge(bm, vtable[BMINDEX_GET(e->v1)],
-                                 vtable[BMINDEX_GET(e->v2)], e, 0);
+               e2 = BM_Make_Edge(bm, vtable[BM_GetIndex(e->v1)],
+                                 vtable[BM_GetIndex(e->v2)], e, 0);
 
                BM_Copy_Attributes(bmold, bm, e, e2);
                BLI_array_growone(etable);
                etable[BLI_array_count(etable)-1] = e2;
 
-               BMINDEX_SET(e, i);
-               BMINDEX_SET(e2, i);
+               BM_SetIndex(e, i);
+               BM_SetIndex(e2, i);
        }
        
        f = BMIter_New(&iter, bmold, BM_FACES_OF_MESH, NULL);
@@ -529,22 +529,22 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
                        BLI_array_growone(loops);
                        BLI_array_growone(edges);
                        loops[j] = l;
-                       edges[j] = etable[BMINDEX_GET(l->e)];
+                       edges[j] = etable[BM_GetIndex(l->e)];
                }
 
-               v = vtable[BMINDEX_GET(loops[0]->v)];
-               v2 = vtable[BMINDEX_GET(loops[1]->v)];
+               v = vtable[BM_GetIndex(loops[0]->v)];
+               v2 = vtable[BM_GetIndex(loops[1]->v)];
 
                if (!bmesh_verts_in_edge(v, v2, edges[0])) {
-                       v = vtable[BMINDEX_GET(loops[BLI_array_count(loops)-1]->v)];
-                       v2 = vtable[BMINDEX_GET(loops[0]->v)];
+                       v = vtable[BM_GetIndex(loops[BLI_array_count(loops)-1]->v)];
+                       v2 = vtable[BM_GetIndex(loops[0]->v)];
                }
 
                f2 = BM_Make_Ngon(bm, v, v2, edges, f->len, 0);
                if (!f2)
                        continue;
                
-               BMINDEX_SET(f, i);
+               BM_SetIndex(f, i);
                BLI_array_growone(ftable);
                ftable[i] = f2;
                
@@ -564,11 +564,11 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
                void *ele;
 
                if (ese->type == BM_VERT)
-                       ele = vtable[BMINDEX_GET(ese->data)];
+                       ele = vtable[BM_GetIndex(ese->data)];
                else if (ese->type == BM_EDGE)
-                       ele = etable[BMINDEX_GET(ese->data)];
+                       ele = etable[BM_GetIndex(ese->data)];
                else if (ese->type == BM_FACE) {
-                       ele = ftable[BMINDEX_GET(ese->data)];
+                       ele = ftable[BM_GetIndex(ese->data)];
                }
 
                BM_store_selection(bm, ele);
index bec403dab708ba6d8abde83842a9263aef82e8b6..19af07cffb20bb9788c1bd99199b493631a7214d 100644 (file)
@@ -30,13 +30,13 @@ BM_INLINE void BM_ToggleHFlag(void *element, int flag)
        e->flag ^= flag;
 }
 
-BM_INLINE void BMINDEX_SET(void *element, int index)
+BM_INLINE void BM_SetIndex(void *element, int index)
 {
        BMHeader *e = element;
        e->index = index;
 }
 
-BM_INLINE int BMINDEX_GET(void *element)
+BM_INLINE int BM_GetIndex(void *element)
 {
        BMHeader *e = element;
        return e->index;
index c170f50e71824887b1b3b60e85b0690437f0996e..aafee8a52c2ab1ce53f989b69dd283b6feb83b9d 100644 (file)
@@ -663,14 +663,14 @@ static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
        
        //for (i=0; i<nvert; i++) {
        do {
-               i = BMINDEX_GET(l->v);
+               i = BM_GetIndex(l->v);
                if (i == v1i || i == v2i || i == v3i) {
                        l = (BMLoop*)l->next;
                        continue;
                }
                
-               VECCOPY(pv1, projectverts[BMINDEX_GET(l->v)]);
-               VECCOPY(pv2, projectverts[BMINDEX_GET(((BMLoop*)l->next)->v)]);
+               VECCOPY(pv1, projectverts[BM_GetIndex(l->v)]);
+               VECCOPY(pv2, projectverts[BM_GetIndex(((BMLoop*)l->next)->v)]);
                
                //if (linecrosses(pv1, pv2, v1, v3)) return 0;
                if (point_in_triangle(v1, v2, v3, pv1)) return 0;
@@ -707,8 +707,8 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3],
 
                if (BM_Edge_Exist(v1, v3)) isear = 0;
 
-               if (isear && !goodline(verts, f, BMINDEX_GET(v1), BMINDEX_GET(v2),
-                                      BMINDEX_GET(v3), nvert))
+               if (isear && !goodline(verts, f, BM_GetIndex(v1), BM_GetIndex(v2),
+                                      BM_GetIndex(v3), nvert))
                        isear = 0;
                
                if(isear) {
@@ -759,7 +759,7 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3],
        l = bm_firstfaceloop(f);
        do{
                VECCOPY(projectverts[i], l->v->co);
-               BMINDEX_SET(l->v, i);
+               BM_SetIndex(l->v, i);
                i++;
                l = (BMLoop*)(l->next);
        }while(l != bm_firstfaceloop(f));
@@ -860,7 +860,7 @@ void BM_LegalSplits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
        i = 0;
        l = BMIter_New(&iter, bm, BM_LOOPS_OF_FACE, f);
        for (; l; l=BMIter_Step(&iter)) {
-               BMINDEX_SET(l, i);
+               BM_SetIndex(l, i);
                VECCOPY(projverts[i], l->v->co);
                i++;
        }
index 319a3d00771650ccd83750fdad78d6ebe6b37f18..aa3311e70f0890a564c988209c6060d89eec3a99 100644 (file)
@@ -140,8 +140,8 @@ static void calc_corner_co(BMesh *bm, BMLoop *l, float *co, float fac)
 #endif
 }
 
-#define ETAG_SET(e, v, nv) (v) == (e)->v1 ? (etags[BMINDEX_GET((e))].newv1 = (nv)) : (etags[BMINDEX_GET((e))].newv2 = (nv))
-#define ETAG_GET(e, v) ((v) == (e)->v1 ? (etags[BMINDEX_GET((e))].newv1) : (etags[BMINDEX_GET((e))].newv2))
+#define ETAG_SET(e, v, nv) (v) == (e)->v1 ? (etags[BM_GetIndex((e))].newv1 = (nv)) : (etags[BMINDEX_GET((e))].newv2 = (nv))
+#define ETAG_GET(e, v) ((v) == (e)->v1 ? (etags[BM_GetIndex((e))].newv1) : (etags[BMINDEX_GET((e))].newv2))
 
 void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
 {
@@ -204,7 +204,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                        BMLoop *l;
                        
                        if (!BMO_TestFlag(bm, e, EDGE_OLD)) {
-                               BMINDEX_SET(e, BLI_array_count(etags));
+                               BM_SetIndex(e, BLI_array_count(etags));
                                BLI_array_growone(etags);
                                
                                BMO_SetFlag(bm, e, EDGE_OLD);
@@ -218,11 +218,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                        continue;
                        
                                BM_ITER(l2, &liter2, bm, BM_LOOPS_OF_FACE, l->f) {
-                                       BMINDEX_SET(l2, BLI_array_count(tags));
+                                       BM_SetIndex(l2, BLI_array_count(tags));
                                        BLI_array_growone(tags);
 
                                        if (!BMO_TestFlag(bm, l2->e, EDGE_OLD)) {
-                                               BMINDEX_SET(l2->e, BLI_array_count(etags));
+                                               BM_SetIndex(l2->e, BLI_array_count(etags));
                                                BLI_array_growone(etags);
                                                
                                                BMO_SetFlag(bm, l2->e, EDGE_OLD);
@@ -233,7 +233,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                BLI_array_append(faces, l->f);
                        }
                } else {
-                       BMINDEX_SET(e, -1);
+                       BM_SetIndex(e, -1);
                }
        }
 #endif
@@ -254,7 +254,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                
                if (!BLI_smallhash_haskey(&hash, (intptr_t)e)) {
                        BLI_array_growone(etags);
-                       BMINDEX_SET(e, BLI_array_count(etags)-1);
+                       BM_SetIndex(e, BLI_array_count(etags)-1);
                        BLI_smallhash_insert(&hash, (intptr_t)e, NULL);
                        BMO_SetFlag(bm, e, EDGE_OLD);
                }
@@ -272,11 +272,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                /*create tags for all loops in l->f*/
                                BM_ITER(l2, &liter2, bm, BM_LOOPS_OF_FACE, l->f) {
                                        BLI_array_growone(tags);
-                                       BMINDEX_SET(l2, BLI_array_count(tags)-1);
+                                       BM_SetIndex(l2, BLI_array_count(tags)-1);
                                        
                                        if (!BLI_smallhash_haskey(&hash, (intptr_t)l2->e)) {
                                                BLI_array_growone(etags);
-                                               BMINDEX_SET(l2->e, BLI_array_count(etags)-1);
+                                               BM_SetIndex(l2->e, BLI_array_count(etags)-1);
                                                BLI_smallhash_insert(&hash, (intptr_t)l2->e, NULL);                                             
                                                BMO_SetFlag(bm, l2->e, EDGE_OLD);
                                        }
@@ -330,11 +330,11 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                        if (BMO_TestFlag(bm, l->e, BEVEL_FLAG)) {
                                if (BMO_TestFlag(bm, l->prev->e, BEVEL_FLAG))
                                {
-                                       tag = tags + BMINDEX_GET(l);
+                                       tag = tags + BM_GetIndex(l);
                                        calc_corner_co(bm, l, co, fac);
                                        tag->newv = BM_Make_Vert(bm, co, l->v);
                                } else {
-                                       tag = tags + BMINDEX_GET(l);
+                                       tag = tags + BM_GetIndex(l);
                                        tag->newv = ETAG_GET(l->prev->e, l->v);
                                        
                                        if (!tag->newv) {
@@ -355,7 +355,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                        }
                                }
                        } else if (BMO_TestFlag(bm, l->v, BEVEL_FLAG)) {
-                               tag = tags + BMINDEX_GET(l);
+                               tag = tags + BM_GetIndex(l);
                                tag->newv = ETAG_GET(l->e, l->v);                               
                
                                if (!tag->newv) {
@@ -370,13 +370,13 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                        mul_v3_fl(co, fac);
                                        add_v3_v3(co, l->v->co);
                        
-                                       tag = tags + BMINDEX_GET(l);
+                                       tag = tags + BM_GetIndex(l);
                                        tag->newv = BM_Make_Vert(bm, co, l->v);
                                        
                                        ETAG_SET(l->e, l->v, tag->newv);
                                }                                       
                        } else {
-                               tag = tags + BMINDEX_GET(l);
+                               tag = tags + BM_GetIndex(l);
                                tag->newv = l->v;
                                BMO_ClearFlag(bm, l->v, BEVEL_DEL);
                        }
@@ -398,7 +398,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, faces[i]) {
                        BMVert *v2;
                        
-                       tag = tags + BMINDEX_GET(l);
+                       tag = tags + BM_GetIndex(l);
                        BLI_array_append(verts, tag->newv);
                        
                        if (!firstv)
@@ -411,10 +411,10 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                        }
                        lastv=tag->newv;
                        
-                       etag = etags + BMINDEX_GET(l->e);
+                       etag = etags + BM_GetIndex(l->e);
                        v2 = l->next->v == l->e->v1 ? etag->newv1 : etag->newv2;
                        
-                       tag = tags + BMINDEX_GET(l->next);
+                       tag = tags + BM_GetIndex(l->next);
                        if (!BMO_TestFlag(bm, l->e, BEVEL_FLAG) && v2 && v2 != tag->newv) {
                                BLI_array_append(verts, v2);
                                
@@ -453,15 +453,15 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                        if (!BMO_TestFlag(bm, l->e, BEVEL_FLAG))
                                continue;
                        
-                       v1 = tags[BMINDEX_GET(l)].newv;
-                       v2 = tags[BMINDEX_GET(l->next)].newv;
+                       v1 = tags[BM_GetIndex(l)].newv;
+                       v2 = tags[BM_GetIndex(l->next)].newv;
                        if (l->radial_next != l) {
-                               v3 = tags[BMINDEX_GET(l->radial_next)].newv;
+                               v3 = tags[BM_GetIndex(l->radial_next)].newv;
                                if (l->radial_next->next->v == l->next->v) {
                                        v4 = v3;
-                                       v3 = tags[BMINDEX_GET(l->radial_next->next)].newv;
+                                       v3 = tags[BM_GetIndex(l->radial_next->next)].newv;
                                } else {
-                                       v4 = tags[BMINDEX_GET(l->radial_next->next)].newv;
+                                       v4 = tags[BM_GetIndex(l->radial_next->next)].newv;
                                }
                        } else {
                                v3 = l->next->v;
@@ -586,9 +586,9 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                                rad++;
                                
                                if (l->v == v)
-                                       tag = tags + BMINDEX_GET(l);
+                                       tag = tags + BM_GetIndex(l);
                                else
-                                       tag = tags + BMINDEX_GET(l->next);
+                                       tag = tags + BM_GetIndex(l->next);
                                
                                if (!v1)
                                        v1 = tag->newv;
@@ -731,7 +731,7 @@ void bmesh_bevel_exec(BMesh *bm, BMOperator *op)
                        BMLoop *l2;
                        BMIter liter2;
                        
-                       tag = tags + BMINDEX_GET(l);
+                       tag = tags + BM_GetIndex(l);
                        if (!tag->newv)
                                continue;
                        
index e656e005858c91e5c989f58f0372f2654a770b64..4d591d89cbc8ddc7bb622e95c687f567ce307b19 100644 (file)
@@ -70,8 +70,8 @@ static int count_edge_faces(BMesh *bm, BMEdge *e);
 static int rotsys_append_edge(struct BMEdge *e, struct BMVert *v, 
                                                EdgeData *edata, VertData *vdata)
 {
-       EdgeData *ed = &edata[BMINDEX_GET(e)];
-       VertData *vd = &vdata[BMINDEX_GET(v)];
+       EdgeData *ed = &edata[BM_GetIndex(e)];
+       VertData *vd = &vdata[BM_GetIndex(v)];
        
        if (!vd->e) {
                Link *e1 = (Link*)rs_get_edge_link(e, v, ed);
@@ -80,11 +80,11 @@ static int rotsys_append_edge(struct BMEdge *e, struct BMVert *v,
                e1->next = e1->prev = (Link*)e;
        } else {
                Link *e1, *e2, *e3;
-               EdgeData *ved = &edata[BMINDEX_GET(vd->e)];
+               EdgeData *ved = &edata[BM_GetIndex(vd->e)];
 
                e1 = rs_get_edge_link(e, v, ed);
                e2 = rs_get_edge_link(vd->e, v, ved);
-               e3 = e2->prev ? rs_get_edge_link(e2->prev, v, &edata[BMINDEX_GET(e2->prev)]) : NULL;
+               e3 = e2->prev ? rs_get_edge_link(e2->prev, v, &edata[BM_GetIndex(e2->prev)]) : NULL;
 
                e1->next = (Link*)vd->e;
                e1->prev = e2->prev;
@@ -100,8 +100,8 @@ static int rotsys_append_edge(struct BMEdge *e, struct BMVert *v,
 static void rotsys_remove_edge(struct BMEdge *e, struct BMVert *v, 
                                                EdgeData *edata, VertData *vdata)
 {
-       EdgeData *ed = edata + BMINDEX_GET(e);
-       VertData *vd = vdata + BMINDEX_GET(v);
+       EdgeData *ed = edata + BM_GetIndex(e);
+       VertData *vd = vdata + BM_GetIndex(v);
        Link *e1, *e2;
 
        e1 = rs_get_edge_link(e, v, ed);
@@ -125,9 +125,9 @@ static struct BMEdge *rotsys_nextedge(struct BMEdge *e, struct BMVert *v,
                                                                        EdgeData *edata, VertData *UNUSED(vdata))
 {
        if (v == e->v1)
-               return edata[BMINDEX_GET(e)].dlink1.next;
+               return edata[BM_GetIndex(e)].dlink1.next;
        if (v == e->v2)
-               return edata[BMINDEX_GET(e)].dlink2.next;
+               return edata[BM_GetIndex(e)].dlink2.next;
        return NULL;
 }
 
@@ -135,9 +135,9 @@ static BMEdge *rotsys_prevedge(BMEdge *e, BMVert *v,
                                                EdgeData *edata, VertData *UNUSED(vdata))
 {
        if (v == e->v1)
-               return edata[BMINDEX_GET(e)].dlink1.prev;
+               return edata[BM_GetIndex(e)].dlink1.prev;
        if (v == e->v2)
-               return edata[BMINDEX_GET(e)].dlink2.prev;
+               return edata[BM_GetIndex(e)].dlink2.prev;
        return NULL;
 }
 
@@ -148,18 +148,18 @@ static struct BMEdge *rotsys_reverse(struct BMEdge *UNUSED(e), struct BMVert *v,
        BLI_array_staticdeclare(edges, 256);
        int i, totedge;
        
-       e2 = vdata[BMINDEX_GET(v)].e;
+       e2 = vdata[BM_GetIndex(v)].e;
        do {
                BLI_array_append(edges, e2);
                e2 = rotsys_nextedge(e2, v, edata, vdata);
-       } while (e2 != vdata[BMINDEX_GET(v)].e);
+       } while (e2 != vdata[BM_GetIndex(v)].e);
        
        totedge = BLI_array_count(edges);
        for (i=0; i<totedge/2; i++) {
                SWAP(BMEdge*, edges[i], edges[totedge-1-i]);
        }
        
-       vdata[BMINDEX_GET(v)].e = NULL;
+       vdata[BM_GetIndex(v)].e = NULL;
        for (i=0; i<totedge; i++) {
                rotsys_append_edge(edges[i], v, edata, vdata);
        }
@@ -171,7 +171,7 @@ static struct BMEdge *rotsys_reverse(struct BMEdge *UNUSED(e), struct BMVert *v,
 
 static int rotsys_count(struct BMVert *v, EdgeData *edata, VertData *vdata)
 {
-       BMEdge *e = vdata[BMINDEX_GET(v)].e;
+       BMEdge *e = vdata[BM_GetIndex(v)].e;
        int i=0;
 
        if (!e)
@@ -188,7 +188,7 @@ static int rotsys_count(struct BMVert *v, EdgeData *edata, VertData *vdata)
                }
 
                i += 1;
-       } while (e != vdata[BMINDEX_GET(v)].e);
+       } while (e != vdata[BM_GetIndex(v)].e);
 
        return i;
 }
@@ -278,7 +278,7 @@ static void rotsys_make_consistent(BMesh *bm, EdgeData *edata, VertData *vdata)
                
                v = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
                for (i=0; i<bm->totvert; i++, BMIter_Step(&iter)) {
-                       vd = vdata + BMINDEX_GET(v);
+                       vd = vdata + BM_GetIndex(v);
                        
                        if (vd->tag)
                                continue;
@@ -292,7 +292,7 @@ static void rotsys_make_consistent(BMesh *bm, EdgeData *edata, VertData *vdata)
                if (!startv)
                        break;
                
-               vd = vdata + BMINDEX_GET(startv);
+               vd = vdata + BM_GetIndex(startv);
                
                BLI_array_empty(stack);
                BLI_array_append(stack, startv);
@@ -301,7 +301,7 @@ static void rotsys_make_consistent(BMesh *bm, EdgeData *edata, VertData *vdata)
                
                while (BLI_array_count(stack)) {
                        v = BLI_array_pop(stack);
-                       vd = vdata + BMINDEX_GET(v);
+                       vd = vdata + BM_GetIndex(v);
                        
                        if (!vd->e)
                                continue;
@@ -309,7 +309,7 @@ static void rotsys_make_consistent(BMesh *bm, EdgeData *edata, VertData *vdata)
                        e = vd->e;
                        do {
                                BMVert *v2 = BM_OtherEdgeVert(e, v);
-                               VertData *vd2 = vdata + BMINDEX_GET(v2);
+                               VertData *vd2 = vdata + BM_GetIndex(v2);
                                
                                if (dot_v3v3(vd->no, vd2->no) < 0.0f+FLT_EPSILON*2) {
                                        rotsys_reverse(e, v2, edata, vdata);
@@ -346,7 +346,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                float no[3], cent[3];
                int j, k=0, totedge=0;
                
-               if (BMINDEX_GET(v) == -1)
+               if (BM_GetIndex(v) == -1)
                        continue;
                
                BLI_array_empty(edges);
@@ -399,7 +399,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        mul_v3_fl(vec1, len_v3v3(v2->co, v->co));
                        add_v3_v3(vec1, v->co);
                        
-                       copy_v3_v3(vdata[BMINDEX_GET(v2)].sco, vec1);
+                       copy_v3_v3(vdata[BM_GetIndex(v2)].sco, vec1);
                }
                
                BLI_srandom(0);
@@ -421,7 +421,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        e3 = edges[(i+1) % totedge];
                        
                        v1 = BM_OtherEdgeVert(e1, v); v2 = BM_OtherEdgeVert(e2, v); v3 = BM_OtherEdgeVert(e3, v);
-                       vd1 = vdata+BMINDEX_GET(v1); vd2 = vdata+BMINDEX_GET(v2); vd3 = vdata+BMINDEX_GET(v3);
+                       vd1 = vdata+BM_GetIndex(v1); vd2 = vdata+BM_GetIndex(v2); vd3 = vdata+BM_GetIndex(v3);
                        
                        sub_v3_v3v3(vec1, vd1->sco, cent);
                        sub_v3_v3v3(vec2, vd2->sco, cent);
@@ -457,7 +457,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        }
                }
                
-               copy_v3_v3(vdata[BMINDEX_GET(v)].offco, cent);
+               copy_v3_v3(vdata[BM_GetIndex(v)].offco, cent);
                //copy_v3_v3(v->co, cent);
                
                /*now, sort edges so the triangle fan of all edges
@@ -476,7 +476,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                                e3 = edges[(i+1) % totedge];
                                
                                v1 = BM_OtherEdgeVert(e1, v); v2 = BM_OtherEdgeVert(e2, v); v3 = BM_OtherEdgeVert(e3, v);
-                               vd1 = vdata+BMINDEX_GET(v1); vd2 = vdata+BMINDEX_GET(v2); vd3 = vdata+BMINDEX_GET(v3);
+                               vd1 = vdata+BM_GetIndex(v1); vd2 = vdata+BM_GetIndex(v2); vd3 = vdata+BM_GetIndex(v3);
        
                                sub_v3_v3v3(vec1, vd1->sco, cent);
                                sub_v3_v3v3(vec2, vd2->sco, cent);
@@ -520,7 +520,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                }
                
                normalize_v3(no);
-               copy_v3_v3(vdata[BMINDEX_GET(v)].no, no);
+               copy_v3_v3(vdata[BM_GetIndex(v)].no, no);
        }
        
        /*now, make sure rotation system is topologically consistent
@@ -536,13 +536,13 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                BMFace *f;
                int totedge = BM_Vert_EdgeCount(v);
 
-               if (BMINDEX_GET(v) == -1)
+               if (BM_GetIndex(v) == -1)
                        continue;
                
                //cv = BM_Make_Vert(bm, cent, v);
-               //BMINDEX_SET(cv, -1);
+               //BM_SetIndex(cv, -1);
                i = 0;
-               e = vdata[BMINDEX_GET(v)].e;
+               e = vdata[BM_GetIndex(v)].e;
                lastv = NULL;
                do {
                        BMEdge *e2;
@@ -556,12 +556,12 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        if (!BM_OtherEdgeVert(e, v))
                                continue;
                        
-                       sub_v3_v3v3(co, (BM_OtherEdgeVert(e, v))->co, vdata[BMINDEX_GET(v)].offco);
+                       sub_v3_v3v3(co, (BM_OtherEdgeVert(e, v))->co, vdata[BM_GetIndex(v)].offco);
                        mul_v3_fl(co, f);
-                       add_v3_v3(co, vdata[BMINDEX_GET(v)].offco);
+                       add_v3_v3(co, vdata[BM_GetIndex(v)].offco);
                        
                        v2 = BM_Make_Vert(bm, co, NULL);
-                       BMINDEX_SET(v2, -1);
+                       BM_SetIndex(v2, -1);
                        //BM_Make_Edge(bm, cv, v2, NULL, 0);
                        
                        BM_Select(bm, v2, 1);
@@ -575,7 +575,7 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        
                        e = rotsys_nextedge(e, v, edata, vdata);
                        i++;
-               } while (e != vdata[BMINDEX_GET(v)].e);
+               } while (e != vdata[BM_GetIndex(v)].e);
        }
 #endif
 
@@ -652,7 +652,7 @@ static float edge_weight_path(EPath *path, EdgeData *edata, VertData *UNUSED(vda
 
        for (node=path->nodes.first; node; node=node->next) {
                if (node->e && node != path->nodes.first) {
-                       w += edata[BMINDEX_GET(node->e)].ftag;
+                       w += edata[BM_GetIndex(node->e)].ftag;
                        if (node->prev) {
                                /*BMESH_TODO*/
                                //w += len_v3v3(node->v->co, first->e->v1->co)*0.0001f;
@@ -694,8 +694,8 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
        EPathNode *node;
        int i, use_restrict = BMO_Get_Int(op, "use_restrict");
 
-       startv = edata[BMINDEX_GET(edge)].ftag ? edge->v2 : edge->v1;
-       endv = edata[BMINDEX_GET(edge)].ftag ? edge->v1 : edge->v2;
+       startv = edata[BM_GetIndex(edge)].ftag ? edge->v2 : edge->v1;
+       endv = edata[BM_GetIndex(edge)].ftag ? edge->v1 : edge->v2;
        
        path = edge_path_new(pathbase, startv, edge);
        BLI_ghash_insert(gh, startv, NULL);
@@ -729,17 +729,17 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
                        break;
                }
                
-               vd = vdata + BMINDEX_GET(v1);
+               vd = vdata + BM_GetIndex(v1);
                if (!vd->e)
                        continue;
                
                v2 = NULL;
                while (1) {             
                        if (!last->cure) {
-                               last->cure = e = vdata[BMINDEX_GET(last->v)].e;
+                               last->cure = e = vdata[BM_GetIndex(last->v)].e;
                        } else {
                                last->cure = e = rotsys_nextedge(last->cure, last->v, edata, vdata);
-                               if (last->cure == vdata[BMINDEX_GET(last->v)].e) {
+                               if (last->cure == vdata[BM_GetIndex(last->v)].e) {
                                        v2 = NULL;
                                        break;
                                }
@@ -846,7 +846,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
        
        i = 0;
        BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
                i++;    
        }
 
@@ -856,7 +856,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
 
        i = 0;
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               BMINDEX_SET(e, i);
+               BM_SetIndex(e, i);
                
                if (!BMO_TestFlag(bm, e, EDGE_MARK)) {
                        edata[i].tag = 2;
@@ -876,7 +876,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
                        if (use_restrict && !BMO_InMap(bm, op, "restrict", e))
                                continue;
                                
-                       if (edata[BMINDEX_GET(e)].tag < 2) {
+                       if (edata[BM_GetIndex(e)].tag < 2) {
                                edge = e;
 
                                if (use_restrict) {
@@ -889,7 +889,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
                                                        j++;
                                                        gi = i;
 
-                                                       if (j-1 == edata[BMINDEX_GET(e)].tag)
+                                                       if (j-1 == edata[BM_GetIndex(e)].tag)
                                                                break;
                                                }
                                        }
@@ -904,7 +904,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
                if (!edge)
                        break;
 
-               edata[BMINDEX_GET(edge)].tag += 1;
+               edata[BM_GetIndex(edge)].tag += 1;
 
                path = edge_find_shortest_path(bm, op, edge, edata, vdata, pathbase, group);
                if (!path)
@@ -923,7 +923,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
                        if (!e)
                                break;
                        
-                       edata[BMINDEX_GET(e)].ftag++;
+                       edata[BM_GetIndex(e)].ftag++;
                        BLI_array_growone(edges);
                        edges[i++] = e;
 
@@ -932,7 +932,7 @@ void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op)
                
                BLI_array_growone(edges);
                edges[i++] = edge;
-               edata[BMINDEX_GET(edge)].ftag++;
+               edata[BM_GetIndex(edge)].ftag++;
                
                for (j=0; j<i; j++) {
                        if (count_edge_faces(bm, edges[j]) >= 2) {                      
index 64e9a55fcc8e419bcd5f5e3c17a7ab400468e054..de546d5d5b3735913887fbdc54260e6e1b6e620c 100644 (file)
@@ -102,8 +102,8 @@ static BMFace *remake_face(BMesh *bm, EdgeTag *etags, BMFace *f, BMVert **verts)
                if (l->e != l2->e) {
                        /*set up data for figuring out the two sides of
                          the splits*/
-                       BMINDEX_SET(l2->e, BMINDEX_GET(l->e));
-                       et = etags + BMINDEX_GET(l->e);
+                       BM_SetIndex(l2->e, BM_GetIndex(l->e));
+                       et = etags + BM_GetIndex(l->e);
                        
                        if (!et->newe1) et->newe1 = l2->e;
                        else et->newe2 = l2->e;
@@ -136,7 +136,7 @@ static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op))
                        if (!BMO_TestFlag(bm, e, EDGE_SEAM))
                                continue;
 
-                       et = etags + BMINDEX_GET(e);
+                       et = etags + BM_GetIndex(e);
                        if (!et->tag && e->l) {
                                break;
                        }
@@ -153,7 +153,7 @@ static void tag_out_edges(BMesh *bm, EdgeTag *etags, BMOperator *UNUSED(op))
                        v = i ? ((BMLoop*)l->next)->v : l->v;
 
                        while (1) {
-                               et = etags + BMINDEX_GET(l->e);
+                               et = etags + BM_GetIndex(l->e);
                                if (et->newe1 == l->e) {
                                        if (et->newe1) {
                                                BMO_SetFlag(bm, et->newe1, EDGE_RET1);
@@ -226,7 +226,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op)
        
        i = 0;
        BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
-               BMINDEX_SET(e, i);
+               BM_SetIndex(e, i);
                i++;
        }
 
@@ -252,7 +252,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op)
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
                        if (!BMO_TestFlag(bm, l->e, EDGE_SEAM)) {
                                if (!verts[i]) {
-                                       et = etags + BMINDEX_GET(l->e);
+                                       et = etags + BM_GetIndex(l->e);
                                        if (ETV(et, l->v, l))
                                                verts[i] = ETV(et, l->v, l);
                                        else verts[i] = l->v;
@@ -299,7 +299,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op)
                                        } while (l3 != l2 && !BMO_TestFlag(bm, l3->e, EDGE_SEAM));
 
                                        if (l3 == NULL || (BMO_TestFlag(bm, l3->e, EDGE_SEAM) && l3->e != l->e)) {
-                                               et = etags + BMINDEX_GET(l2->e);
+                                               et = etags + BM_GetIndex(l2->e);
                                                if (ETV(et, v, l2) == NULL) {
                                                        v2 = BM_Make_Vert(bm, v->co, NULL);
                                                        copy_v3_v3(v2->no, v->no);
@@ -314,7 +314,7 @@ void bmesh_edgesplitop_exec(BMesh *bm, BMOperator *op)
                                                                l3 = (BMLoop*)l3->radial_next;
                                                                l3 = BM_OtherFaceLoop(l3->e, l3->f, v);
                                                                
-                                                               et = etags + BMINDEX_GET(l3->e);
+                                                               et = etags + BM_GetIndex(l3->e);
                                                        } while (l3 != l2 && !BMO_TestFlag(bm, l3->e, EDGE_SEAM));
                                                } else v2 = ETV(et, v, l2);
 
index d9e7077c3344902eda735d5d354a9daa41d53df8..b59e89ff7d22f6937f7e6c43b1115097b76cd516 100644 (file)
@@ -130,7 +130,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) {
                normal_short_to_float_v3(v->no, mvert->no);
 
                vt[i] = v;
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
 
                /*this is necassary for selection counts to work properly*/
                if(v->head.flag & BM_SELECT) BM_Select_Vert(bm, v, 1);
@@ -398,7 +398,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                
                mvert->flag = BMFlags_To_MEFlags(v);
 
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
 
                /*copy over customdata*/
                CustomData_from_bmesh_block(&bm->vdata, &me->vdata, v->head.data, i);
@@ -414,14 +414,14 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                float *crease = CustomData_bmesh_get(&bm->edata, e->head.data, CD_CREASE);
                float *bweight = CustomData_bmesh_get(&bm->edata, e->head.data, CD_BWEIGHT);
                
-               medge->v1 = BMINDEX_GET(e->v1);
-               medge->v2 = BMINDEX_GET(e->v2);
+               medge->v1 = BM_GetIndex(e->v1);
+               medge->v2 = BM_GetIndex(e->v2);
                medge->crease = crease ? (char)((*crease)*255) : 0;
                medge->bweight = bweight ? (char)((*bweight)*255) : 0;
                
                medge->flag = BMFlags_To_MEFlags(e);
                
-               BMINDEX_SET(e, i);
+               BM_SetIndex(e, i);
 
                /*copy over customdata*/
                CustomData_from_bmesh_block(&bm->edata, &me->edata, e->head.data, i);
@@ -445,7 +445,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                                eve = BLI_addfillvert(l->v->co);
                                eve->tmp.p = l;
                                
-                               BMINDEX_SET(l, i);
+                               BM_SetIndex(l, i);
 
                                if (lasteve) {
                                        BLI_addfilledge(lasteve, eve);
@@ -510,22 +510,22 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                                
                                /*ensure correct winding.  I believe this is
                                  analogous to bubble sort on three elements.*/
-                               if (BMINDEX_GET(ls[0]) > BMINDEX_GET(ls[1])) {
+                               if (BM_GetIndex(ls[0]) > BM_GetIndex(ls[1])) {
                                        SWAP(BMLoop*, ls[0], ls[1]);
                                }
-                               if (BMINDEX_GET(ls[1]) > BMINDEX_GET(ls[2])) {
+                               if (BM_GetIndex(ls[1]) > BM_GetIndex(ls[2])) {
                                        SWAP(BMLoop*, ls[1], ls[2]);
                                }
-                               if (BMINDEX_GET(ls[0]) > BMINDEX_GET(ls[1])) {
+                               if (BM_GetIndex(ls[0]) > BM_GetIndex(ls[1])) {
                                        SWAP(BMLoop*, ls[0], ls[1]);
                                }
 
                                mface->mat_nr = f->mat_nr;
                                mface->flag = BMFlags_To_MEFlags(f);
                                
-                               mface->v1 = BMINDEX_GET(ls[0]->v);
-                               mface->v2 = BMINDEX_GET(ls[1]->v);
-                               mface->v3 = BMINDEX_GET(ls[2]->v);
+                               mface->v1 = BM_GetIndex(ls[0]->v);
+                               mface->v2 = BM_GetIndex(ls[1]->v);
+                               mface->v3 = BM_GetIndex(ls[2]->v);
 
                                test_index_face(mface, &me->fdata, i, 1);
                                
@@ -550,8 +550,8 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
 
                l = BMIter_New(&liter, bm, BM_LOOPS_OF_FACE, f);
                for ( ; l; l=BMIter_Step(&liter), j++, mloop++) {
-                       mloop->e = BMINDEX_GET(l->e);
-                       mloop->v = BMINDEX_GET(l->v);
+                       mloop->e = BM_GetIndex(l->e);
+                       mloop->v = BM_GetIndex(l->v);
 
                        /*copy over customdata*/
                        CustomData_from_bmesh_block(&bm->ldata, &me->ldata, l->head.data, j);
@@ -592,15 +592,15 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                                }
                                if(ob->par1 < ototvert) {
                                        eve = vertMap[ob->par1];
-                                       if(eve) ob->par1= BMINDEX_GET(eve);
+                                       if(eve) ob->par1= BM_GetIndex(eve);
                                }
                                if(ob->par2 < ototvert) {
                                        eve = vertMap[ob->par2];
-                                       if(eve) ob->par2= BMINDEX_GET(eve);
+                                       if(eve) ob->par2= BM_GetIndex(eve);
                                }
                                if(ob->par3 < ototvert) {
                                        eve = vertMap[ob->par3];
-                                       if(eve) ob->par3= BMINDEX_GET(eve);
+                                       if(eve) ob->par3= BM_GetIndex(eve);
                                }
                                
                        }
@@ -624,7 +624,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
                                                                eve = vertMap[hmd->indexar[i]];
                                                                
                                                                if (eve) {
-                                                                       hmd->indexar[j++] = BMINDEX_GET(eve);
+                                                                       hmd->indexar[j++] = BM_GetIndex(eve);
                                                                }
                                                        }
                                                        else j++;
index e8a18782abd53997159dd835dd4b6d8aa18be7ce..d2dab0d4af36c4dac5c1101924d203466faba94d 100644 (file)
@@ -72,7 +72,7 @@ void bmesh_mirror_exec(BMesh *bm, BMOperator *op) {
                BLI_array_growone(vmap);
                vmap[i] = v;
 
-               BMINDEX_SET(v2, i);
+               BM_SetIndex(v2, i);
                v2 = BMIter_Step(&iter);
 
                i += 1;
index 0110cab1a343710539efa7e2ea21b9ad1f5a03a7..5ae5c4bb4ec9e7609e7625fed07f21c9d458ed65 100644 (file)
@@ -120,12 +120,12 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op)
        }
 
        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-               BMINDEX_SET(f, 0);
+               BM_SetIndex(f, 0);
                BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
                        if (BMO_TestFlag(bm, l->v, ELE_DEL))
                                BMO_SetFlag(bm, f, FACE_MARK|ELE_DEL);
                        if (BMO_TestFlag(bm, l->e, EDGE_COL)) 
-                               BMINDEX_SET(f, BMINDEX_GET(f)+1);
+                               BM_SetIndex(f, BM_GetIndex(f)+1);
                }
        }
 
@@ -133,7 +133,7 @@ void bmesh_weldverts_exec(BMesh *bm, BMOperator *op)
                if (!BMO_TestFlag(bm, f, FACE_MARK))
                        continue;
 
-               if (f->len - BMINDEX_GET(f) < 3) {
+               if (f->len - BM_GetIndex(f) < 3) {
                        BMO_SetFlag(bm, f, ELE_DEL);
                        continue;
                }
index dc0a692fb3ff9c2872b6d429682cec9372ba7e57..5e95f8371ac0707cf7888f6da93677933885c1c3 100644 (file)
@@ -1252,7 +1252,7 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
                vert_list[i].v = v;
                vert_list[i].parent = NULL;
                vert_list[i].weight = FLT_MAX;
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
                i++;
        }
 
@@ -1261,7 +1261,7 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
        */
 
        /* set the distance/weight of the start vertex to 0 */
-       vert_list[BMINDEX_GET(sv)].weight = 0.0f;
+       vert_list[BM_GetIndex(sv)].weight = 0.0f;
 
        h = BLI_heap_new();
 
@@ -1276,10 +1276,10 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
                /* take the vertex with the lowest weight out of the heap */
                BMVert *v = (BMVert*)BLI_heap_popmin(h);
 
-               if( vert_list[BMINDEX_GET(v)].weight == FLT_MAX ) /* this means that there is no path */
+               if( vert_list[BM_GetIndex(v)].weight == FLT_MAX ) /* this means that there is no path */
                        break;
 
-               v_weight = vert_list[BMINDEX_GET(v)].weight;
+               v_weight = vert_list[BM_GetIndex(v)].weight;
 
                BM_ITER(e, &e_i, bm, BM_EDGES_OF_VERT, v) {
                        BMVert *u;
@@ -1291,13 +1291,13 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
 
                        u = ( e->v1 == v ) ? e->v2 : e->v1;
 
-                       if( e_weight < vert_list[BMINDEX_GET(u)].weight ) { /* is this path shorter ? */
+                       if( e_weight < vert_list[BM_GetIndex(u)].weight ) { /* is this path shorter ? */
                                /* add it if so */
-                               vert_list[BMINDEX_GET(u)].parent = v;
-                               vert_list[BMINDEX_GET(u)].weight = e_weight;
+                               vert_list[BM_GetIndex(u)].parent = v;
+                               vert_list[BM_GetIndex(u)].weight = e_weight;
 
                                /* we should do a heap update node function!!! :-/ */
-                               BLI_heap_remove(h, vert_list[BMINDEX_GET(u)].hn);
+                               BLI_heap_remove(h, vert_list[BM_GetIndex(u)].hn);
                                BLI_heap_insert(h, e_weight, u);
                        }
                }
@@ -1306,9 +1306,9 @@ void bmesh_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
        /* now we trace the path (if it exists) */
        v = ev;
 
-       while( vert_list[BMINDEX_GET(v)].parent != NULL ) {
+       while( vert_list[BM_GetIndex(v)].parent != NULL ) {
                BMO_SetFlag(bm, v, VERT_MARK);
-               v = vert_list[BMINDEX_GET(v)].parent;
+               v = vert_list[BM_GetIndex(v)].parent;
        }
 
        BLI_heap_free(h, NULL);
index df743d8a41a898670f62285d337608cde976fea8..5b9620cd2f81d47fc87508cbbbe74ddd87b59d33 100644 (file)
@@ -1990,11 +1990,11 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
        sharp = (sharp * M_PI) / 180.0;
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               BMINDEX_SET(f, 0);
+               BM_SetIndex(f, 0);
        }
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BM_TestHFlag(f, BM_HIDDEN) || !BM_TestHFlag(f, BM_SELECT) || BMINDEX_GET(f))
+               if (BM_TestHFlag(f, BM_HIDDEN) || !BM_TestHFlag(f, BM_SELECT) || BM_GetIndex(f))
                        continue;
 
                BLI_array_empty(stack);
@@ -2009,13 +2009,13 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
 
                        BM_Select(em->bm, f, 1);
 
-                       BMINDEX_SET(f, 1);
+                       BM_SetIndex(f, 1);
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
                                BM_ITER(l2, &liter2, em->bm, BM_LOOPS_OF_LOOP, l) {
                                        float angle;
 
-                                       if (BMINDEX_GET(l2->f) || BM_TestHFlag(l2->f, BM_HIDDEN))
+                                       if (BM_GetIndex(l2->f) || BM_TestHFlag(l2->f, BM_HIDDEN))
                                                continue;
 
                                        /* edge has exactly two neighboring faces, check angle */
@@ -2174,7 +2174,7 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
        BMIter iter;
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, 0);
+               BM_SetIndex(v, 0);
        }
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -2183,14 +2183,14 @@ static int select_next_loop(bContext *C, wmOperator *UNUSED(op))
                
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, f) {
                        if (BM_TestHFlag(l->v, BM_SELECT) && !BM_TestHFlag(l->v, BM_HIDDEN)) {
-                               BMINDEX_SET(l->next->v, 1);
+                               BM_SetIndex(l->next->v, 1);
                                BM_Select(em->bm, l->v, 0);
                        }
                }
        }
 
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (BMINDEX_GET(v)) {
+               if (BM_GetIndex(v)) {
                        BM_Select(em->bm, v, 1);
                }
        }
@@ -2224,7 +2224,7 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
        BMIter iter;
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               BMINDEX_SET(e, 0);
+               BM_SetIndex(e, 0);
        }
 
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -2240,14 +2240,14 @@ static int region_to_loop(bContext *C, wmOperator *UNUSED(op))
                        }
                        
                        if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1))
-                               BMINDEX_SET(l1->e, 1);
+                               BM_SetIndex(l1->e, 1);
                }
        }
 
        EDBM_clear_flag_all(em, BM_SELECT);
        
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               if (BMINDEX_GET(e) && !BM_TestHFlag(e, BM_HIDDEN))
+               if (BM_GetIndex(e) && !BM_TestHFlag(e, BM_HIDDEN))
                        BM_Select_Edge(em->bm, e, 1);
        }
        
@@ -2335,15 +2335,15 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
        BLI_smallhash_init(&visithash);
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               BMINDEX_SET(f, 0);
+               BM_SetIndex(f, 0);
        }
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                if (BM_TestHFlag(e, BM_SELECT)) {
                        BLI_array_append(edges, e);
-                       BMINDEX_SET(e, 1);
+                       BM_SetIndex(e, 1);
                } else {
-                       BMINDEX_SET(e, 0);
+                       BM_SetIndex(e, 0);
                }
        }
        
@@ -2358,7 +2358,7 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
                
                e = edges[i];
                
-               if (!BMINDEX_GET(e))
+               if (!BM_GetIndex(e))
                        continue;
                
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_EDGE, e) {
@@ -2379,9 +2379,9 @@ static int loop_find_regions(BMEditMesh *em, int selbigger)
                        int j;
                        
                        for (j=0; j<tot; j++) {
-                               BMINDEX_SET(region[j], 1);
+                               BM_SetIndex(region[j], 1);
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, region[j]) {
-                                       BMINDEX_SET(l->e, 0);
+                                       BM_SetIndex(l->e, 0);
                                }
                        }
                        
@@ -2417,7 +2417,7 @@ static int loop_to_region(bContext *C, wmOperator *op)
        EDBM_clear_flag_all(em, BM_SELECT);
        
        BM_ITER(f, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (BMINDEX_GET(f) && !BM_TestHFlag(f, BM_HIDDEN)) {
+               if (BM_GetIndex(f) && !BM_TestHFlag(f, BM_HIDDEN)) {
                        BM_Select_Face(em->bm, f, 1);
                }
        }
index 972b1a8bb6e30d6b78fe558335c5b3ec629dc2fa..17563d375f9f590a69138a271de4a7d0375d80b7 100644 (file)
@@ -2692,8 +2692,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                if (BM_TestHFlag(e, BM_SELECT))
-                       BMINDEX_SET(e, 1);
-               else BMINDEX_SET(e, 0);
+                       BM_SetIndex(e, 1);
+               else BM_SetIndex(e, 0);
        }
 
        /*handle case of one vert selected.  we identify
@@ -2730,17 +2730,17 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        l = e2->l;
                        e = BM_OtherFaceLoop(e2, l->f, v)->e;
 
-                       BMINDEX_SET(e, 1);
+                       BM_SetIndex(e, 1);
                        BM_SetHFlag(e, BM_SELECT);
                } else if (BM_Edge_FaceCount(e2) == 2) {
                        l = e2->l;
                        e = BM_OtherFaceLoop(e2, l->f, v)->e;
-                       BMINDEX_SET(e, 1);
+                       BM_SetIndex(e, 1);
                        BM_SetHFlag(e, BM_SELECT);
                        
                        l = e2->l->radial_next;
                        e = BM_OtherFaceLoop(e2, l->f, v)->e;
-                       BMINDEX_SET(e, 1);
+                       BM_SetIndex(e, 1);
                        BM_SetHFlag(e, BM_SELECT);
                }
 
@@ -2751,7 +2751,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        e2 = NULL;
                        i = 0;
                        BM_ITER(e, &eiter, em->bm, BM_EDGES_OF_VERT, v) {
-                               if (BMINDEX_GET(e)) {
+                               if (BM_GetIndex(e)) {
                                        e2 = e;
                                        i++;
                                }
@@ -2821,8 +2821,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
        BM_ITER(e, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                if (BM_TestHFlag(e, BM_SELECT))
-                       BMINDEX_SET(e, 1);
-               else BMINDEX_SET(e, 0);
+                       BM_SetIndex(e, 1);
+               else BM_SetIndex(e, 0);
        }
 
        /*constrict edge selection again*/
@@ -2830,7 +2830,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
                e2 = NULL;
                i = 0;
                BM_ITER(e, &eiter, em->bm, BM_EDGES_OF_VERT, v) {
-                       if (BMINDEX_GET(e)) {
+                       if (BM_GetIndex(e)) {
                                e2 = e;
                                i++;
                        }
@@ -4148,15 +4148,15 @@ static int select_mirror_exec(bContext *C, wmOperator *op)
 
        BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                if (!BM_TestHFlag(v1, BM_SELECT) || BM_TestHFlag(v1, BM_HIDDEN))
-                       BMINDEX_SET(v1, 0);
-               else BMINDEX_SET(v1, 1);
+                       BM_SetIndex(v1, 0);
+               else BM_SetIndex(v1, 1);
        }
 
        if (!extend)
                EDBM_clear_flag_all(em, BM_SELECT);
 
        BM_ITER(v1, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               if (!BMINDEX_GET(v1) || BM_TestHFlag(v1, BM_HIDDEN))
+               if (!BM_GetIndex(v1) || BM_TestHFlag(v1, BM_HIDDEN))
                        continue;
 
                VECCOPY(mirror_co, v1->co);
index 1aa9d0397813148aead9be42ce45c780ad1bc4cc..c6a5917066a9ad16987f72c2042a94a951323ffd 100644 (file)
@@ -650,7 +650,7 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
        /* we need the vert */
        totverts=0;
        BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(ev, totverts);
+               BM_SetIndex(ev, totverts);
                totverts++;
        }
        
@@ -693,8 +693,8 @@ UvVertMap *EDBM_make_uv_vert_map(BMEditMesh *em, int selected, int do_face_idx_a
                                buf->f= a;
                                buf->separate = 0;
                                
-                               buf->next= vmap->vert[BMINDEX_GET(l->v)];
-                               vmap->vert[BMINDEX_GET(l->v)]= buf;
+                               buf->next= vmap->vert[BM_GetIndex(l->v)];
+                               vmap->vert[BM_GetIndex(l->v)]= buf;
                                
                                buf++;
                                i++;
@@ -838,7 +838,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
 
        i = 0;
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
                i++;
 
                if (em->ob) 
@@ -856,9 +856,9 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
                
                mirr = BMBVH_FindClosestVertTopo(tree, co, BM_SEARCH_MAXDIST, v);
                if (mirr && mirr != v) {
-                       *idx = BMINDEX_GET(mirr);
+                       *idx = BM_GetIndex(mirr);
                        idx = CustomData_bmesh_get_layer_n(&em->bm->vdata,mirr->head.data, li);
-                       *idx = BMINDEX_GET(v);
+                       *idx = BM_GetIndex(v);
                } else *idx = -1;
        }
 
@@ -867,7 +867,7 @@ void EDBM_CacheMirrorVerts(BMEditMesh *em)
                i = 0;
                invert_m4_m4(invmat, em->ob->obmat);
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       BMINDEX_SET(v, i);
+                       BM_SetIndex(v, i);
                        i++;
 
                        mul_m4_v3(invmat, v->co);
index fba306cef1fe86c58ef18d018749249e2f7cd2e1..afb663bcfa2f734ab46624b5d199b8d0fc0e379d 100644 (file)
@@ -451,8 +451,8 @@ static float edgetag_cut_cost(BMEditMesh *em, int e1, int e2, int vert)
 {
        BMVert *v = EDBM_get_vert_for_index(em, vert);
        BMEdge *eed1 = EDBM_get_edge_for_index(em, e1), *eed2 = EDBM_get_edge_for_index(em, e2);
-       BMVert *v1 = EDBM_get_vert_for_index(em, (BMINDEX_GET(eed1->v1) == vert)? BMINDEX_GET(eed1->v2): BMINDEX_GET(eed1->v1) );
-       BMVert *v2 = EDBM_get_vert_for_index(em, (BMINDEX_GET(eed2->v1) == vert)? BMINDEX_GET(eed2->v2): BMINDEX_GET(eed2->v1) );
+       BMVert *v1 = EDBM_get_vert_for_index(em, (BM_GetIndex(eed1->v1) == vert)? BM_GetIndex(eed1->v2): vert );
+       BMVert *v2 = EDBM_get_vert_for_index(em, (BM_GetIndex(eed2->v1) == vert)? BM_GetIndex(eed2->v2): vert );
        float cost, d1[3], d2[3];
 
        cost = len_v3v3(v1->co, v->co);
@@ -566,7 +566,7 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
 
        /* we need the vert */
        BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(ev, totvert);
+               BM_SetIndex(ev, totvert);
                totvert++;
        }
 
@@ -576,7 +576,7 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
                        eed->head.flags[0].f |= ME_SEAM_DONE;
                }
 
-               BMINDEX_SET(eed, totedge);
+               BM_SetIndex(eed, totedge);
                totedge++;
        }
 
@@ -588,8 +588,8 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
 
        /* count edges, compute adjacent edges offsets and fill adjacent edges */
        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               nedges[BMINDEX_GET(eed->v1)+1]++;
-               nedges[BMINDEX_GET(eed->v2)+1]++;
+               nedges[BM_GetIndex(eed->v1)+1]++;
+               nedges[BM_GetIndex(eed->v2)+1]++;
        }
 
        for (a=1; a<totvert; a++) {
@@ -600,8 +600,8 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
        nedges[0] = nedges[1] = 0;
 
        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-               edges[nedges[BMINDEX_GET(eed->v1)+1]++] = a;
-               edges[nedges[BMINDEX_GET(eed->v2)+1]++] = a;
+               edges[nedges[BM_GetIndex(eed->v1)+1]++] = a;
+               edges[nedges[BM_GetIndex(eed->v2)+1]++] = a;
 
                cost[a] = 1e20f;
                prevedge[a] = -1;
@@ -610,8 +610,8 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
 
        /* regular dijkstra shortest path, but over edges instead of vertices */
        heap = BLI_heap_new();
-       BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(BMINDEX_GET(source)));
-       cost[BMINDEX_GET(source)] = 0.0f;
+       BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(BM_GetIndex(source)));
+       cost[BM_GetIndex(source)] = 0.0f;
 
        EDBM_init_index_arrays(em, 1, 1, 0);
 
@@ -619,7 +619,7 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
                mednum = GET_INT_FROM_POINTER(BLI_heap_popmin(heap));
                eed = EDBM_get_edge_for_index(em, mednum);
 
-               if (mednum == BMINDEX_GET(target))
+               if (mednum == BM_GetIndex(target))
                        break;
 
                if (eed->head.flags[0].f & ME_SEAM_DONE)
@@ -627,8 +627,8 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
 
                eed->head.flags[0].f |= ME_SEAM_DONE;
 
-               edgetag_add_adjacent(em, heap, mednum, BMINDEX_GET(eed->v1), nedges, edges, prevedge, cost);
-               edgetag_add_adjacent(em, heap, mednum, BMINDEX_GET(eed->v2), nedges, edges, prevedge, cost);
+               edgetag_add_adjacent(em, heap, mednum, BM_GetIndex(eed->v1), nedges, edges, prevedge, cost);
+               edgetag_add_adjacent(em, heap, mednum, BM_GetIndex(eed->v2), nedges, edges, prevedge, cost);
        }
        
        MEM_freeN(nedges);
@@ -640,17 +640,17 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
                eed->head.flags[0].f &= ~ME_SEAM_DONE;
        }
 
-       if (mednum != BMINDEX_GET(target)) {
+       if (mednum != BM_GetIndex(target)) {
                MEM_freeN(prevedge);
                EDBM_free_index_arrays(em);
                return 0;
        }
 
        /* follow path back to source and mark as seam */
-       if (mednum == BMINDEX_GET(target)) {
+       if (mednum == BM_GetIndex(target)) {
                short allseams = 1;
 
-               mednum = BMINDEX_GET(target);
+               mednum = BM_GetIndex(target);
                do {
                        eed = EDBM_get_edge_for_index(em, mednum);
                        if (!edgetag_context_check(scene, em, eed)) {
@@ -658,9 +658,9 @@ int edgetag_shortest_path(Scene *scene, BMEditMesh *em, BMEdge *source, BMEdge *
                                break;
                        }
                        mednum = prevedge[mednum];
-               } while (mednum != BMINDEX_GET(source));
+               } while (mednum != BM_GetIndex(source));
 
-               mednum = BMINDEX_GET(target);
+               mednum = BM_GetIndex(target);
                do {
                        eed = EDBM_get_edge_for_index(em, mednum);
                        if (allseams)
index db4dea15584f601647e609172348961895fe8e8c..68e1389008d2cd95ad89f1c0c2935564a1b9476e 100755 (executable)
@@ -1358,12 +1358,12 @@ static void remerge_faces(knifetool_opdata *kcd)
                } while (BLI_array_count(stack) > 0);
                
                if (BLI_array_count(faces) > 0) {
-                       idx = BMINDEX_GET(faces[0]);
+                       idx = BM_GetIndex(faces[0]);
                        
                        f2 = BM_Join_Faces(bm, faces, BLI_array_count(faces));
                        if (f2)  {
                                BMO_SetFlag(bm, f2, FACE_NEW);
-                               BMINDEX_SET(f2, idx);
+                               BM_SetIndex(f2, idx);
                        }
                }
        }
@@ -1391,7 +1391,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
        
        i = 0;
        BM_ITER(f, &bmiter, bm, BM_FACES_OF_MESH, NULL) {
-               BMINDEX_SET(f, i);
+               BM_SetIndex(f, i);
                faces[i] = f;
                i++;
        }
@@ -1449,7 +1449,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
                        
                        entry = BLI_memarena_alloc(arena, sizeof(*entry));
                        entry->kfe = kfe;
-                       BLI_addtail(face_nets+BMINDEX_GET(f), entry);
+                       BLI_addtail(face_nets+BM_GetIndex(f), entry);
                }
        }
        
@@ -1471,10 +1471,10 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
                for (ref=kfe->faces.first; ref; ref=ref->next) {
                        f = ref->ref;
                        
-                       if (face_nets[BMINDEX_GET(f)].first) {
+                       if (face_nets[BM_GetIndex(f)].first) {
                                entry = BLI_memarena_alloc(arena, sizeof(*entry));
                                entry->kfe = kfe;
-                               BLI_addtail(face_nets+BMINDEX_GET(f), entry);
+                               BLI_addtail(face_nets+BM_GetIndex(f), entry);
                        }
                }
        }
@@ -1561,7 +1561,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
                        } while (l != bm_firstfaceloop(f2));
        
                        BMO_ClearFlag(bm, f2, DEL);
-                       BMINDEX_SET(f2, i);
+                       BM_SetIndex(f2, i);
                        
                        BM_Face_UpdateNormal(bm, f2);
                        if (dot_v3v3(f->no, f2->no) < 0.0) {
@@ -1582,8 +1582,8 @@ static void knifenet_fill_faces(knifetool_opdata *kcd)
                if (!BMO_TestFlag(bm, f, FACE_NEW))
                        continue;
                
-               f2 = faces[BMINDEX_GET(f)];
-               if (BMINDEX_GET(f) < 0 || BMINDEX_GET(f) >= totface) {
+               f2 = faces[BM_GetIndex(f)];
+               if (BM_GetIndex(f) < 0 || BM_GetIndex(f) >= totface) {
                        printf("eek!!\n");
                }
 
index 24716e639f979766ec073ed12f5d78adcd2802f6..aa38950884bc38b9bb9f7d1a3bf7e4b8e812a4db 100644 (file)
@@ -970,7 +970,7 @@ long mesh_mirrtopo_table(Object *ob, char mode)
 
                        totvert= 0;
                        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               BMINDEX_SET(eve, totvert);
+                               BM_SetIndex(eve, totvert);
                                totvert++;
                        }
                }
@@ -983,8 +983,8 @@ long mesh_mirrtopo_table(Object *ob, char mode)
                /* Initialize the vert-edge-user counts used to detect unique topology */
                if(em) {
                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                               MirrTopoHash[BMINDEX_GET(eed->v1)]++;
-                               MirrTopoHash[BMINDEX_GET(eed->v2)]++;
+                               MirrTopoHash[BM_GetIndex(eed->v1)]++;
+                               MirrTopoHash[BM_GetIndex(eed->v2)]++;
                        }
                } else {
                        for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
@@ -1001,8 +1001,8 @@ long mesh_mirrtopo_table(Object *ob, char mode)
 
                        if(em) {
                                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
-                                       MirrTopoHash[BMINDEX_GET(eed->v1)] += MirrTopoHash_Prev[BMINDEX_GET(eed->v2)];
-                                       MirrTopoHash[BMINDEX_GET(eed->v2)] += MirrTopoHash_Prev[BMINDEX_GET(eed->v1)];
+                                       MirrTopoHash[BM_GetIndex(eed->v1)] += MirrTopoHash_Prev[BM_GetIndex(eed->v2)];
+                                       MirrTopoHash[BM_GetIndex(eed->v2)] += MirrTopoHash_Prev[BM_GetIndex(eed->v1)];
                                }
                        } else {
                                for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
index b4921d92270989373a34286341041cb6bc1e7f63..b50c526ef3d03b31d2ca0fcde171eb5af87f951e 100644 (file)
@@ -899,7 +899,7 @@ static void vgroup_blend(Object *ob)
 
                i= 0;
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       BMINDEX_SET(eve, i);
+                       BM_SetIndex(eve, i);
                        i++;
                }
                dvert_tot= i;
@@ -914,13 +914,13 @@ static void vgroup_blend(Object *ob)
                        if(sel1 != sel2) {
                                /* i1 is always the selected one */
                                if(sel1==TRUE && sel2==FALSE) {
-                                       i1= BMINDEX_GET(eed->v1);
-                                       i2= BMINDEX_GET(eed->v2);
+                                       i1= BM_GetIndex(eed->v1);
+                                       i2= BM_GetIndex(eed->v2);
                                        eve= eed->v2;
                                }
                                else {
-                                       i2= BMINDEX_GET(eed->v1);
-                                       i1= BMINDEX_GET(eed->v2);
+                                       i2= BM_GetIndex(eed->v1);
+                                       i1= BM_GetIndex(eed->v2);
                                        eve= eed->v1;
                                }
 
index 400b01addf0ae153630ffcd3375e1edeffa71821..4207d22a37255ed0b972a050c8bcc52f48516008 100644 (file)
@@ -199,9 +199,9 @@ static void set_mapped_co(void *vuserdata, int index, float *co, float *UNUSED(n
        TransVert *tv = userdata[1];
        BMVert *eve = EDBM_get_vert_for_index(em, index);
        
-       if (BMINDEX_GET(eve) != -1 && !tv[BMINDEX_GET(eve)].f1) {
-               copy_v3_v3(tv[BMINDEX_GET(eve)].maploc, co);
-               tv[BMINDEX_GET(eve)].f1 = 1;
+       if (BM_GetIndex(eve) != -1 && !tv[BM_GetIndex(eve)].f1) {
+               copy_v3_v3(tv[BM_GetIndex(eve)].maploc, co);
+               tv[BM_GetIndex(eve)].f1 = 1;
        }
 }
 
@@ -239,31 +239,31 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                if(em->bm->selectmode & SCE_SELECT_VERTEX) {
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
                                if(!BM_TestHFlag(eve, BM_HIDDEN) && BM_TestHFlag(eve, BM_SELECT)) {
-                                       BMINDEX_SET(eve, 1);
+                                       BM_SetIndex(eve, 1);
                                        tottrans++;
                                }
-                               else BMINDEX_SET(eve, 0);
+                               else BM_SetIndex(eve, 0);
                        }
                }
                else if(em->bm->selectmode & SCE_SELECT_EDGE) {
                        BMEdge *eed;
 
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                               BMINDEX_SET(eve, 0);
+                               BM_SetIndex(eve, 0);
 
                        BM_ITER(eed, &iter, bm, BM_EDGES_OF_MESH, NULL) {
                                if(!BM_TestHFlag(eed, BM_HIDDEN) && BM_TestHFlag(eed, BM_SELECT))
-                                       BMINDEX_SET(eed->v1, 1), BMINDEX_SET(eed->v2, 1);
+                                       BM_SetIndex(eed->v1, 1), BM_SetIndex(eed->v2, 1);
                        }
 
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                               if(BMINDEX_GET(eve)) tottrans++;
+                               if(BM_GetIndex(eve)) tottrans++;
                }
                else {
                        BMFace *efa;
 
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                               BMINDEX_SET(eve, 0);
+                               BM_SetIndex(eve, 0);
 
                        BM_ITER(efa, &iter, bm, BM_FACES_OF_MESH, NULL) {
                                if(!BM_TestHFlag(efa, BM_HIDDEN) && BM_TestHFlag(efa, BM_SELECT)) {
@@ -271,13 +271,13 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                                        BMLoop *l;
                                        
                                        BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, efa) {
-                                               BMINDEX_SET(l->v, 1);
+                                               BM_SetIndex(l->v, 1);
                                        }
                                }
                        }
 
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL)
-                               if(BMINDEX_GET(eve)) tottrans++;
+                               if(BM_GetIndex(eve)) tottrans++;
                }
                
                /* and now make transverts */
@@ -286,16 +286,16 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
                
                        a = 0;
                        BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
-                               if(BMINDEX_GET(eve)) {
-                                       BMINDEX_SET(eve, a);
+                               if(BM_GetIndex(eve)) {
+                                       BM_SetIndex(eve, a);
                                        VECCOPY(tv->oldloc, eve->co);
                                        tv->loc= eve->co;
                                        if(eve->no[0] != 0.0f || eve->no[1] != 0.0f ||eve->no[2] != 0.0f)
                                                tv->nor= eve->no; // note this is a hackish signal (ton)
-                                       tv->flag= BMINDEX_GET(eve) & SELECT;
+                                       tv->flag= BM_GetIndex(eve) & SELECT;
                                        tv++;
                                        a++;
-                               } else BMINDEX_SET(eve, -1);
+                               } else BM_SetIndex(eve, -1);
                        }
                        
                        userdata[1] = transvmain;
index d225f1b257268830ac7a95aba289eccbddb04c60..f1eff710c7ddb46b735f547e62977cab2603983d 100644 (file)
@@ -4426,10 +4426,10 @@ static int createSlideVerts(TransInfo *t)
        j = 0;
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                if (BM_TestHFlag(v, BM_SELECT)) {
-                       BMINDEX_SET(v, 1);
+                       BM_SetIndex(v, 1);
                        BLI_smallhash_insert(&table, (uintptr_t)v, SET_INT_IN_POINTER(j));
                        j += 1;
-               } else BMINDEX_SET(v, 0);
+               } else BM_SetIndex(v, 0);
        }
 
        if (!j)
@@ -4441,7 +4441,7 @@ static int createSlideVerts(TransInfo *t)
        while (1) {
                v = NULL;
                BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       if (BMINDEX_GET(v))
+                       if (BM_GetIndex(v))
                                break;
 
                }
@@ -4468,13 +4468,13 @@ static int createSlideVerts(TransInfo *t)
 
                        numsel += 1;
 
-                       if (!BMINDEX_GET(BM_OtherEdgeVert(e, v)))
+                       if (!BM_GetIndex(BM_OtherEdgeVert(e, v)))
                                break;
 
                        v = BM_OtherEdgeVert(e, v);
                } while (e != first->e);
 
-               BMINDEX_SET(v, 0);
+               BM_SetIndex(v, 0);
 
                l1 = l2 = l = NULL;
                l1 = e->l;
@@ -4531,8 +4531,8 @@ static int createSlideVerts(TransInfo *t)
                                        sub_v3_v3v3(sv->downvec, BM_OtherEdgeVert(l->e, v)->co, v->co);
                                }
 
-                               BMINDEX_SET(v, 0);
-                               BMINDEX_SET(v2, 0);
+                               BM_SetIndex(v, 0);
+                               BM_SetIndex(v2, 0);
                                
                                j += 2;
                                break;
@@ -4543,8 +4543,8 @@ static int createSlideVerts(TransInfo *t)
 
                        j += 1;
 
-                       BMINDEX_SET(v, 0);
-                       BMINDEX_SET(v2, 0);
+                       BM_SetIndex(v, 0);
+                       BM_SetIndex(v2, 0);
                } while (e != first->e && l1);
        }
 
index 4f59602ed03fa2c828b441938e319ba070214f9c..238580a9bd6c6f92585e4bfeb039e01977ab2e4d 100644 (file)
@@ -1836,7 +1836,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
        
        i = 0;
        BM_ITER(v, &viter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, i);
+               BM_SetIndex(v, i);
                dists[i] = FLT_MAX;
                i++;
        }
@@ -1851,7 +1851,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
                BLI_smallhash_insert(visit, (uintptr_t)v, NULL);
                BLI_array_append(queue, v);
                BLI_array_append(dqueue, 0.0f);
-               dists[BMINDEX_GET(v)] = 0.0f;
+               dists[BM_GetIndex(v)] = 0.0f;
        }
        
        start = 0;
@@ -1876,12 +1876,12 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
                        
                        d2 = d + len_v3(vec);
                        
-                       if (dists[BMINDEX_GET(v3)] != FLT_MAX)
-                               dists[BMINDEX_GET(v3)] = MIN2(d2, dists[BMINDEX_GET(v3)]);
+                       if (dists[BM_GetIndex(v3)] != FLT_MAX)
+                               dists[BM_GetIndex(v3)] = MIN2(d2, dists[BM_GetIndex(v3)]);
                        else
-                               dists[BMINDEX_GET(v3)] = d2;
+                               dists[BM_GetIndex(v3)] = d2;
                        
-                       tots[BMINDEX_GET(v3)] = 1;
+                       tots[BM_GetIndex(v3)] = 1;
 
                        if (BLI_smallhash_haskey(visit, (uintptr_t)v3))
                                continue;
@@ -2090,27 +2090,27 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        if(selectmode & SCE_SELECT_VERTEX) {
                BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
                        if(!BM_TestHFlag(eve, BM_HIDDEN) && BM_TestHFlag(eve, BM_SELECT))
-                               BMINDEX_SET(eve, SELECT);
+                               BM_SetIndex(eve, SELECT);
                        else
-                               BMINDEX_SET(eve, 0);
+                               BM_SetIndex(eve, 0);
                }
        }
        else if(selectmode & SCE_SELECT_EDGE) {
                BMEdge *eed;
 
                eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
-               for( ; eve; eve=BMIter_Step(&iter)) BMINDEX_SET(eve, 0);
+               for( ; eve; eve=BMIter_Step(&iter)) BM_SetIndex(eve, 0);
 
                eed = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, NULL);
                for( ; eed; eed=BMIter_Step(&iter)) {
                        if(!BM_TestHFlag(eed, BM_HIDDEN) && BM_TestHFlag(eed, BM_SELECT))
-                               BMINDEX_SET(eed->v1, SELECT), BMINDEX_SET(eed->v2, SELECT);
+                               BM_SetIndex(eed->v1, SELECT), BM_SetIndex(eed->v2, SELECT);
                }
        }
        else {
                BMFace *efa;
                eve = BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);
-               for( ; eve; eve=BMIter_Step(&iter)) BMINDEX_SET(eve, 0);
+               for( ; eve; eve=BMIter_Step(&iter)) BM_SetIndex(eve, 0);
 
                efa = BMIter_New(&iter, bm, BM_FACES_OF_MESH, NULL);
                for( ; efa; efa=BMIter_Step(&iter)) {
@@ -2120,7 +2120,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
 
                                l = BMIter_New(&liter, bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l=BMIter_Step(&liter)) {
-                                       BMINDEX_SET(l->v, SELECT);
+                                       BM_SetIndex(l->v, SELECT);
                                }
                        }
                }
@@ -2134,7 +2134,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
                BLI_array_growone(selstate);
 
                if(!BM_TestHFlag(eve, BM_HIDDEN)) {     
-                       if(BMINDEX_GET(eve)) {
+                       if(BM_GetIndex(eve)) {
                                selstate[a] = 1;
                                countsel++;
                        }
@@ -2233,12 +2233,12 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
                                }
 
                                /* CrazySpace */
-                               if(defmats || (quats && BMINDEX_GET(eve) != -1)) {
+                               if(defmats || (quats && BM_GetIndex(eve) != -1)) {
                                        float mat[3][3], qmat[3][3], imat[3][3];
 
                                        /* use both or either quat and defmat correction */
-                                       if(quats && BMINDEX_GET(eve) != -1) {
-                                               quat_to_mat3(qmat, quats + 4*BMINDEX_GET(eve));
+                                       if(quats && BM_GetIndex(eve) != -1) {
+                                               quat_to_mat3(qmat, quats + 4*BM_GetIndex(eve));
 
                                                if(defmats)
                                                        mul_serie_m3(mat, mtx, qmat, defmats[a],
@@ -2471,11 +2471,11 @@ static void createTransUVs(bContext *C, TransInfo *t)
                tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
                if(!uvedit_face_visible(scene, ima, efa, tf)) {
-                       BMINDEX_SET(efa, 0);
+                       BM_SetIndex(efa, 0);
                        continue;
                }
                
-               BMINDEX_SET(efa, 1);
+               BM_SetIndex(efa, 1);
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                        if (uvedit_uv_selected(em, scene, l)) 
                                countsel++;
@@ -2501,7 +2501,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
        td2d= t->data2d;
 
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BMINDEX_GET(efa))
+               if (!BM_GetIndex(efa))
                        continue;
 
                tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
index 1dd24db36ec2ba6151e1458a462c80fec6e4fc52..7a661a94c04f351b836fdf123afa833d69a82ea2 100644 (file)
@@ -150,7 +150,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
        int index = 0;
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, index);
+               BM_SetIndex(v, index);
                index++;
        }
        
@@ -163,18 +163,18 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
                        BMLoop *l2 = BM_OtherFaceLoop(l->e, l->f, v);
                        
                        /* retrieve mapped coordinates */
-                       v1= mappedcos + 3*BMINDEX_GET(l->v);
-                       v2= mappedcos + 3*BMINDEX_GET(BM_OtherEdgeVert(l2->e, l->v));
-                       v3= mappedcos + 3*BMINDEX_GET(BM_OtherEdgeVert(l->e, l->v));
+                       v1= mappedcos + 3*BM_GetIndex(l->v);
+                       v2= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v));
+                       v3= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v));
                        
-                       co1= (origcos)? origcos + 3*BMINDEX_GET(l->v) : l->v->co;
-                       co2= (origcos)? origcos + 3*BMINDEX_GET(BM_OtherEdgeVert(l2->e, l->v)) : BM_OtherEdgeVert(l2->e, l->v)->co;
-                       co3= (origcos)? origcos + 3*BMINDEX_GET(BM_OtherEdgeVert(l->e, l->v)) : BM_OtherEdgeVert(l->e, l->v)->co;
+                       co1= (origcos)? origcos + 3*BM_GetIndex(l->v) : l->v->co;
+                       co2= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v)) : BM_OtherEdgeVert(l2->e, l->v)->co;
+                       co3= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v)) : BM_OtherEdgeVert(l->e, l->v)->co;
                        
                        set_crazy_vertex_quat(quats, v1, v2, v3, co1, co2, co3);
                        quats+= 4;
                        
-                       vert_table[BMINDEX_GET(l->v)] = index+1;
+                       vert_table[BM_GetIndex(l->v)] = index+1;
                        
                        index++;
                        break; /*just do one corner*/
@@ -184,9 +184,9 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped
        index = 0;
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                if (vert_table[index] != 0)
-                       BMINDEX_SET(v, vert_table[index]-1);
+                       BM_SetIndex(v, vert_table[index]-1);
                else
-                       BMINDEX_SET(v, -1);
+                       BM_SetIndex(v, -1);
                
                index++;
        }
index 6b3cc1a8278f489722b7e5396be59ca23073e864..eb210822edb510a5d12f1f0178ef0509cc5a6f22 100644 (file)
@@ -209,12 +209,12 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                                totuvarea += poly_uv_area(tf_uv, efa->len);
                                
                                if(uvedit_face_visible(scene, ima, efa, tf)) {
-                                       BMINDEX_SET(efa, 1);
+                                       BM_SetIndex(efa, 1);
                                }
                                else {
                                        if(tf == activetf)
                                                activetf= NULL;
-                                       BMINDEX_SET(efa, 0);
+                                       BM_SetIndex(efa, 0);
                                }
                        }
                        
@@ -223,7 +223,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                                col[1] = col[2] = 0.0;
                                glColor3fv(col);
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BMINDEX_GET(efa)) {
+                                       if(BM_GetIndex(efa)) {
                                                glBegin(GL_POLYGON);
                                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -235,7 +235,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, BMEditMesh *em, MTe
                        }
                        else {
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BMINDEX_GET(efa)) {
+                                       if(BM_GetIndex(efa)) {
                                                area = BM_face_area(efa) / totarea;
 
                                                BLI_array_empty(tf_uv);
@@ -538,7 +538,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                        
                        if(uvedit_face_visible(scene, ima, efa, tf)) {
-                               BMINDEX_SET(efa, 1);
+                               BM_SetIndex(efa, 1);
                                if(tf==activetf) continue; /* important the temp boolean is set above */
 
                                if(uvedit_face_selected(scene, em, efa))
@@ -556,7 +556,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else {
                                if(tf == activetf)
                                        activetf= NULL;
-                               BMINDEX_SET(efa, 0);
+                               BM_SetIndex(efa, 0);
                        }
                }
                glDisable(GL_BLEND);
@@ -568,12 +568,12 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
                        if(uvedit_face_visible(scene, ima, efa, tf)) {          
-                               BMINDEX_SET(efa, 1);
+                               BM_SetIndex(efa, 1);
                        }
                        else {
                                if(tf == activetf)
                                        activetf= NULL;
-                               BMINDEX_SET(efa, 0);
+                               BM_SetIndex(efa, 0);
                        }
                }
                
@@ -611,7 +611,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        switch(sima->dt_uv) {
                case SI_UVDT_DASH:
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BMINDEX_GET(efa))
+                               if (!BM_GetIndex(efa))
                                        continue;
                                tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
@@ -652,7 +652,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else glColor3f(0.0f, 0.0f, 0.0f);
 
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BMINDEX_GET(efa))
+                               if (!BM_GetIndex(efa))
                                        continue;
 
                                glBegin(GL_LINE_LOOP);
@@ -668,7 +668,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        cpack(0x0);
                        
                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if (!BMINDEX_GET(efa))
+                               if (!BM_GetIndex(efa))
                                        continue;
 
                                glBegin(GL_LINE_LOOP);
@@ -691,7 +691,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                        glShadeModel(GL_SMOOTH);
 
                                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                               if (!BMINDEX_GET(efa))
+                                               if (!BM_GetIndex(efa))
                                                        continue;
 
                                                glBegin(GL_LINE_LOOP);
@@ -713,7 +713,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                                }
                                else {
                                        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                               if (!BMINDEX_GET(efa))
+                                               if (!BM_GetIndex(efa))
                                                        continue;
 
                                                glBegin(GL_LINE_LOOP);
@@ -735,7 +735,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
                        else {
                                /* no nice edges */
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if (!BMINDEX_GET(efa))
+                                       if (!BM_GetIndex(efa))
                                                continue;
                                
                                        glBegin(GL_LINE_LOOP);
@@ -768,7 +768,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BMINDEX_GET(efa))
+                       if (!BM_GetIndex(efa))
                                continue;
 
                        if(!uvedit_face_selected(scene, em, efa)) {
@@ -783,7 +783,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
 
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BMINDEX_GET(efa))
+                       if (!BM_GetIndex(efa))
                                continue;
 
                        if(uvedit_face_selected(scene, em, efa)) {
@@ -804,7 +804,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BMINDEX_GET(efa))
+                       if (!BM_GetIndex(efa))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -822,7 +822,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BMINDEX_GET(efa))
+                       if (!BM_GetIndex(efa))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -840,7 +840,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit)
        
                bglBegin(GL_POINTS);
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if (!BMINDEX_GET(efa))
+                       if (!BM_GetIndex(efa))
                                continue;
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
index 2919c65211fd272ac6da205409ebbc0f2ddea82e..420254b0ba14316bbc46d1b4d249df19a9d54af2 100644 (file)
@@ -613,7 +613,7 @@ static void find_nearest_uv_edge(Scene *scene, Image *ima, BMEditMesh *em, float
 
        eve = BMIter_New(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
        for (i=0; eve; eve=BMIter_Step(&iter), i++) {
-               BMINDEX_SET(eve, i);
+               BM_SetIndex(eve, i);
        }
        
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -637,8 +637,8 @@ static void find_nearest_uv_edge(Scene *scene, Image *ima, BMEditMesh *em, float
                                hit->luv = luv;
                                hit->nextluv = nextluv;
                                hit->lindex = i;
-                               hit->vert1 = BMINDEX_GET(hit->l->v);
-                               hit->vert2 = BMINDEX_GET(((BMLoop*)hit->l->next)->v);
+                               hit->vert1 = BM_GetIndex(hit->l->v);
+                               hit->vert2 = BM_GetIndex(((BMLoop*)hit->l->next)->v);
 
                                mindist = dist;
                        }
@@ -758,7 +758,7 @@ static void find_nearest_uv_vert(Scene *scene, Image *ima, BMEditMesh *em,
        
        eve = BMIter_New(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
        for (i=0; eve; eve=BMIter_Step(&iter), i++) {
-               BMINDEX_SET(eve, i);
+               BM_SetIndex(eve, i);
        }
 
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
@@ -791,7 +791,7 @@ static void find_nearest_uv_vert(Scene *scene, Image *ima, BMEditMesh *em,
                                hit->tf= tf;
                                hit->efa= efa;
                                hit->lindex = i;
-                               hit->vert1 = BMINDEX_GET(hit->l->v);
+                               hit->vert1 = BM_GetIndex(hit->l->v);
                        }
 
                        i++;
@@ -860,12 +860,12 @@ static UvMapVert *uv_vertex_map_get(UvVertMap *vmap, BMFace *efa, int a)
        BMLoop *l;
 
        l = BMIter_AtIndex(NULL, BM_LOOPS_OF_FACE, efa, a);
-       first= EDBM_get_uv_map_vert(vmap,  BMINDEX_GET(l->v));
+       first= EDBM_get_uv_map_vert(vmap,  BM_GetIndex(l->v));
 
        for(iterv=first; iterv; iterv=iterv->next) {
                if(iterv->separate)
                        first= iterv;
-               if(iterv->f == BMINDEX_GET(efa))
+               if(iterv->f == BM_GetIndex(efa))
                        return first;
        }
        
@@ -941,7 +941,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
 
        count = 0;
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(eve, count);
+               BM_SetIndex(eve, count);
                count++;
        }
 
@@ -952,7 +952,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
                }
                
                BMO_ClearFlag(em->bm, efa, EFA_F1_FLAG);
-               BMINDEX_SET(efa, count);
+               BM_SetIndex(efa, count);
                count++;
        }
 
@@ -1123,7 +1123,7 @@ static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, float limit[
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
 
                        /* make_uv_vert_map_EM sets verts tmp.l to the indices */
-                       vlist= EDBM_get_uv_map_vert(vmap, BMINDEX_GET(l->v));
+                       vlist= EDBM_get_uv_map_vert(vmap, BM_GetIndex(l->v));
                        
                        startv= vlist;
 
@@ -1448,7 +1448,7 @@ static int stitch_exec(bContext *C, wmOperator *op)
                // index and count verts
                count=0;
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                       BMINDEX_SET(eve, count);
+                       BM_SetIndex(eve, count);
                        count++;
                }
                
@@ -1463,7 +1463,7 @@ static int stitch_exec(bContext *C, wmOperator *op)
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                if(uvedit_uv_selected(em, scene, l)) {
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                                       uvav = uv_average + BMINDEX_GET(l->v);
+                                       uvav = uv_average + BM_GetIndex(l->v);
 
                                        uvav->count++;
                                        uvav->uv[0] += luv->uv[0];
@@ -1481,7 +1481,7 @@ static int stitch_exec(bContext *C, wmOperator *op)
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                if(uvedit_uv_selected(em, scene, l)) {
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                                       uvav = uv_average + BMINDEX_GET(l->v);
+                                       uvav = uv_average + BM_GetIndex(l->v);
                                        luv->uv[0] = uvav->uv[0]/uvav->count;
                                        luv->uv[1] = uvav->uv[1]/uvav->count;
                                }
@@ -1763,7 +1763,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
                        BLI_array_growone(hitv);
                        BLI_array_growone(hituv);
                        hituv[i]= luv->uv;
-                       hitv[i] = BMINDEX_GET(l->v);
+                       hitv[i] = BM_GetIndex(l->v);
                        i++;
                }
                
@@ -1834,7 +1834,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
                        
                        a = 0;
                        BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               BMINDEX_SET(ev, a);
+                               BM_SetIndex(ev, a);
                                a++;
                        }
 
@@ -1847,7 +1847,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
 
                                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                                               if(sticky_select(limit, hitv, BMINDEX_GET(l->v), hituv, luv->uv, sticky, hitlen))
+                                               if(sticky_select(limit, hitv, BM_GetIndex(l->v), hituv, luv->uv, sticky, hitlen))
                                                        uvedit_uv_deselect(em, scene, l);
                                        }
                                }
@@ -1862,7 +1862,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
 
                                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                                               if(sticky_select(limit, hitv, BMINDEX_GET(l->v), hituv, luv->uv, sticky, hitlen))
+                                               if(sticky_select(limit, hitv, BM_GetIndex(l->v), hituv, luv->uv, sticky, hitlen))
                                                        uvedit_uv_select(em, scene, l);
                                        }
                                }
@@ -1903,7 +1903,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop)
                                        if(sticky == SI_STICKY_DISABLE) continue;
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
 
-                                       if(sticky_select(limit, hitv, BMINDEX_GET(l->v), hituv, luv->uv, sticky, hitlen))
+                                       if(sticky_select(limit, hitv, BM_GetIndex(l->v), hituv, luv->uv, sticky, hitlen))
                                                uvedit_uv_select(em, scene, l);
 
                                        flush= 1;
@@ -2222,12 +2222,12 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                BMVert *eve;
                
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
-                       BMINDEX_SET(eve, 0);
+                       BM_SetIndex(eve, 0);
                
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if(BMINDEX_GET(efa)) {
+                       if(BM_GetIndex(efa)) {
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                                       BMINDEX_SET(l->v, 1);
+                                       BM_SetIndex(l->v, 1);
                                }
                        }
                }
@@ -2237,7 +2237,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                        tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
 
                        BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                               if (BMINDEX_GET(l->v)) {
+                               if (BM_GetIndex(l->v)) {
                                        if (select)
                                                uvedit_uv_select(em, scene, l);
                                        else
@@ -2271,7 +2271,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                
                efa = BMIter_New(&iter, em->bm, BM_FACES_OF_MESH, NULL);
                for (efa_index=0; efa; efa=BMIter_Step(&iter), efa_index++) {
-                       if(BMINDEX_GET(efa)) {
+                       if(BM_GetIndex(efa)) {
                                tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                                
                                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
@@ -2280,7 +2280,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
                                        else
                                                uvedit_uv_deselect(em, scene, l);
                                        
-                                       vlist_iter= EDBM_get_uv_map_vert(vmap, BMINDEX_GET(l->v));
+                                       vlist_iter= EDBM_get_uv_map_vert(vmap, BM_GetIndex(l->v));
                                        
                                        while (vlist_iter) {
                                                if(vlist_iter->separate)
@@ -2318,7 +2318,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje
        }
        else { /* SI_STICKY_DISABLE or ts->uv_flag & UV_SYNC_SELECTION */
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                       if(BMINDEX_GET(efa)) {
+                       if(BM_GetIndex(efa)) {
                                if(select)
                                        uvedit_face_select(scene, em, efa);
                                else
@@ -2373,13 +2373,13 @@ static int border_select_exec(bContext *C, wmOperator *op)
 
                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                        /* assume not touched */
-                       BMINDEX_SET(efa, 0);
+                       BM_SetIndex(efa, 0);
 
                        tf= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                        if(uvedit_face_visible(scene, ima, efa, tf)) {
                                poly_uv_center(em, efa, cent);
                                if(BLI_in_rctf(&rectf, cent[0], cent[1])) {
-                                       BMINDEX_SET(efa, 1);
+                                       BM_SetIndex(efa, 1);
                                        change = 1;
                                }
                        }
@@ -2665,23 +2665,23 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        
        /* set all verts to -1 : an unused index*/
        BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL)
-               BMINDEX_SET(eve, -1);
+               BM_SetIndex(eve, -1);
        
        /* index every vert that has a selected UV using it, but only once so as to
         * get unique indices and to count how much to malloc */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
                if(!uvedit_face_visible(scene, ima, efa, tface)) {
-                       BMINDEX_SET(efa, 0);
+                       BM_SetIndex(efa, 0);
                        continue;
                } else {
-                       BMINDEX_SET(efa, 1);
+                       BM_SetIndex(efa, 1);
                }
 
                change = 1;
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                       if (uvedit_uv_selected(em, scene, l) && BMINDEX_GET(l->v) == -1) {
-                               BMINDEX_SET(l->v, count);
+                       if (uvedit_uv_selected(em, scene, l) && BM_GetIndex(l->v) == -1) {
+                               BM_SetIndex(l->v, count);
                                count++;
                        }
                }
@@ -2692,7 +2692,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        
        /* add all UV coords from visible, unselected UV coords as well as counting them to average later */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BMINDEX_GET(efa))
+               if (!BM_GetIndex(efa))
                        continue;
 
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
@@ -2700,11 +2700,11 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
                        continue;
 
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                       if (BMINDEX_GET(l->v) >= 0 && 
+                       if (BM_GetIndex(l->v) >= 0 && 
                            (!uvedit_uv_selected(em, scene, l))) {
                                    luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                                   coords[BMINDEX_GET(l->v)*2] += luv->uv[0];
-                                   coords[BMINDEX_GET(l->v)*2+1] += luv->uv[1];
+                                   coords[BM_GetIndex(l->v)*2] += luv->uv[0];
+                                   coords[BM_GetIndex(l->v)*2+1] += luv->uv[1];
                                    change = 1;
                        }
                }
@@ -2719,7 +2719,7 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
        
        /* copy the averaged unselected UVs back to the selected UVs */
        BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-               if (!BMINDEX_GET(efa))
+               if (!BM_GetIndex(efa))
                        continue;
 
                tface= CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
@@ -2727,11 +2727,11 @@ static int snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obe
                        continue;
 
                BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
-                       if (uvedit_uv_selected(em, scene, l) && BMINDEX_GET(l->v) >= 0
-                           && (users = usercount[BMINDEX_GET(l->v)])) {
+                       if (uvedit_uv_selected(em, scene, l) && BM_GetIndex(l->v) >= 0
+                           && (users = usercount[BM_GetIndex(l->v)])) {
                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
-                               luv->uv[0] = coords[BMINDEX_GET(l->v)*2];
-                               luv->uv[1] = coords[BMINDEX_GET(l->v)*2+1];
+                               luv->uv[0] = coords[BM_GetIndex(l->v)*2];
+                               luv->uv[1] = coords[BM_GetIndex(l->v)*2+1];
                        }
                }
        }
@@ -3043,7 +3043,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
        int stickymode= sima ? (sima->sticky != SI_STICKY_DISABLE) : 1;
        
        BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(v, BM_TestHFlag(v, BM_SELECT));
+               BM_SetIndex(v, BM_TestHFlag(v, BM_SELECT));
        }
 
        /* call the mesh function if we are in mesh sync sel */
index f10745adb8b5aaa4728b5d303f0dd41f24215bac..50fe6a04ed401bdcd3d82b360b334bdd25f34d49 100644 (file)
@@ -174,7 +174,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
        /* we need the vert indices */
        a = 0;
        BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-               BMINDEX_SET(ev, a);
+               BM_SetIndex(ev, a);
                a++;
        }
        
@@ -252,9 +252,9 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                        luvs[1] = CustomData_bmesh_get(&em->bm->ldata, ls[1]->head.data, CD_MLOOPUV);
                        luvs[2] = CustomData_bmesh_get(&em->bm->ldata, ls[2]->head.data, CD_MLOOPUV);
 
-                       vkeys[0] = (ParamKey)BMINDEX_GET(ls[0]->v);
-                       vkeys[1] = (ParamKey)BMINDEX_GET(ls[1]->v);
-                       vkeys[2] = (ParamKey)BMINDEX_GET(ls[2]->v);
+                       vkeys[0] = (ParamKey)BM_GetIndex(ls[0]->v);
+                       vkeys[1] = (ParamKey)BM_GetIndex(ls[1]->v);
+                       vkeys[2] = (ParamKey)BM_GetIndex(ls[2]->v);
 
                        co[0] = ls[0]->v->co;
                        co[1] = ls[1]->v->co;
@@ -283,8 +283,8 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                        if(BM_TestHFlag(eed, BM_SEAM)) {
                                ParamKey vkeys[2];
-                               vkeys[0] = (ParamKey)BMINDEX_GET(eed->v1);
-                               vkeys[1] = (ParamKey)BMINDEX_GET(eed->v2);
+                               vkeys[0] = (ParamKey)BM_GetIndex(eed->v1);
+                               vkeys[1] = (ParamKey)BM_GetIndex(eed->v2);
                                param_edge_set_seam(handle, vkeys);
                        }
                }
index c3205e181d8a98210ad9ab2e396454fe9dc48ef7..7128715c15a4f1423e5aad282395343d6bbcf7e8 100644 (file)
@@ -453,12 +453,12 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
 
                        i = 0;
                        BMO_ITER(h, &oiter, em->bm, &op, "geom", BM_ALL) {
-                               BMINDEX_SET(h, i);
+                               BM_SetIndex(h, i);
                                i++;
                        }
 
                        BMO_ITER(h, &oiter, em->bm, &op, "newout", BM_ALL) {
-                               BMINDEX_SET(h, i);
+                               BM_SetIndex(h, i);
                                i++;
                        }
 
@@ -471,7 +471,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                        BMO_ITER(v, &oiter, em->bm, &findop, "targetmapout", 0) {
                                v2 = BMO_IterMapValp(&oiter);
 
-                               indexMap[BMINDEX_GET(v)] = BMINDEX_GET(v2)+1;
+                               indexMap[BM_GetIndex(v)] = BM_GetIndex(v2)+1;
                        }
 
                        BMO_Finish_Op(em->bm, &findop);