Cleanup: Remove unused UV map deletion functions

The attribute API is now used instead.
This commit is contained in:
Hans Goudey
2023-02-21 10:53:18 -05:00
parent 7fe42ea566
commit 996eb1bd5f
2 changed files with 0 additions and 69 deletions

View File

@@ -570,9 +570,6 @@ bool ED_mesh_edge_is_loose(const struct Mesh *mesh, int index);
void ED_mesh_uv_ensure(struct Mesh *me, const char *name);
int ED_mesh_uv_add(
struct Mesh *me, const char *name, bool active_set, bool do_init, struct ReportList *reports);
bool ED_mesh_uv_remove_index(struct Mesh *me, int n);
bool ED_mesh_uv_remove_active(struct Mesh *me);
bool ED_mesh_uv_remove_named(struct Mesh *me, const char *name);
void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me);
/**

View File

@@ -114,32 +114,6 @@ static CustomData *mesh_customdata_get_type(Mesh *me, const char htype, int *r_t
}
#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;
CustomData *data;
int layer_index, tot, n;
char htype = BM_FACE;
if (ELEM(type, CD_PROP_BYTE_COLOR, CD_PROP_FLOAT2)) {
htype = BM_LOOP;
}
else if (ELEM(type, CD_PROP_COLOR)) {
htype = BM_VERT;
}
data = mesh_customdata_get_type(me, htype, &tot);
layer_index = CustomData_get_layer_index(data, type);
n = (layer - &data->layers[layer_index]);
BLI_assert(n >= 0 && (n + layer_index) < data->totlayer);
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);
}
}
static void mesh_uv_reset_array(float **fuv, const int len)
{
@@ -417,46 +391,6 @@ void ED_mesh_uv_ensure(Mesh *me, const char *name)
}
}
bool ED_mesh_uv_remove_index(Mesh *me, const int n)
{
CustomData *ldata = GET_CD_DATA(me, ldata);
CustomDataLayer *cdlu;
int index;
index = CustomData_get_layer_index_n(ldata, CD_PROP_FLOAT2, n);
cdlu = (index == -1) ? nullptr : &ldata->layers[index];
if (!cdlu) {
return false;
}
delete_customdata_layer(me, cdlu);
DEG_id_tag_update(&me->id, 0);
WM_main_add_notifier(NC_GEOM | ND_DATA, me);
return true;
}
bool ED_mesh_uv_remove_active(Mesh *me)
{
CustomData *ldata = GET_CD_DATA(me, ldata);
const int n = CustomData_get_active_layer(ldata, CD_PROP_FLOAT2);
if (n != -1) {
return ED_mesh_uv_remove_index(me, n);
}
return false;
}
bool ED_mesh_uv_remove_named(Mesh *me, const char *name)
{
CustomData *ldata = GET_CD_DATA(me, ldata);
const int n = CustomData_get_named_layer(ldata, CD_PROP_FLOAT2, name);
if (n != -1) {
return ED_mesh_uv_remove_index(me, n);
}
return false;
}
int ED_mesh_color_add(
Mesh *me, const char *name, const bool active_set, const bool do_init, ReportList *reports)
{