diff options
Diffstat (limited to 'source/blender/blenloader')
5 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index cfdae2620d0..bc856fd7a10 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -54,6 +54,7 @@ #include "BKE_global.h" /* for G */ #include "BKE_lib_id.h" #include "BKE_main.h" +#include "BKE_mesh.h" #include "BKE_modifier.h" #include "BKE_multires.h" #include "BKE_node_tree_update.h" @@ -995,9 +996,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if ((key = blo_do_versions_newlibadr(fd, lib, me->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(me->totvert, key->refkey->totelem); - + MVert *vertices = BKE_mesh_vertices_for_write(me); for (a = 0; a < tot; a++, data += 3) { - copy_v3_v3(me->mvert[a].co, data); + copy_v3_v3(vertices[a].co, data); } } } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index c1ea96aaedc..e4dc8d006ae 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1794,10 +1794,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (DNA_struct_find(fd->filesdna, "MTexPoly")) { for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { /* If we have UV's, so this file will have MTexPoly layers too! */ - if (me->mloopuv != NULL) { + if (CustomData_has_layer(&me->ldata, CD_MLOOPUV)) { CustomData_update_typemap(&me->pdata); CustomData_free_layers(&me->pdata, CD_MTEXPOLY, me->totpoly); - BKE_mesh_update_customdata_pointers(me, false); } } } diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index c79eb2d530b..ab07c6cc6b8 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -819,21 +819,22 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) if (MAIN_VERSION_ATLEAST(bmain, 290, 2) && MAIN_VERSION_OLDER(bmain, 291, 1)) { /* In this range, the extrude manifold could generate meshes with degenerated face. */ LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) { - for (MPoly *mp = me->mpoly, *mp_end = mp + me->totpoly; mp < mp_end; mp++) { + for (const MPoly *mp = BKE_mesh_polygons(me), *mp_end = mp + me->totpoly; mp < mp_end; + mp++) { if (mp->totloop == 2) { bool changed; BKE_mesh_validate_arrays(me, - me->mvert, + BKE_mesh_vertices_for_write(me), me->totvert, - me->medge, + BKE_mesh_edges_for_write(me), me->totedge, - me->mface, + (MFace *)CustomData_get_layer(&me->fdata, CD_MFACE), me->totface, - me->mloop, + BKE_mesh_loops_for_write(me), me->totloop, - me->mpoly, + BKE_mesh_polygons_for_write(me), me->totpoly, - me->dvert, + BKE_mesh_deform_verts_for_write(me), false, true, &changed); diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 113fc244086..06903865381 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -345,7 +345,8 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene) /* Correct default startup UV's. */ Mesh *me = BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2); - if (me && (me->totloop == 24) && (me->mloopuv != NULL)) { + if (me && (me->totloop == 24) && CustomData_has_layer(&me->ldata, CD_MLOOPUV)) { + MLoopUV *mloopuv = CustomData_get_layer(&me->ldata, CD_MLOOPUV); const float uv_values[24][2] = { {0.625, 0.50}, {0.875, 0.50}, {0.875, 0.75}, {0.625, 0.75}, {0.375, 0.75}, {0.625, 0.75}, {0.625, 1.00}, {0.375, 1.00}, {0.375, 0.00}, {0.625, 0.00}, {0.625, 0.25}, {0.375, 0.25}, @@ -353,7 +354,7 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene) {0.625, 0.75}, {0.375, 0.75}, {0.375, 0.25}, {0.625, 0.25}, {0.625, 0.50}, {0.375, 0.50}, }; for (int i = 0; i < ARRAY_SIZE(uv_values); i++) { - copy_v2_v2(me->mloopuv[i].uv, uv_values[i]); + copy_v2_v2(mloopuv[i].uv, uv_values[i]); } } diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 20659daabd6..94438acf4fa 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -342,8 +342,6 @@ static void customdata_version_242(Mesh *me) mcoln++; } } - - BKE_mesh_update_customdata_pointers(me, true); } /* Only copy render texface layer from active. */ |