svn merge ^/trunk/blender -r44118:44136
[blender.git] / source / blender / editors / mesh / mesh_navmesh.c
index 5eb1fd234e4ed6dbcf1fbbb52741ee61b176ecba..99947cb9ae21dadafa26b895175f4172806a2d54 100644 (file)
@@ -339,7 +339,7 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
                co[1]= bmin[1] + v[1]*ch;
                co[2]= bmin[2] + v[2]*cs;
                SWAP(float, co[1], co[2]);
-               BM_Make_Vert(em->bm, co, NULL);
+               BM_vert_create(em->bm, co, NULL);
        }
 
        /* create custom data layer to save polygon idx */
@@ -369,7 +369,7 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
                for(j= nv; j<ndv; j++) {
                        copy_v3_v3(co, &dverts[3*(vbase + j)]);
                        SWAP(float, co[1], co[2]);
-                       BM_Make_Vert(em->bm, co, NULL);
+                       BM_vert_create(em->bm, co, NULL);
                }
 
                EDBM_init_index_arrays(em, 1, 0, 0);
@@ -382,12 +382,15 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
 
                        for(k= 0; k<3; k++) {
                                if(tri[k]<nv)
-                                       face[k]= p[tri[k]]; /* shared vertex */
+                                       face[k] = p[tri[k]]; /* shared vertex */
                                else
-                                       face[k]= uniquevbase+tri[k]-nv; /* unique vertex */
+                                       face[k] = uniquevbase+tri[k]-nv; /* unique vertex */
                        }
-                       newFace= BM_Make_Face_QuadTri(em->bm, EDBM_get_vert_for_index(em, face[0]), EDBM_get_vert_for_index(em, face[2]),
-                                                                       EDBM_get_vert_for_index(em, face[1]), NULL, NULL, 0);
+                       newFace= BM_face_create_quad_tri(em->bm,
+                                                     EDBM_get_vert_for_index(em, face[0]),
+                                                     EDBM_get_vert_for_index(em, face[2]),
+                                                     EDBM_get_vert_for_index(em, face[1]), NULL,
+                                                     NULL, FALSE);
 
                        /* set navigation polygon idx to the custom layer */
                        polygonIdx= (int*)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
@@ -484,7 +487,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
        BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
 
        /* do work here */
-       BMFace *efa_act= BM_get_actFace(em->bm, 0);
+       BMFace *efa_act= BM_active_face_get(em->bm, FALSE);
 
        if(efa_act) {
                if(CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
@@ -496,7 +499,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
                        if(targetPolyIdx > 0) {
                                /* set target poly idx to other selected faces */
                                BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                                       if(BM_TestHFlag(efa, BM_SELECT) && efa != efa_act)  {
+                                       if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act)  {
                                                int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST);
                                                *recastDataBlock= targetPolyIdx;
                                        }
@@ -581,7 +584,7 @@ static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op))
                        /*XXX this originally went last to first, but that isn't possible anymore*/
                        
                        BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
-                               if(BM_TestHFlag(ef, BM_SELECT)) {
+                               if(BM_elem_flag_test(ef, BM_ELEM_SELECT)) {
                                        int *recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST);
                                        *recastDataBlock= targetPolyIdx;
                                }
@@ -615,7 +618,7 @@ static int navmesh_obmode_data_poll(bContext *C)
        Object *ob = ED_object_active_context(C);
        if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
                Mesh *me= ob->data;
-               return CustomData_has_layer(&me->fdata, CD_RECAST);
+               return CustomData_has_layer(&me->pdata, CD_RECAST);
        }
        return FALSE;
 }
@@ -634,7 +637,7 @@ static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
        Object *ob = ED_object_active_context(C);
        Mesh *me= ob->data;
 
-       CustomData_free_layers(&me->fdata, CD_RECAST, me->totface);
+       CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly);
 
        BKE_mesh_ensure_navmesh(me);
 
@@ -664,7 +667,7 @@ static int navmesh_clear_exec(bContext *C, wmOperator *UNUSED(op))
        Object *ob = ED_object_active_context(C);
        Mesh *me= ob->data;
 
-       CustomData_free_layers(&me->fdata, CD_RECAST, me->totface);
+       CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly);
 
        DAG_id_tag_update(&me->id, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_GEOM|ND_DATA, &me->id);