diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-23 05:43:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-23 05:43:28 +0300 |
commit | ad33e6834861041d3e2660ae150a0a1903b27bcb (patch) | |
tree | 2fdaa9ae81a60139b79ff801e162b072e3d26cab /source/blender/editors/mesh | |
parent | 1e882b86579b7aea76fd81ee121949e03c7599be (diff) |
Cleanup: remove "texture" from ED_mesh_uv_texture_* funcitons
This name made sense when UV's and textures were stored in the same
layer (MTFace & TFace).
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 18 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_add_gizmo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_data.cc | 28 |
3 files changed, 23 insertions, 25 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index b2f33428b21..57e0d04727c 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -113,7 +113,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf( @@ -178,7 +178,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf(em, @@ -252,7 +252,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf( @@ -324,7 +324,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf(em, @@ -400,7 +400,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf(em, @@ -476,7 +476,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf( @@ -553,7 +553,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf(em, @@ -614,7 +614,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf( @@ -682,7 +682,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) em = BKE_editmesh_from_object(obedit); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf( diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c index d0f37314661..f5090c0143d 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.c +++ b/source/blender/editors/mesh/editmesh_add_gizmo.c @@ -328,7 +328,7 @@ static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op) const bool calc_uvs = RNA_boolean_get(op->ptr, "calc_uvs"); if (calc_uvs) { - ED_mesh_uv_texture_ensure(obedit->data, NULL); + ED_mesh_uv_ensure(obedit->data, NULL); } if (!EDBM_op_call_and_selectf(em, diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc index ae06cf4c3bd..67834bf05ce 100644 --- a/source/blender/editors/mesh/mesh_data.cc +++ b/source/blender/editors/mesh/mesh_data.cc @@ -241,7 +241,7 @@ void ED_mesh_uv_loop_reset(bContext *C, Mesh *me) WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); } -int ED_mesh_uv_texture_add( +int ED_mesh_uv_add( Mesh *me, const char *name, const bool active_set, const bool do_init, ReportList *reports) { /* NOTE: keep in sync with #ED_mesh_color_add. */ @@ -307,7 +307,7 @@ int ED_mesh_uv_texture_add( return layernum_dst; } -void ED_mesh_uv_texture_ensure(Mesh *me, const char *name) +void ED_mesh_uv_ensure(Mesh *me, const char *name) { BMEditMesh *em; int layernum_dst; @@ -317,18 +317,18 @@ void ED_mesh_uv_texture_ensure(Mesh *me, const char *name) layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV); if (layernum_dst == 0) { - ED_mesh_uv_texture_add(me, name, true, true, nullptr); + ED_mesh_uv_add(me, name, true, true, nullptr); } } else { layernum_dst = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV); if (layernum_dst == 0) { - ED_mesh_uv_texture_add(me, name, true, true, nullptr); + ED_mesh_uv_add(me, name, true, true, nullptr); } } } -bool ED_mesh_uv_texture_remove_index(Mesh *me, const int n) +bool ED_mesh_uv_remove_index(Mesh *me, const int n) { CustomData *ldata = GET_CD_DATA(me, ldata); CustomDataLayer *cdlu; @@ -348,24 +348,22 @@ bool ED_mesh_uv_texture_remove_index(Mesh *me, const int n) return true; } -bool ED_mesh_uv_texture_remove_active(Mesh *me) +bool ED_mesh_uv_remove_active(Mesh *me) { - /* texpoly/uv are assumed to be in sync */ CustomData *ldata = GET_CD_DATA(me, ldata); const int n = CustomData_get_active_layer(ldata, CD_MLOOPUV); if (n != -1) { - return ED_mesh_uv_texture_remove_index(me, n); + return ED_mesh_uv_remove_index(me, n); } return false; } -bool ED_mesh_uv_texture_remove_named(Mesh *me, const char *name) +bool ED_mesh_uv_remove_named(Mesh *me, const char *name) { - /* texpoly/uv are assumed to be in sync */ CustomData *ldata = GET_CD_DATA(me, ldata); const int n = CustomData_get_named_layer(ldata, CD_MLOOPUV, name); if (n != -1) { - return ED_mesh_uv_texture_remove_index(me, n); + return ED_mesh_uv_remove_index(me, n); } return false; } @@ -373,7 +371,7 @@ bool ED_mesh_uv_texture_remove_named(Mesh *me, const char *name) int ED_mesh_color_add( Mesh *me, const char *name, const bool active_set, const bool do_init, ReportList *reports) { - /* NOTE: keep in sync with #ED_mesh_uv_texture_add. */ + /* NOTE: keep in sync with #ED_mesh_uv_add. */ BMEditMesh *em; int layernum; @@ -516,7 +514,7 @@ static bool sculpt_vertex_color_remove_poll(bContext *C) int ED_mesh_sculpt_color_add( Mesh *me, const char *name, const bool active_set, const bool do_init, ReportList *reports) { - /* NOTE: keep in sync with #ED_mesh_uv_texture_add. */ + /* NOTE: keep in sync with #ED_mesh_uv_add. */ BMEditMesh *em; int layernum; @@ -650,7 +648,7 @@ static int mesh_uv_texture_add_exec(bContext *C, wmOperator *op) Object *ob = ED_object_context(C); Mesh *me = static_cast<Mesh *>(ob->data); - if (ED_mesh_uv_texture_add(me, nullptr, true, true, op->reports) == -1) { + if (ED_mesh_uv_add(me, nullptr, true, true, op->reports) == -1) { return OPERATOR_CANCELLED; } @@ -683,7 +681,7 @@ static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = ED_object_context(C); Mesh *me = static_cast<Mesh *>(ob->data); - if (!ED_mesh_uv_texture_remove_active(me)) { + if (!ED_mesh_uv_remove_active(me)) { return OPERATOR_CANCELLED; } |