[Bf-blender-cvs] [72666ae3e7b] master: Brush: default the strength to 1.0

Campbell Barton noreply at git.blender.org
Tue Oct 1 19:37:53 CEST 2019


Commit: 72666ae3e7b7854429cb297d767833fd41bac812
Author: Campbell Barton
Date:   Wed Oct 2 03:32:51 2019 +1000
Branches: master
https://developer.blender.org/rB72666ae3e7b7854429cb297d767833fd41bac812

Brush: default the strength to 1.0

This applies to all paint modes except sculpt and grease pencil brushes.

When painting color or weight it's best to paint the color
the user has selected, without them having to make multiple strokes.

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

M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/makesdna/DNA_brush_defaults.h

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

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 95d3f47c38c..4187dfa68ad 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -895,6 +895,10 @@ void BKE_brush_sculpt_reset(Brush *br)
   /* Use the curve presets by default */
   br->curve_preset = BRUSH_CURVE_SMOOTH;
 
+  /* Note that sculpt defaults where set when 0.5 was the default (now it's 1.0)
+   * assign this so logic below can remain the same. */
+  br->alpha = 0.5f;
+
   /* Brush settings */
   switch (br->sculpt_tool) {
     case SCULPT_TOOL_DRAW_SHARP:
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 0a3e592bb15..72013bc6eed 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1696,7 +1696,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
 
       /* will have no effect */
       if (brush->alpha == 0) {
-        brush->alpha = 0.5f;
+        brush->alpha = 1.0f;
       }
 
       /* bad radius */
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 24c9a7c4147..c9fb8b6990b 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -428,6 +428,13 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
 
   for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
     brush->blur_kernel_radius = 2;
+
+    /* Use full strength for all non-sculpt brushes,
+     * when painting we want to use full color/weight always.
+     *
+     * Note that sculpt is an exception,
+     * it's values are overwritten by #BKE_brush_sculpt_reset below. */
+    brush->alpha = 1.0;
   }
 
   {
@@ -475,7 +482,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
 
     /* Use the same tool icon color in the brush cursor */
     for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
-      if (brush->sculpt_tool) {
+      if (brush->ob_mode & OB_MODE_SCULPT) {
+        BLI_assert(brush->sculpt_tool != 0);
         BKE_brush_sculpt_reset(brush);
       }
     }
diff --git a/source/blender/makesdna/DNA_brush_defaults.h b/source/blender/makesdna/DNA_brush_defaults.h
index cf4e74dfd41..714c205cda2 100644
--- a/source/blender/makesdna/DNA_brush_defaults.h
+++ b/source/blender/makesdna/DNA_brush_defaults.h
@@ -40,7 +40,7 @@
     /* BRUSH SCULPT TOOL SETTINGS */ \
     .weight = 1.0f, /* weight of brush 0 - 1.0 */ \
     .size = 35,     /* radius of the brush in pixels */ \
-    .alpha = 0.5f,  /* brush strength/intensity probably variable should be renamed? */ \
+    .alpha = 1.0f,  /* brush strength/intensity probably variable should be renamed? */ \
     .autosmooth_factor = 0.0f, \
     .topology_rake_factor = 0.0f, \
     .crease_pinch_factor = 0.5f, \



More information about the Bf-blender-cvs mailing list