diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-15 10:48:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-15 10:48:31 +0300 |
commit | 559a8886d6283e4e34ea0e5b28ad3b2ceb560267 (patch) | |
tree | c19f98e7abbd2256aa69efc69aed8966a59361bb /source/blender/blenloader/intern/versioning_280.c | |
parent | 20c25bffda0df4260e13bda697347ce830857b7a (diff) | |
parent | 3c0fd51cf43ea7504a4457784d6a085bfb4b92d0 (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index a8203e7b083..b6d53aee618 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -5183,6 +5183,27 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 283, 17)) { + /* Reset the cloth mass to 1.0 in brushes with an invalid value. */ + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { + if (br->sculpt_tool == SCULPT_TOOL_CLOTH) { + if (br->cloth_mass == 0.0f) { + br->cloth_mass = 1.0f; + } + } + } + } + + /** Repair files from duplicate brushes added to blend files, see: T76738. */ + if (!MAIN_VERSION_ATLEAST(bmain, 283, 17) || + ((bmain->versionfile == 290) && !MAIN_VERSION_ATLEAST(bmain, 290, 2))) { + short id_codes[] = {ID_BR, ID_PAL}; + for (int i = 0; i < ARRAY_SIZE(id_codes); i++) { + ListBase *lb = which_libbase(bmain, id_codes[i]); + BKE_main_id_repair_duplicate_names_listbase(lb); + } + } + /** * Versioning code until next subversion bump goes here. * @@ -5195,14 +5216,5 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ - - /* Reset the cloth mass to 1.0 in brushes with an invalid value. */ - for (Brush *br = bmain->brushes.first; br; br = br->id.next) { - if (br->sculpt_tool == SCULPT_TOOL_CLOTH) { - if (br->cloth_mass == 0.0f) { - br->cloth_mass = 1.0f; - } - } - } } } |