[Bf-blender-cvs] [d765680f56f] sculpt-dev: Sculpt: fix slide deform brush's deform type setting.

Joseph Eagar noreply at git.blender.org
Fri Oct 22 18:01:01 CEST 2021


Commit: d765680f56ffa342d007b55803790bfeebf64c2d
Author: Joseph Eagar
Date:   Fri Oct 22 09:00:17 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rBd765680f56ffa342d007b55803790bfeebf64c2d

Sculpt: fix slide deform brush's deform
        type setting.

===================================================================

M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/intern/brush_engine_presets.c
M	source/blender/blenloader/intern/versioning_300.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 3f8b56b2736..d39dc8bc406 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 38
+#define BLENDER_FILE_SUBVERSION 39
 
 /* 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/blenkernel/intern/brush_engine_presets.c b/source/blender/blenkernel/intern/brush_engine_presets.c
index 4aaa5c37164..81b97841a70 100644
--- a/source/blender/blenkernel/intern/brush_engine_presets.c
+++ b/source/blender/blenkernel/intern/brush_engine_presets.c
@@ -435,8 +435,8 @@ typedef struct BrushSettingsMap {
 
 /* clang-format off */
 
-/* This lookup table is used convert data to/from brush channels
-   and the old settings fields in Brush*/
+/* This lookup table is used convert between brush channels
+   and the old settings members of Brush*/
 static BrushSettingsMap brush_settings_map[] = {
   DEF(size, radius, INT, FLOAT)
   DEF(alpha, strength, FLOAT, FLOAT)
@@ -513,6 +513,7 @@ static BrushSettingsMap brush_settings_map[] = {
   DEF(array_deform_type, array_deform_type, INT, INT)
   DEF(array_count, array_count, INT, INT)
   DEF(smear_deform_type, smear_deform_type, INT, INT)
+  DEF(slide_deform_type, slide_deform_type, INT, INT)
 };
 
 static const int brush_settings_map_len = ARRAY_SIZE(brush_settings_map);
@@ -1378,6 +1379,10 @@ void BKE_brush_channelset_ui_init(Brush *brush, int tool)
       SHOWCTX(plane_trim);
       SHOWCTX(use_plane_trim);
       break;
+    case SCULPT_TOOL_SLIDE_RELAX:
+      SHOWWRK(slide_deform_type);
+      SHOWCTX(slide_deform_type);
+      break;
     case SCULPT_TOOL_GRAB:
       SHOWCTX(normal_weight);
       SHOWWRK(normal_weight);
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index fff5a17e19a..0047d46122f 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -2242,6 +2242,12 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
 
     if (!MAIN_VERSION_ATLEAST(bmain, 300, 39)) {
+      LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
+        if (brush->channels && brush->sculpt_tool == SCULPT_TOOL_SLIDE_RELAX) {
+          BKE_brush_channelset_ui_init(brush, SCULPT_TOOL_SLIDE_RELAX);
+        }
+      }
+
       if (!DNA_struct_elem_find(
               fd->filesdna, "View3DOverlay", "float", "sculpt_mode_face_sets_moire_scale")) {
         for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {



More information about the Bf-blender-cvs mailing list