[Bf-blender-cvs] [c043ab1cf3b] master: Fix T63233: Set default blur kernel radius to 2.

Jacques Lucke noreply at git.blender.org
Tue Apr 23 12:34:17 CEST 2019


Commit: c043ab1cf3bce77248a8d7dfa42b2e9f8f9611aa
Author: Jacques Lucke
Date:   Tue Apr 23 12:31:37 2019 +0200
Branches: master
https://developer.blender.org/rBc043ab1cf3bce77248a8d7dfa42b2e9f8f9611aa

Fix T63233: Set default blur kernel radius to 2.

Reviewers: jbakker

Differential Revision: https://developer.blender.org/D4722

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

M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 4ee3abcafeb..dcca6e2bf84 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -140,6 +140,9 @@ void BKE_brush_init(Brush *brush)
 
   brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the draw tool for new brushes */
 
+  /* A kernel radius of 1 has almost no effect (T63233). */
+  brush->blur_kernel_radius = 2;
+
   /* the default alpha falloff curve */
   BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
 }
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index c5263708f43..b5b86224644 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -353,4 +353,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
     copy_v2_fl2(scene->safe_areas.title, 0.1f, 0.05f);
     copy_v2_fl2(scene->safe_areas.action, 0.035f, 0.035f);
   }
+
+  for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
+    brush->blur_kernel_radius = 2;
+  }
 }
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index e2ff6935e43..6dc5a9cfd6a 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1840,6 +1840,7 @@ static void rna_def_brush(BlenderRNA *brna)
   prop = RNA_def_property(srna, "blur_kernel_radius", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "blur_kernel_radius");
   RNA_def_property_range(prop, 1, 10000);
+  RNA_def_property_int_default(prop, 2);
   RNA_def_property_ui_range(prop, 1, 50, 1, -1);
   RNA_def_property_ui_text(
       prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels");



More information about the Bf-blender-cvs mailing list