Fix: Add versioning for recently added curves sculpt radius interpolation

- Turn on radius interpolation by default for old files.
- Set the fallback radius to 0.01 for old files.
This commit is contained in:
Hans Goudey
2024-02-27 16:35:06 -05:00
parent 849279b8f1
commit d6f76c0889
2 changed files with 10 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 6
#define BLENDER_FILE_SUBVERSION 7
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and cancel loading the file, showing a warning to

View File

@@ -2966,6 +2966,15 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 402, 6)) {
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (BrushCurvesSculptSettings *settings = brush->curves_sculpt_settings) {
settings->flag |= BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS;
settings->curve_radius = 0.01f;
}
}
}
/**
* Always bump subversion in BKE_blender_version.h when adding versioning
* code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check.