[Bf-blender-cvs] [9c734afc541] refactor-mesh-bevel-weight-generic: Merge branch 'temp-legacy-mesh-format-option' into refactor-mesh-bevel-weight-generic
Hans Goudey
noreply at git.blender.org
Fri Jul 8 18:58:43 CEST 2022
Commit: 9c734afc541b3b1621647e47eced5b52d22547ef
Author: Hans Goudey
Date: Fri Jul 8 11:51:40 2022 -0500
Branches: refactor-mesh-bevel-weight-generic
https://developer.blender.org/rB9c734afc541b3b1621647e47eced5b52d22547ef
Merge branch 'temp-legacy-mesh-format-option' into refactor-mesh-bevel-weight-generic
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_blender_version.h
index 19bb4826956,efe44ec657b..605e700dd16
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@@ -25,7 -25,7 +25,7 @@@ extern "C"
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
- #define BLENDER_FILE_SUBVERSION 4
-#define BLENDER_FILE_SUBVERSION 5
++#define BLENDER_FILE_SUBVERSION 6
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file
diff --cc source/blender/blenloader/intern/versioning_300.c
index e5f204b2bd3,14204479849..05b412923c6
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@@ -3172,26 -3237,26 +3238,47 @@@ void blo_do_versions_300(FileData *fd,
}
}
- if (!MAIN_VERSION_ATLEAST(bmain, 303, 1)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 303, 5)) {
+ /* Fix for T98925 - remove channels region, that was initialized in incorrect editor types. */
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_CLIP, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ)) {
+ continue;
+ }
+
+ ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
+ &sl->regionbase;
+ ARegion *channels_region = BKE_region_find_in_listbase_by_type(regionbase,
+ RGN_TYPE_CHANNELS);
+ if (channels_region) {
+ BLI_freelinkN(regionbase, channels_region);
+ }
+ }
+ }
+ }
+ }
++
++ if (!MAIN_VERSION_ATLEAST(bmain, 303, 6)) {
+ /* Move mesh bevel weights from structs to dedicated custom data layers, like edit mode. */
+ LISTBASE_FOREACH (Mesh *, mesh, &bmain->meshes) {
+ if (mesh->cd_flag & ME_CDFLAG_EDGE_BWEIGHT) {
+ float *weights = (float *)CustomData_add_layer(
+ &mesh->edata, CD_BWEIGHT, CD_DEFAULT, NULL, mesh->totedge);
+ for (int i = 0; i < mesh->totedge; i++) {
+ weights[i] = mesh->medge[i].bweight / 255.0f;
+ }
+ }
+ if (mesh->cd_flag & ME_CDFLAG_VERT_BWEIGHT) {
+ float *weights = (float *)CustomData_add_layer(
+ &mesh->vdata, CD_BWEIGHT, CD_DEFAULT, NULL, mesh->totvert);
+ for (int i = 0; i < mesh->totvert; i++) {
+ weights[i] = mesh->mvert[i].bweight / 255.0f;
+ }
+ }
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*
More information about the Bf-blender-cvs
mailing list