Fix: re-do versioning code for FCurve extremes and Collection colors

Bump Blender subversion from 4 to 5, and re-execute some versioning code.

Because of a mistake in the versioning code (corrected in rB1a4fc6dcd67b),
some of the versioning code didn't run in certain cases. This subversion
bump ensures that this code is still run.
This commit is contained in:
Sybren A. Stüvel
2020-09-17 12:02:05 +02:00
parent 157cd6c6e8
commit 0700c045bc
2 changed files with 36 additions and 36 deletions

View File

@@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 4
#define BLENDER_FILE_SUBVERSION 5
/* 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

View File

@@ -640,30 +640,6 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
/* 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) {
/* Only need to fix Bezier curves with at least 2 keyframes. */
if (fcu->totvert < 2 || fcu->bezt == NULL) {
continue;
}
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;
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
/* Old files do not have a master collection, but it will be created by
* `BKE_collection_master_add()`. */
if (scene->master_collection) {
scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
}
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 291, 4) && MAIN_VERSION_ATLEAST(bmain, 291, 1)) {
@@ -683,17 +659,28 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
/**
* Versioning code until next subversion bump goes here.
*
* \note Be sure to check when bumping the version:
* - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.
*/
{
/* Keep this block, even when empty. */
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) {
/* Only need to fix Bezier curves with at least 2 keyframes. */
if (fcu->totvert < 2 || fcu->bezt == NULL) {
continue;
}
do_versions_291_fcurve_handles_limit(fcu);
}
}
LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
collection->color_tag = COLLECTION_COLOR_NONE;
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
/* Old files do not have a master collection, but it will be created by
* `BKE_collection_master_add()`. */
if (scene->master_collection) {
scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
}
}
/* Add custom profile and bevel mode to curve bevels. */
if (!DNA_struct_elem_find(fd->filesdna, "Curve", "char", "bevel_mode")) {
@@ -707,4 +694,17 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
/**
* Versioning code until next subversion bump goes here.
*
* \note Be sure to check when bumping the version:
* - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.
*/
{
/* Keep this block, even when empty. */
}
}