[Bf-blender-cvs] [82ff0fa5867] blender-v3.1-release: Weight Proximity: fix value overlap between Normalize and Invert VGroup.
Alexander Gavrilov
noreply at git.blender.org
Mon Feb 21 16:13:17 CET 2022
Commit: 82ff0fa58673068ff842201bd89393d68c488148
Author: Alexander Gavrilov
Date: Mon Feb 21 18:08:53 2022 +0300
Branches: blender-v3.1-release
https://developer.blender.org/rB82ff0fa58673068ff842201bd89393d68c488148
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
===================================================================
M source/blender/blenkernel/BKE_blender_version.h
M source/blender/blenloader/intern/versioning_300.c
M source/blender/makesdna/DNA_modifier_types.h
===================================================================
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index d1f31e0d2f5..ba95ceb0998 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,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 show a warning if the file
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.
*
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 8e38d52a4d7..146167a3770 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1708,7 +1708,7 @@ enum {
MOD_WVG_PROXIMITY_GEOM_FACES = (1 << 2),
MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK = (1 << 3),
MOD_WVG_PROXIMITY_INVERT_FALLOFF = (1 << 4),
- MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE = (1 << 3),
+ MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE = (1 << 5),
};
/* Defines common to all WeightVG modifiers. */
More information about the Bf-blender-cvs
mailing list