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:
authorHans Goudey <h.goudey@me.com>2022-01-24 18:59:13 +0300
committerHans Goudey <h.goudey@me.com>2022-01-24 19:28:40 +0300
commitadd07576a090186dde7858bcb6e68f9cf059f902 (patch)
treeba03b1ef3ed538e8be431b8b0bb0fa84abb8274a
parent63b9e5378b81fc1a184210c7f3ccf3e452ffbbe4 (diff)
Mesh: Add versioning in 3.0 for vertex normal refactor
This tags all meshes from the future 3.1 version dirty, since normals aren't "implicitly" read as part of `MVert` anymore after rBcfa53e0fbeed7178. Differential Revision: https://developer.blender.org/D13856
-rw-r--r--source/blender/blenloader/intern/versioning_300.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 940a10a9e91..c9237a7325c 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -43,6 +43,7 @@
#include "DNA_lineart_types.h"
#include "DNA_listBase.h"
#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_text_types.h"
#include "DNA_workspace_types.h"
@@ -2369,6 +2370,15 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ /* Mesh vertex normals are stored differently after 3.1 (see D12770). This causes an incorrect
+ * viewport display when smooth faces are loaded from the future version, so tag normals dirty
+ * on all meshes from future versions. */
+ if (!DNA_struct_elem_find(fd->filesdna, "MVert", "short", "no[3]")) {
+ LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
+ mesh->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*