diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-11-24 23:20:27 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-11-27 19:33:51 +0300 |
commit | 9e3006e5079cc3dd65ab755301feda4f603804b4 (patch) | |
tree | e28d1f5cd7a477ac012c6e1ce1309eb05ebe7fcf | |
parent | 47645a8db6223ba31b8128db7502f27876a2586b (diff) |
Clay Brush: Input curves and update defaults
Updated defaults and pressure/size curves for the Clay brush.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6298
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index a64da8f6606..8b90eafdddf 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -931,7 +931,9 @@ void BKE_brush_sculpt_reset(Brush *br) br->alpha = 1.0f; break; case SCULPT_TOOL_CLAY: - br->spacing = 6; + br->flag |= BRUSH_SIZE_PRESSURE; + br->spacing = 3; + br->autosmooth_factor = 0.25f; br->normal_radius_factor = 0.75f; break; case SCULPT_TOOL_CLAY_STRIPS: diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 63b9949e0ef..9eb32a9f731 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1741,8 +1741,9 @@ static float brush_strength(const Sculpt *sd, switch (brush->sculpt_tool) { case SCULPT_TOOL_CLAY: + final_pressure = pow4f(pressure); overlap = (1.0f + overlap) / 2.0f; - return 0.25f * alpha * flip * pressure * overlap * feather; + return 0.25f * alpha * flip * final_pressure * overlap * feather; case SCULPT_TOOL_DRAW: case SCULPT_TOOL_DRAW_SHARP: case SCULPT_TOOL_LAYER: @@ -4659,7 +4660,6 @@ static void do_clay_brush_task_cb_ex(void *__restrict userdata, if (sculpt_brush_test_sq_fn(&test, vd.co)) { float intr[3]; float val[3]; - closest_to_plane_normalized_v3(intr, test.plane_tool, vd.co); sub_v3_v3v3(val, intr, vd.co); @@ -4695,6 +4695,7 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) Brush *brush = BKE_paint_brush(&sd->paint); const float radius = fabsf(ss->cache->radius); + const float initial_radius = fabsf(ss->cache->initial_radius); bool flip = ss->cache->bstrength < 0.0f; float offset = get_offset(sd, ss); @@ -4730,7 +4731,7 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) d_offset = min_ff(radius, d_offset); d_offset = d_offset / radius; d_offset = 1.0f - d_offset; - displace = fabsf(radius * (0.25f + offset + (d_offset * 0.15f))); + displace = fabsf(initial_radius * (0.25f + offset + (d_offset * 0.15f))); if (flip) { displace = -displace; } @@ -6514,8 +6515,10 @@ static void sculpt_update_cache_invariants( static float sculpt_brush_dynamic_size_get(Brush *brush, StrokeCache *cache, float initial_size) { switch (brush->sculpt_tool) { + case SCULPT_TOOL_CLAY: + return max_ff(initial_size * 0.20f, initial_size * pow3f(cache->pressure)); case SCULPT_TOOL_CLAY_STRIPS: - return max_ff(initial_size * 0.35f, initial_size * cache->pressure * cache->pressure); + return max_ff(initial_size * 0.35f, initial_size * pow2f(cache->pressure)); default: return initial_size * cache->pressure; } |