From e0e6229176573484431d2bbf3ba0c2f849522789 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Feb 2019 18:05:18 +1100 Subject: Cleanup: rename Mesh.edit_btmesh -> edit_mesh When bmesh was in a branch we had both edit_mesh and edit_btmesh, now there is no reason to use this odd name. --- source/blender/editors/mesh/editmesh_path.c | 2 +- source/blender/editors/mesh/editmesh_tools.c | 8 ++-- source/blender/editors/mesh/editmesh_undo.c | 8 ++-- source/blender/editors/mesh/editmesh_utils.c | 20 +++++----- source/blender/editors/mesh/mesh_data.c | 56 ++++++++++++++-------------- source/blender/editors/mesh/mesh_mirror.c | 16 ++++---- source/blender/editors/mesh/meshtools.c | 4 +- 7 files changed, 57 insertions(+), 57 deletions(-) (limited to 'source/blender/editors/mesh') diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c index f989b97f5f0..4e2712af227 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -286,7 +286,7 @@ static void edgetag_set_cb(BMEdge *e, bool val, void *user_data_v) static void edgetag_ensure_cd_flag(Mesh *me, const char edge_mode) { - BMesh *bm = me->edit_btmesh->bm; + BMesh *bm = me->edit_mesh->bm; switch (edge_mode) { case EDGE_MODE_TAG_CREASE: diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 46f5d4e952e..ff240039b4a 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3067,7 +3067,7 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; Mesh *me = obedit->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; if (em->bm->totvertsel == 0) { continue; @@ -3128,7 +3128,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) Mesh *me_ref = obedit_ref->data; Key *key_ref = me_ref->key; KeyBlock *kb_ref = NULL; - BMEditMesh *em_ref = me_ref->edit_btmesh; + BMEditMesh *em_ref = me_ref->edit_mesh; BMVert *eve; BMIter iter; ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3164,7 +3164,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) Mesh *me = obedit->data; Key *key = me->key; KeyBlock *kb = NULL; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; int shape; if (em->bm->totvertsel == 0) { @@ -3742,7 +3742,7 @@ static Base *mesh_separate_tagged(Main *bmain, Scene *scene, ViewLayer *view_lay BM_mesh_bm_to_me(bmain, bm_new, base_new->object->data, (&(struct BMeshToMeshParams){0})); BM_mesh_free(bm_new); - ((Mesh *)base_new->object->data)->edit_btmesh = NULL; + ((Mesh *)base_new->object->data)->edit_mesh = NULL; return base_new; } diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 5ed4395a740..a36a7302c24 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -661,7 +661,7 @@ static Object *editmesh_object_from_context(bContext *C) Object *obedit = CTX_data_edit_object(C); if (obedit && obedit->type == OB_MESH) { Mesh *me = obedit->data; - if (me->edit_btmesh != NULL) { + if (me->edit_mesh != NULL) { return obedit; } } @@ -713,7 +713,7 @@ static bool mesh_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bma elem->obedit_ref.ptr = ob; Mesh *me = elem->obedit_ref.ptr->data; - undomesh_from_editmesh(&elem->data, me->edit_btmesh, me->key); + undomesh_from_editmesh(&elem->data, me->edit_mesh, me->key); us->step.data_size += elem->data.undo_size; } MEM_freeN(objects); @@ -733,13 +733,13 @@ static void mesh_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bma MeshUndoStep_Elem *elem = &us->elems[i]; Object *obedit = elem->obedit_ref.ptr; Mesh *me = obedit->data; - if (me->edit_btmesh == NULL) { + if (me->edit_mesh == NULL) { /* Should never fail, may not crash but can give odd behavior. */ CLOG_ERROR(&LOG, "name='%s', failed to enter edit-mode for object '%s', undo state invalid", us_p->name, obedit->id.name); continue; } - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; undomesh_to_editmesh(&elem->data, em, obedit->data); DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY); } diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index a873331f2eb..aba298687a7 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -296,26 +296,26 @@ void EDBM_mesh_make(Object *ob, const int select_mode, const bool add_key_index) me, ob, add_key_index, &((struct BMeshCreateParams){.use_toolflags = true,})); - if (me->edit_btmesh) { + if (me->edit_mesh) { /* this happens when switching shape keys */ - EDBM_mesh_free(me->edit_btmesh); - MEM_freeN(me->edit_btmesh); + EDBM_mesh_free(me->edit_mesh); + MEM_freeN(me->edit_mesh); } /* currently executing operators re-tessellates, so we can avoid doing here * but at some point it may need to be added back. */ #if 0 - me->edit_btmesh = BKE_editmesh_create(bm, true); + me->edit_mesh = BKE_editmesh_create(bm, true); #else - me->edit_btmesh = BKE_editmesh_create(bm, false); + me->edit_mesh = BKE_editmesh_create(bm, false); #endif - me->edit_btmesh->selectmode = me->edit_btmesh->bm->selectmode = select_mode; - me->edit_btmesh->mat_nr = (ob->actcol > 0) ? ob->actcol - 1 : 0; - me->edit_btmesh->ob = ob; + me->edit_mesh->selectmode = me->edit_mesh->bm->selectmode = select_mode; + me->edit_mesh->mat_nr = (ob->actcol > 0) ? ob->actcol - 1 : 0; + me->edit_mesh->ob = ob; /* we need to flush selection because the mode may have changed from when last in editmode */ - EDBM_selectmode_flush(me->edit_btmesh); + EDBM_selectmode_flush(me->edit_mesh); } /** @@ -325,7 +325,7 @@ void EDBM_mesh_make(Object *ob, const int select_mode, const bool add_key_index) void EDBM_mesh_load(Main *bmain, Object *ob) { Mesh *me = ob->data; - BMesh *bm = me->edit_btmesh->bm; + BMesh *bm = me->edit_mesh->bm; /* Workaround for T42360, 'ob->shapenr' should be 1 in this case. * however this isn't synchronized between objects at the moment. */ diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 0bf43204da8..dff096d8a0f 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -57,7 +57,7 @@ static CustomData *mesh_customdata_get_type(Mesh *me, const char htype, int *r_tot) { CustomData *data; - BMesh *bm = (me->edit_btmesh) ? me->edit_btmesh->bm : NULL; + BMesh *bm = (me->edit_mesh) ? me->edit_mesh->bm : NULL; int tot; /* this */ @@ -113,7 +113,7 @@ static CustomData *mesh_customdata_get_type(Mesh *me, const char htype, int *r_t return data; } -#define GET_CD_DATA(me, data) ((me)->edit_btmesh ? &(me)->edit_btmesh->bm->data : &(me)->data) +#define GET_CD_DATA(me, data) ((me)->edit_mesh ? &(me)->edit_mesh->bm->data : &(me)->data) static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) { const int type = layer->type; @@ -125,8 +125,8 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) n = (layer - &data->layers[layer_index]); BLI_assert(n >= 0 && (n + layer_index) < data->totlayer); - if (me->edit_btmesh) { - BM_data_layer_free_n(me->edit_btmesh->bm, data, type, n); + if (me->edit_mesh) { + BM_data_layer_free_n(me->edit_mesh->bm, data, type, n); } else { CustomData_free_layer(data, type, tot, layer_index + n); @@ -204,7 +204,7 @@ static void mesh_uv_reset_mface(MPoly *mp, MLoopUV *mloopuv) /* without bContext, called in uvedit */ void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) { - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; if (em) { /* Collect BMesh UVs */ @@ -256,8 +256,8 @@ int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set) bool is_init = false; - if (me->edit_btmesh) { - em = me->edit_btmesh; + if (me->edit_mesh) { + em = me->edit_mesh; layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV); if (layernum_dst >= MAX_MTFACE) @@ -315,8 +315,8 @@ void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name) BMEditMesh *em; int layernum_dst; - if (me->edit_btmesh) { - em = me->edit_btmesh; + if (me->edit_mesh) { + em = me->edit_mesh; layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV); if (layernum_dst == 0) @@ -381,8 +381,8 @@ int ED_mesh_color_add(Mesh *me, const char *name, const bool active_set) BMEditMesh *em; int layernum; - if (me->edit_btmesh) { - em = me->edit_btmesh; + if (me->edit_mesh) { + em = me->edit_mesh; layernum = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPCOL); if (layernum >= MAX_MCOL) { @@ -431,7 +431,7 @@ int ED_mesh_color_add(Mesh *me, const char *name, const bool active_set) bool ED_mesh_color_ensure(struct Mesh *me, const char *name) { - BLI_assert(me->edit_btmesh == NULL); + BLI_assert(me->edit_mesh == NULL); if (!me->mloopcol && me->totloop) { CustomData_add_layer_named(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop, name); @@ -625,8 +625,8 @@ static int mesh_customdata_clear_exec__internal(bContext *C, BLI_assert(CustomData_layertype_is_singleton(type) == true); if (CustomData_has_layer(data, type)) { - if (me->edit_btmesh) { - BM_data_layer_free(me->edit_btmesh->bm, data, type); + if (me->edit_mesh) { + BM_data_layer_free(me->edit_mesh->bm, data, type); } else { CustomData_free_layers(data, type, tot); @@ -783,13 +783,13 @@ static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator if (!BKE_mesh_has_custom_loop_normals(me)) { CustomData *data = GET_CD_DATA(me, ldata); - if (me->edit_btmesh) { + if (me->edit_mesh) { /* Tag edges as sharp according to smooth threshold if needed, to preserve autosmooth shading. */ if (me->flag & ME_AUTOSMOOTH) { - BM_edges_sharp_from_angle_set(me->edit_btmesh->bm, me->smoothresh); + BM_edges_sharp_from_angle_set(me->edit_mesh->bm, me->smoothresh); } - BM_data_layer_add(me->edit_btmesh->bm, data, CD_CUSTOMLOOPNORMAL); + BM_data_layer_add(me->edit_mesh->bm, data, CD_CUSTOMLOOPNORMAL); } else { /* Tag edges as sharp according to smooth threshold if needed, to preserve autosmooth shading. */ @@ -1088,7 +1088,7 @@ static void mesh_remove_faces(Mesh *mesh, int len) #if 0 void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add geometry in edit mode"); return; } @@ -1104,7 +1104,7 @@ void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, void ED_mesh_tessfaces_add(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add tessfaces in edit mode"); return; } @@ -1119,7 +1119,7 @@ void ED_mesh_tessfaces_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add edges in edit mode"); return; } @@ -1129,7 +1129,7 @@ void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add vertices in edit mode"); return; } @@ -1139,7 +1139,7 @@ void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot remove faces in edit mode"); return; } @@ -1153,7 +1153,7 @@ void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count) void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot remove edges in edit mode"); return; } @@ -1167,7 +1167,7 @@ void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count) void ED_mesh_vertices_remove(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot remove vertices in edit mode"); return; } @@ -1181,7 +1181,7 @@ void ED_mesh_vertices_remove(Mesh *mesh, ReportList *reports, int count) void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add loops in edit mode"); return; } @@ -1191,7 +1191,7 @@ void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count) { - if (mesh->edit_btmesh) { + if (mesh->edit_mesh) { BKE_report(reports, RPT_ERROR, "Cannot add polygons in edit mode"); return; } @@ -1201,8 +1201,8 @@ void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count) void ED_mesh_calc_tessface(Mesh *mesh, bool free_mpoly) { - if (mesh->edit_btmesh) { - BKE_editmesh_tessface_calc(mesh->edit_btmesh); + if (mesh->edit_mesh) { + BKE_editmesh_tessface_calc(mesh->edit_mesh); } else { BKE_mesh_tessface_calc(mesh); diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c index bdab9aed094..1efa05bc60e 100644 --- a/source/blender/editors/mesh/mesh_mirror.c +++ b/source/blender/editors/mesh/mesh_mirror.c @@ -63,7 +63,7 @@ int ED_mesh_mirror_spatial_table(Object *ob, BMEditMesh *em, Mesh *me_eval, cons } else if (mode == 's') { /* start table */ Mesh *me = ob->data; - const bool use_em = (!me_eval && em && me->edit_btmesh == em); + const bool use_em = (!me_eval && em && me->edit_mesh == em); const int totvert = use_em ? em->bm->totvert : me_eval ? me_eval->totvert : me->totvert; if (MirrKdStore.tree) /* happens when entering this call without ending it */ @@ -136,7 +136,7 @@ static int mirrtopo_vert_sort(const void *v1, const void *v2) bool ED_mesh_mirrtopo_recalc_check(Mesh *me, Mesh *me_eval, MirrTopoStore_t *mesh_topo_store) { - const bool is_editmode = (me->edit_btmesh != NULL); + const bool is_editmode = (me->edit_mesh != NULL); int totvert; int totedge; @@ -144,9 +144,9 @@ bool ED_mesh_mirrtopo_recalc_check(Mesh *me, Mesh *me_eval, MirrTopoStore_t *mes totvert = me_eval->totvert; totedge = me_eval->totedge; } - else if (me->edit_btmesh) { - totvert = me->edit_btmesh->bm->totvert; - totedge = me->edit_btmesh->bm->totedge; + else if (me->edit_mesh) { + totvert = me->edit_mesh->bm->totvert; + totedge = me->edit_mesh->bm->totedge; } else { totvert = me->totvert; @@ -170,9 +170,9 @@ void ED_mesh_mirrtopo_init( Mesh *me, Mesh *me_eval, MirrTopoStore_t *mesh_topo_store, const bool skip_em_vert_array_init) { - const bool is_editmode = (me->edit_btmesh != NULL); + const bool is_editmode = (me->edit_mesh != NULL); MEdge *medge = NULL, *med; - BMEditMesh *em = me_eval ? NULL : me->edit_btmesh; + BMEditMesh *em = me_eval ? NULL : me->edit_mesh; /* editmode*/ BMEdge *eed; @@ -208,7 +208,7 @@ void ED_mesh_mirrtopo_init( /* Initialize the vert-edge-user counts used to detect unique topology */ if (em) { - totedge = me->edit_btmesh->bm->totedge; + totedge = me->edit_mesh->bm->totedge; BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { const int i1 = BM_elem_index_get(eed->v1), i2 = BM_elem_index_get(eed->v2); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 6deb0fee743..7e737b9e89a 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -822,7 +822,7 @@ BMVert *editbmesh_get_x_mirror_vert(Object *ob, struct BMEditMesh *em, BMVert *e int ED_mesh_mirror_get_vert(Object *ob, int index) { Mesh *me = ob->data; - BMEditMesh *em = me->edit_btmesh; + BMEditMesh *em = me->edit_mesh; bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0; int index_mirr; @@ -1255,7 +1255,7 @@ MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve) { if (ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) { Mesh *me = ob->data; - BMesh *bm = me->edit_btmesh->bm; + BMesh *bm = me->edit_mesh->bm; const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT); if (cd_dvert_offset != -1) { -- cgit v1.2.3