[Bf-blender-cvs] [63044a696bb] sculpt-dev: Sculpt: fix paint brush defaults

Joseph Eagar noreply at git.blender.org
Sat Sep 25 09:39:09 CEST 2021


Commit: 63044a696bb321cf92553562a39e5211890cd58e
Author: Joseph Eagar
Date:   Sat Sep 25 00:38:54 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB63044a696bb321cf92553562a39e5211890cd58e

Sculpt: fix paint brush defaults

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

M	source/blender/blenkernel/intern/brush_channel_define.h
M	source/blender/blenkernel/intern/brush_engine.c
M	source/blender/blenkernel/intern/brush_engine_presets.c

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

diff --git a/source/blender/blenkernel/intern/brush_channel_define.h b/source/blender/blenkernel/intern/brush_channel_define.h
index eda2d66f4be..a654eebe8a2 100644
--- a/source/blender/blenkernel/intern/brush_channel_define.h
+++ b/source/blender/blenkernel/intern/brush_channel_define.h
@@ -187,12 +187,12 @@ MAKE_INT(jitter_absolute, "Absolute Jitter", "", 0, 0.0f, 1000.0f)
 MAKE_FLOAT(smooth_stroke_radius, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues", 10.0f, 10.0f, 200.0f)
 MAKE_FLOAT(smooth_stroke_factor, "Smooth Stroke Factor", "", 0.5f, 0.5f, 0.99f)
 MAKE_FLOAT_EX(rate, "Rate", "", 0.5, 0.0001f, 10000.0f, 0.01f, 1.0f, false)
-MAKE_FLOAT(flow, "Flow", "Amount of paint that is applied per stroke sample", 0.0f, 0.0f, 1.0f)
+MAKE_FLOAT(flow, "Flow", "Amount of paint that is applied per stroke sample", 1.0f, 0.0f, 1.0f)
 MAKE_FLOAT(wet_mix, "Wet Mix", "Amount of paint that is picked from the surface into the brush color", 0.0f, 0.0f, 1.0f)
 MAKE_FLOAT(wet_persistence, "Wet Persistence", "Amount of wet paint that stays in the brush after applying paint to the surface", 0.0f, 0.0f, 1.0f)
-MAKE_FLOAT(density, "Density", "Amount of random elements that are going to be affected by the brush", 0.0f, 0.0f, 1.0f)
-MAKE_FLOAT(tip_scale_x, "Tip Scale X", "Scale of the brush tip in the X axis", 0.0f, 0.0f, 1.0f)
-MAKE_FLOAT(dash_ratio, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled", 0.0f, 0.0f, 1.0f)
+MAKE_FLOAT(density, "Density", "Amount of random elements that are going to be affected by the brush", 1.0f, 0.0f, 1.0f)
+MAKE_FLOAT(tip_scale_x, "Tip Scale X", "Scale of the brush tip in the X axis", 1.0f, 0.0f, 1.0f)
+MAKE_FLOAT(dash_ratio, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled", 1.0f, 0.0f, 1.0f)
 MAKE_FLOAT_EX(plane_offset, "Plane Offset", "Adjust plane on which the brush acts towards or away from the object surface", 0.0f, -2.0f, 2.0f, -0.5f, 0.5f, false)
 MAKE_BOOL(original_normal, "Original Normal", "When locked keep using normal of surface where stroke was initiated", false)
 MAKE_BOOL(original_plane, "Original Plane", "When locked keep using the plane origin of surface where stroke was initiated", false)
diff --git a/source/blender/blenkernel/intern/brush_engine.c b/source/blender/blenkernel/intern/brush_engine.c
index 954bec58090..7f80f366e3b 100644
--- a/source/blender/blenkernel/intern/brush_engine.c
+++ b/source/blender/blenkernel/intern/brush_engine.c
@@ -363,6 +363,7 @@ void BKE_brush_channel_init(BrushChannel *ch, BrushChannelType *def)
   ch->curve.preset = def->curve_preset;
   ch->fvalue = def->fvalue;
   ch->ivalue = def->ivalue;
+  copy_v4_v4(ch->vector, def->vector);
 
   ch->type = def->type;
   ch->def = def;
diff --git a/source/blender/blenkernel/intern/brush_engine_presets.c b/source/blender/blenkernel/intern/brush_engine_presets.c
index d2b43ee47da..bdc7cd638c0 100644
--- a/source/blender/blenkernel/intern/brush_engine_presets.c
+++ b/source/blender/blenkernel/intern/brush_engine_presets.c
@@ -825,6 +825,7 @@ void BKE_brush_builtin_patch(Brush *brush, int tool)
       ADDCH(wet_persistence);
       ADDCH(density);
       ADDCH(tip_scale_x);
+      ADDCH(tip_roundness);
       ADDCH(flow);
       ADDCH(rate);
 
@@ -1005,6 +1006,20 @@ void BKE_brush_channelset_ui_init(Brush *brush, int tool)
       SHOWWRK(crease_pinch_factor);
       SHOWWRK(rake_factor);
       SHOWWRK(snake_hook_deform_type);
+      break;
+    case SCULPT_TOOL_PAINT:
+      SHOWWRK(color);
+      SHOWWRK(secondary_color);
+      SHOWWRK(wet_mix);
+      SHOWWRK(wet_persistence);
+      SHOWWRK(density);
+      SHOWWRK(tip_scale_x);
+      SHOWWRK(hardness);
+      SHOWWRK(wet_mix);
+      SHOWWRK(tip_roundness);
+      SHOWWRK(flow);
+      SHOWWRK(rate);
+
       break;
     case SCULPT_TOOL_POSE:
       SHOWWRK(pose_ik_segments);
@@ -1063,7 +1078,7 @@ void BKE_brush_builtin_create(Brush *brush, int tool)
       break;
     }
     case SCULPT_TOOL_DRAW_SHARP:
-      BRUSHSET_LOOKUP(chset, spacing)->ivalue = 5;
+      BRUSHSET_LOOKUP(chset, spacing)->fvalue = 5;
       BRUSHSET_SET_INT(chset, direction, 1);
       BRUSHSET_LOOKUP(chset, radius)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
           BRUSH_MAPPING_ENABLED;
@@ -1073,19 +1088,24 @@ void BKE_brush_builtin_create(Brush *brush, int tool)
     case SCULPT_TOOL_DISPLACEMENT_ERASER:
     case SCULPT_TOOL_FAIRING:
     case SCULPT_TOOL_SCENE_PROJECT:
-      GETCH(spacing)->ivalue = 10;
+      GETCH(spacing)->fvalue = 10;
       GETCH(strength)->fvalue = 1.0f;
       GETCH(dyntopo_disabled)->ivalue = 1;
       break;
     case SCULPT_TOOL_SLIDE_RELAX:
-      GETCH(spacing)->ivalue = 10;
+      GETCH(spacing)->fvalue = 10;
       GETCH(strength)->fvalue = 1.0f;
       GETCH(dyntopo_disabled)->ivalue = 1;
       GETCH(slide_deform_type)->ivalue = BRUSH_SLIDE_DEFORM_DRAG;
       break;
+    case SCULPT_TOOL_PAINT:
+      BRUSHSET_SET_FLOAT(chset, hardness, 0.4f);
+      BRUSHSET_SET_FLOAT(chset, spacing, 10.0f);
+      BRUSHSET_SET_FLOAT(chset, strength, 0.6f);
+      break;
     case SCULPT_TOOL_CLAY:
       GETCH(radius)->mappings[BRUSH_MAPPING_PRESSURE].flag |= BRUSH_MAPPING_ENABLED;
-      GETCH(spacing)->ivalue = 3;
+      GETCH(spacing)->fvalue = 3;
       GETCH(autosmooth)->fvalue = 0.25f;
       GETCH(normal_radius_factor)->fvalue = 0.75f;
       GETCH(hardness)->fvalue = 0.65;
@@ -1093,7 +1113,7 @@ void BKE_brush_builtin_create(Brush *brush, int tool)
     case SCULPT_TOOL_TWIST:
       GETCH(strength)->fvalue = 0.5f;
       GETCH(normal_radius_factor)->fvalue = 1.0f;
-      GETCH(spacing)->ivalue = 6;
+      GETCH(spacing)->fvalue = 6;
       GETCH(hardness)->fvalue = 0.5;
       break;
     case SCULPT_TOOL_CLAY_STRIPS: {



More information about the Bf-blender-cvs mailing list