Commit: add07576a090186dde7858bcb6e68f9cf059f902 Author: Hans Goudey Date: Mon Jan 24 09:59:13 2022 -0600 Branches: blender-v3.0-release https://developer.blender.org/rBadd07576a090186dde7858bcb6e68f9cf059f902
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 =================================================================== M source/blender/blenloader/intern/versioning_300.c =================================================================== 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. * _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
