From e1c4e7b4c6ebbdb7c7224ae683c5a1fb77565177 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sun, 3 Dec 2023 17:47:37 -0500 Subject: [PATCH] Fix: Missing versioning for generic sculpt mask conversion Since we're always writing the mask with the old format, this versioning will have to run until a larger breaking release such as 5.0. Luckily it is cheap, it's just rearranging the pointers to larger arrays. --- source/blender/blenloader/intern/versioning_400.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 3f8ad98f069..78ce9937488 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -2539,10 +2539,6 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) } } - LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) { - blender::bke::mesh_sculpt_mask_to_generic(*mesh); - } - if (!DNA_struct_member_exists( fd->filesdna, "RaytraceEEVEE", "float", "screen_trace_max_roughness")) { @@ -2604,4 +2600,11 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) { /* Keep this block, even when empty. */ } + + /* Always run this versioning; meshes are written with the legacy format which always needs to + * be converted to the new format on file load. Can be moved to a subversion check in a larger + * breaking release. */ + LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) { + blender::bke::mesh_sculpt_mask_to_generic(*mesh); + } }