GPencil: Set samples to 10 for Soft brush
[blender.git] / source / blender / blenkernel / intern / brush.c
index 4ee3abcafeb0d752e74eb4dc942df255db67974d..78d965564e64091a0448e8dba57343c36f602c18 100644 (file)
@@ -140,12 +140,16 @@ 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);
 }
 
 /**
- * \note Resulting brush will have two users: one as a fake user, another is assumed to be used by the caller.
+ * \note Resulting brush will have two users: one as a fake user,
+ * another is assumed to be used by the caller.
  */
 Brush *BKE_brush_add(Main *bmain, const char *name, const eObjectMode ob_mode)
 {
@@ -497,9 +501,46 @@ void BKE_brush_gpencil_presets(bContext *C)
   brush->gpencil_settings->gradient_s[0] = 1.0f;
   brush->gpencil_settings->gradient_s[1] = 1.0f;
 
+  /* Soft brush */
+  brush = BKE_brush_add_gpencil(bmain, ts, "Draw Soft");
+  deft = brush; /* save default brush */
+  brush->size = 300.0f;
+  brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | GP_BRUSH_ENABLE_CURSOR);
+  brush->gpencil_settings->draw_sensitivity = 1.0f;
+
+  brush->gpencil_settings->draw_strength = 0.4f;
+  brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
+
+  brush->gpencil_settings->draw_random_press = 0.0f;
+  brush->gpencil_settings->draw_random_strength = 0.0f;
+
+  brush->gpencil_settings->draw_jitter = 0.0f;
+  brush->gpencil_settings->flag |= GP_BRUSH_USE_JITTER_PRESSURE;
+
+  brush->gpencil_settings->draw_angle = 0.0f;
+  brush->gpencil_settings->draw_angle_factor = 0.0f;
+
+  brush->gpencil_settings->input_samples = 10;
+  brush->gpencil_settings->active_smooth = 0.98f;
+  brush->gpencil_settings->draw_smoothfac = 0.1f;
+  brush->gpencil_settings->draw_smoothlvl = 1;
+  brush->gpencil_settings->draw_subdivide = 1;
+  brush->gpencil_settings->thick_smoothfac = 1.0f;
+  brush->gpencil_settings->thick_smoothlvl = 3;
+  brush->gpencil_settings->draw_random_sub = 0.0f;
+  brush->gpencil_settings->icon_id = GP_BRUSH_ICON_MARKER;
+  brush->gpencil_tool = GPAINT_TOOL_DRAW;
+
+  brush->smooth_stroke_radius = SMOOTH_STROKE_RADIUS;
+  brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
+
+  brush->gpencil_settings->gradient_f = 0.211f;
+  brush->gpencil_settings->gradient_s[0] = 1.0f;
+  brush->gpencil_settings->gradient_s[1] = 0.91f;
+
   /* Fill brush */
   brush = BKE_brush_add_gpencil(bmain, ts, "Fill Area");
-  brush->size = 1.0f;
+  brush->size = 20.0f;
   brush->gpencil_settings->flag |= GP_BRUSH_ENABLE_CURSOR;
   brush->gpencil_settings->draw_sensitivity = 1.0f;
   brush->gpencil_settings->fill_leak = 3;
@@ -581,8 +622,10 @@ struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mo
 }
 
 /**
- * Only copy internal data of Brush ID from source to already allocated/initialized destination.
- * You probably never want to use that directly, use BKE_id_copy or BKE_id_copy_ex for typical needs.
+ * Only copy internal data of Brush ID from source
+ * to already allocated/initialized destination.
+ * You probably never want to use that directly,
+ * use #BKE_id_copy or #BKE_id_copy_ex for typical needs.
  *
  * WARNING! This function will not handle ID user count!
  *