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:
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 63c3140c084..a975a592b5c 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -640,7 +640,26 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
+ }
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 291, 4) && MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
+ /* Due to a48d78ce07f4f, CustomData.totlayer and CustomData.maxlayer has been written
+ * incorrectly. Fortunately, the size of the layers array has been written to the .blend file
+ * as well, so we can reconstruct totlayer and maxlayer from that. */
+ LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
+ mesh->vdata.totlayer = mesh->vdata.maxlayer = MEM_allocN_len(mesh->vdata.layers) /
+ sizeof(CustomDataLayer);
+ mesh->edata.totlayer = mesh->edata.maxlayer = MEM_allocN_len(mesh->edata.layers) /
+ sizeof(CustomDataLayer);
+ /* We can be sure that mesh->fdata is empty for files written by 2.90. */
+ mesh->ldata.totlayer = mesh->ldata.maxlayer = MEM_allocN_len(mesh->ldata.layers) /
+ sizeof(CustomDataLayer);
+ mesh->pdata.totlayer = mesh->pdata.maxlayer = MEM_allocN_len(mesh->pdata.layers) /
+ sizeof(CustomDataLayer);
+ }
+ }
+ if (!MAIN_VERSION_ATLEAST(bmain, 291, 5)) {
/* Fix fcurves to allow for new bezier handles behaviour (T75881 and D8752). */
for (bAction *act = bmain->actions.first; act; act = act->id.next) {
for (FCurve *fcu = act->curves.first; fcu; fcu = fcu->next) {
@@ -651,9 +670,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
do_versions_291_fcurve_handles_limit(fcu);
}
}
- }
- if (!MAIN_VERSION_ATLEAST(bmain, 291, 3)) {
LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
collection->color_tag = COLLECTION_COLOR_NONE;
}
@@ -664,22 +681,17 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
}
}
- }
- if (!MAIN_VERSION_ATLEAST(bmain, 291, 4) && MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
- /* Due to a48d78ce07f4f, CustomData.totlayer and CustomData.maxlayer has been written
- * incorrectly. Fortunately, the size of the layers array has been written to the .blend file
- * as well, so we can reconstruct totlayer and maxlayer from that. */
- LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
- mesh->vdata.totlayer = mesh->vdata.maxlayer = MEM_allocN_len(mesh->vdata.layers) /
- sizeof(CustomDataLayer);
- mesh->edata.totlayer = mesh->edata.maxlayer = MEM_allocN_len(mesh->edata.layers) /
- sizeof(CustomDataLayer);
- /* We can be sure that mesh->fdata is empty for files written by 2.90. */
- mesh->ldata.totlayer = mesh->ldata.maxlayer = MEM_allocN_len(mesh->ldata.layers) /
- sizeof(CustomDataLayer);
- mesh->pdata.totlayer = mesh->pdata.maxlayer = MEM_allocN_len(mesh->pdata.layers) /
- sizeof(CustomDataLayer);
+ /* Add custom profile and bevel mode to curve bevels. */
+ if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
+ LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
+ if (curve->bevobj != NULL) {
+ curve->bevel_mode = CU_BEV_MODE_OBJECT;
+ }
+ else {
+ curve->bevel_mode = CU_BEV_MODE_ROUND;
+ }
+ }
}
}
@@ -694,17 +706,5 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
-
- /* Add custom profile and bevel mode to curve bevels. */
- if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
- LISTBASE_FOREACH (Curve *, curve, &bmain->curves) {
- if (curve->bevobj != NULL) {
- curve->bevel_mode = CU_BEV_MODE_OBJECT;
- }
- else {
- curve->bevel_mode = CU_BEV_MODE_ROUND;
- }
- }
- }
}
}