Sculpt: Clay Strips brush tweaks

- Fix accumulate by allowing normal radius greater than one. Now it works as it should and it should be enabled by default
- Make the square test sharper. This gives a lot more definition to the brush, even when working with fewer polygons

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5984
This commit is contained in:
Pablo Dobarro
2019-10-03 23:46:29 +02:00
parent 2b55a1da50
commit d590db8370
3 changed files with 13 additions and 5 deletions

View File

@@ -909,6 +909,13 @@ void BKE_brush_sculpt_reset(Brush *br)
case SCULPT_TOOL_CLAY:
br->flag |= BRUSH_FRONTFACE;
break;
case SCULPT_TOOL_CLAY_STRIPS:
br->flag |= BRUSH_ACCUMULATE;
br->alpha = 0.7f;
br->normal_radius_factor = 1.7f;
br->curve_preset = BRUSH_CURVE_SPHERE;
br->spacing = 6;
break;
case SCULPT_TOOL_CREASE:
br->flag |= BRUSH_DIR_IN;
br->alpha = 0.25;

View File

@@ -1098,9 +1098,8 @@ bool sculpt_brush_test_cube(SculptBrushTest *test, const float co[3], float loca
local_co[1] = fabsf(local_co[1]);
local_co[2] = fabsf(local_co[2]);
const float p = 8.0f;
if (local_co[0] <= side && local_co[1] <= side && local_co[2] <= side) {
float p = 4.0f;
test->dist = ((powf(local_co[0], p) + powf(local_co[1], p) + powf(local_co[2], p)) /
powf(side, p));
@@ -1740,11 +1739,13 @@ static float brush_strength(const Sculpt *sd,
switch (brush->sculpt_tool) {
case SCULPT_TOOL_CLAY:
case SCULPT_TOOL_CLAY_STRIPS:
case SCULPT_TOOL_DRAW:
case SCULPT_TOOL_DRAW_SHARP:
case SCULPT_TOOL_LAYER:
return alpha * flip * pressure * overlap * feather;
case SCULPT_TOOL_CLAY_STRIPS:
/* Clay Strips needs extra strength to compensate for its default normal radius */
return alpha * flip * pressure * overlap * feather * 1.3f;
case SCULPT_TOOL_MASK:
overlap = (1 + overlap) / 2;

View File

@@ -1885,8 +1885,8 @@ static void rna_def_brush(BlenderRNA *brna)
prop = RNA_def_property(srna, "normal_radius_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "normal_radius_factor");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_range(prop, 0.0f, 2.0f, 0.001, 3);
RNA_def_property_ui_text(prop,
"Normal Radius",
"Ratio between the brush radius and the radius that is going to be "