Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-08-25 07:54:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-25 09:45:47 +0300
commit7585d47b364aff4f486b7c085611859493014ac7 (patch)
tree99e6b2c21b24267c630badce650af6c282c5a2c9 /source/blender/blenkernel/intern/mesh.c
parent5572986aad22811af9e3c34992fdd40251c106ab (diff)
Cleanup: remove UV name syncing function
MTFace's on the mesh are now only used for conversion. There is no need to keep both UV layers in sync at once.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 68dfc263d3e..71fd65d1f23 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -813,92 +813,6 @@ void BKE_mesh_make_local(Main *bmain, Mesh *me, const bool lib_local)
BKE_id_make_local_generic(bmain, &me->id, true, lib_local);
}
-bool BKE_mesh_uv_cdlayer_rename_index(Mesh *me,
- const int loop_index,
- const int face_index,
- const char *new_name,
- const bool do_tessface)
-{
- CustomData *ldata, *fdata;
- CustomDataLayer *cdlu, *cdlf;
-
- if (me->edit_mesh) {
- ldata = &me->edit_mesh->bm->ldata;
- fdata = NULL; /* No tessellated data in BMesh! */
- }
- else {
- ldata = &me->ldata;
- fdata = &me->fdata;
- }
-
- cdlu = &ldata->layers[loop_index];
- cdlf = (face_index != -1) && fdata && do_tessface ? &fdata->layers[face_index] : NULL;
-
- if (cdlu->name != new_name) {
- /* Mesh validate passes a name from the CD layer as the new name,
- * Avoid memcpy from self to self in this case.
- */
- BLI_strncpy(cdlu->name, new_name, sizeof(cdlu->name));
- CustomData_set_layer_unique_name(ldata, loop_index);
- }
-
- if (cdlf == NULL) {
- return false;
- }
-
- BLI_strncpy(cdlf->name, cdlu->name, sizeof(cdlf->name));
- CustomData_set_layer_unique_name(fdata, face_index);
-
- return true;
-}
-
-bool BKE_mesh_uv_cdlayer_rename(Mesh *me,
- const char *old_name,
- const char *new_name,
- bool do_tessface)
-{
- CustomData *ldata, *fdata;
- if (me->edit_mesh) {
- ldata = &me->edit_mesh->bm->ldata;
- /* No tessellated data in BMesh! */
- fdata = NULL;
- do_tessface = false;
- }
- else {
- ldata = &me->ldata;
- fdata = &me->fdata;
- do_tessface = (do_tessface && fdata->totlayer);
- }
-
- {
- const int lidx_start = CustomData_get_layer_index(ldata, CD_MLOOPUV);
- const int fidx_start = do_tessface ? CustomData_get_layer_index(fdata, CD_MTFACE) : -1;
- int lidx = CustomData_get_named_layer(ldata, CD_MLOOPUV, old_name);
- int fidx = do_tessface ? CustomData_get_named_layer(fdata, CD_MTFACE, old_name) : -1;
-
- /* None of those cases should happen, in theory!
- * Note this assume we have the same number of mtexpoly, mloopuv and mtface layers!
- */
- if (lidx == -1) {
- if (fidx == -1) {
- /* No layer found with this name! */
- return false;
- }
- else {
- lidx = fidx;
- }
- }
-
- /* Go back to absolute indices! */
- lidx += lidx_start;
- if (fidx != -1) {
- fidx += fidx_start;
- }
-
- return BKE_mesh_uv_cdlayer_rename_index(me, lidx, fidx, new_name, do_tessface);
- }
-}
-
void BKE_mesh_boundbox_calc(Mesh *me, float r_loc[3], float r_size[3])
{
BoundBox *bb;