From 6ee6a42d10e3c1c0868d1f038401d525264a7e24 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Tue, 11 Feb 2020 20:04:41 +0100 Subject: Sculpt: Clay Strips Tip Roundness property This patch allow to change the brush tip shape between a square and a circle using a brush property. After this change we are no longer testing the distance against a cube (the Z axis is not used). I did not test this in depth, but if it does not produce any artifacts I think we can keep it this way instead of adding more complexity to the code. In this new distance test the brush falloff is only applied on the rounded parts of the square to avoid sharp artifacts in the diagonals. Because of this, the round version is much softer than the square one. The planned hardness property will fix this, but this can also be avoided by setting the fallof to a custom curve. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6165 --- source/blender/makesdna/DNA_brush_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_brush_types.h') diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index c5bf026983b..a9e15a5baf9 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -311,7 +311,7 @@ typedef struct Brush { char mask_tool; /** Active grease pencil tool. */ char gpencil_tool; - char _pad1[5]; + char _pad1[1]; float autosmooth_factor; @@ -330,6 +330,10 @@ typedef struct Brush { int curve_preset; int automasking_flags; + /* Factor that controls the shape of the brush tip by rounding the corners of a square. */ + /* 0.0 value produces a square, 1.0 produces a circle. */ + float tip_roundness; + int elastic_deform_type; float elastic_deform_volume_preservation; -- cgit v1.2.3