[Bf-blender-cvs] [73bd469fe0e] sculpt-dev: * Sculpt: fix clay defaults again

Joseph Eagar noreply at git.blender.org
Tue Oct 5 11:44:02 CEST 2021


Commit: 73bd469fe0edec82325319f0cfcd04b4abe5e2be
Author: Joseph Eagar
Date:   Tue Oct 5 02:43:46 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB73bd469fe0edec82325319f0cfcd04b4abe5e2be

* Sculpt: fix clay defaults again

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
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
M	source/blender/editors/sculpt_paint/sculpt_detail.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 87bdddfb632..1c5c4eefa52 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1015,12 +1015,14 @@ class SCULPT_OT_set_dyntopo_mode(Operator):
 
         if not brush.channels["dyntopo_mode"].inherit and ch.inherit_if_unset:
             finalch = context.tool_settings.sculpt.channels["dyntopo_mode"]
+            pass
 
         oldf = set()
         for f in finalch.flags_value:
             if f not in ["SUBDIVIDE", "COLLAPSE"]:
                 oldf.add(f)
 
+        print("OLDF", oldf)
         if self.mode == "SC":
             finalch.flags_value = oldf.union({"SUBDIVIDE", "COLLAPSE"})
         elif self.mode == "S":
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index b04bbdfb187..31ce1b124e9 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 31
+#define BLENDER_FILE_SUBVERSION 32
 
 /* 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 1cf4f2ab7d1..a6f27d4651a 100644
--- a/source/blender/blenkernel/intern/brush_engine_presets.c
+++ b/source/blender/blenkernel/intern/brush_engine_presets.c
@@ -881,6 +881,7 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
   CurveMap *cuma = curve->cm;
 
   if (!strips) {  //[[0,0.200], [0.354,0.200], [0.595,0.210], [0.806,0.523], [1,1.000]
+#if 0
     cuma->curve[0].x = 0.0f;
     cuma->curve[0].y = 0.2f;
 
@@ -889,9 +890,9 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
     BKE_curvemap_insert(cuma, 0.8f, 0.525f);
 
     BKE_curvemapping_changed(curve, true);
+#endif
   }
   else {
-#if 0  // dunno if I've interpreted the original code's math right - joeedh
     //[[0,0], [0.250,0.050], [0.500,0.125], [0.750,0.422], [1,1]
     cuma->curve[0].x = 0.0f;
     cuma->curve[0].y = 0.55f;
@@ -899,7 +900,6 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
     cuma->curve[2].x = 1.0f;
     cuma->curve[2].y = 1.0f;
     BKE_curvemapping_changed(curve, true);
-#endif
   }
 
   mp = BRUSHSET_LOOKUP(chset, strength)->mappings + BRUSH_MAPPING_PRESSURE;
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index f26cedb3bb1..6486aba9642 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -1749,7 +1749,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
   }
 
-  if (!MAIN_VERSION_ATLEAST(bmain, 300, 27)) {
+  if (MAIN_VERSION_OLDER(bmain, 300, 20) && !MAIN_VERSION_ATLEAST(bmain, 300, 32)) {
     LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
       if (ELEM(brush->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS) && brush->channels) {
         BRUSHSET_SET_BOOL(brush->channels, autosmooth_use_spacing, true);
@@ -1761,7 +1761,10 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
             BRUSH_MAPPING_ENABLED;
 
         if (brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS) {
-          BRUSHSET_SET_FLOAT(brush->channels, tip_roundness, 0.18f);
+          if (BRUSHSET_GET_FLOAT(brush->channels, tip_roundness, NULL) == 0.0f) {
+            BRUSHSET_SET_FLOAT(brush->channels, tip_roundness, 0.18f);
+          }
+
           BRUSHSET_LOOKUP(brush->channels, tip_roundness)->flag |= BRUSH_CHANNEL_SHOW_IN_WORKSPACE;
           BRUSHSET_SET_BOOL(brush->channels, use_space_attenuation, false);
         }
diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.c b/source/blender/editors/sculpt_paint/sculpt_detail.c
index 50f2c5c882d..848215e5cea 100644
--- a/source/blender/editors/sculpt_paint/sculpt_detail.c
+++ b/source/blender/editors/sculpt_paint/sculpt_detail.c
@@ -134,7 +134,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
 
   SCULPT_dyntopo_automasking_init(ss, sd, NULL, ob, &mask_cb, &mask_cb_data);
 
-  const int max_steps = 10;
+  const int max_steps = 2;
   const int max_dyntopo_steps_coll = 1 << 13;
   const int max_dyntopo_steps_subd = 1 << 15;



More information about the Bf-blender-cvs mailing list