From 82ff0fa58673068ff842201bd89393d68c488148 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 21 Feb 2022 18:08:53 +0300 Subject: Weight Proximity: fix value overlap between Normalize and Invert VGroup. The flags overlapped ever since normalize was added, so this requires versioning to copy the flag value. Differential Revision: https://developer.blender.org/D14165 --- source/blender/blenloader/intern/versioning_300.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 90730439c51..d478ffb732e 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -2549,6 +2549,20 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 301, 7)) { + /* Duplicate value for two flags that mistakenly had the same numeric value. */ + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { + if (md->type == eModifierType_WeightVGProximity) { + WeightVGProximityModifierData *wpmd = (WeightVGProximityModifierData *)md; + if (wpmd->proximity_flags & MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK) { + wpmd->proximity_flags |= MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE; + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * -- cgit v1.2.3