Fix Cloth Snake Hook brush not using pressure

The Snake Hook deformation mode was using the same strength as grab (not
supporting pressure), but this deformation mode supports pressure.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8724
This commit is contained in:
Pablo Dobarro 2020-09-02 22:33:05 +02:00 committed by Pablo Dobarro
parent fb09bc3c35
commit 89cdf4f75d
1 changed files with 4 additions and 1 deletions

View File

@ -2273,10 +2273,13 @@ static float brush_strength(const Sculpt *sd,
case SCULPT_TOOL_DISPLACEMENT_ERASER:
return alpha * pressure * overlap * feather;
case SCULPT_TOOL_CLOTH:
if (ELEM(brush->cloth_deform_type, BRUSH_CLOTH_DEFORM_GRAB, BRUSH_CLOTH_DEFORM_SNAKE_HOOK)) {
if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB) {
/* Grab deform uses the same falloff as a regular grab brush. */
return root_alpha * feather;
}
else if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK) {
return root_alpha * feather * pressure * overlap;
}
else if (brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_EXPAND) {
/* Expand is more sensible to strength as it keeps expanding the cloth when sculpting over
* the same vertices. */