From 190334b47df46f0e912c873077163e6129e4cbae Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 5 Apr 2022 15:24:12 +0200 Subject: Curves: new Grow/Shrink brush This adds a new Grow/Shrink brush which is similar to the Length brush in the old hair system. * It's possible to switch between growing and shrinking by hold down ctrl and/or by changing the direction enum. * 3d brush is supported. * Different brush falloffs are supported. * Supports scaling curves uniformly or shrinking/extrapolating them. Extrapolation is linear only in this patch. * A minimum length settings helps to avoid creating zero-sized curves. Differential Revision: https://developer.blender.org/D14474 --- source/blender/makesdna/DNA_brush_enums.h | 9 +++++++-- source/blender/makesdna/DNA_brush_types.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h index 18d82448d1f..96a97648ac9 100644 --- a/source/blender/makesdna/DNA_brush_enums.h +++ b/source/blender/makesdna/DNA_brush_enums.h @@ -461,8 +461,8 @@ typedef enum eBrushCurvesSculptTool { CURVES_SCULPT_TOOL_DELETE = 1, CURVES_SCULPT_TOOL_SNAKE_HOOK = 2, CURVES_SCULPT_TOOL_ADD = 3, - CURVES_SCULPT_TOOL_TEST1 = 4, - CURVES_SCULPT_TOOL_TEST2 = 5, + CURVES_SCULPT_TOOL_GROW_SHRINK = 4, + CURVES_SCULPT_TOOL_TEST1 = 5, } eBrushCurvesSculptTool; /** When #BRUSH_ACCUMULATE is used */ @@ -608,6 +608,11 @@ typedef enum eBrushFalloffShape { PAINT_FALLOFF_SHAPE_TUBE = 1, } eBrushFalloffShape; +typedef enum eBrushCurvesSculptFlag { + BRUSH_CURVES_SCULPT_FLAG_SCALE_UNIFORM = (1 << 0), + BRUSH_CURVES_SCULPT_FLAG_GROW_SHRINK_INVERT = (1 << 1), +} eBrushCurvesSculptFlag; + #define MAX_BRUSH_PIXEL_RADIUS 500 #define GP_MAX_BRUSH_PIXEL_RADIUS 1000 diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 1382efca409..2d879f5afa0 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -140,6 +140,10 @@ typedef struct BrushGpencilSettings { typedef struct BrushCurvesSculptSettings { /** Number of curves added by the add brush. */ int add_amount; + /* eBrushCurvesSculptFlag. */ + uint32_t flag; + /** When shrinking curves, they shouldn't become shorter than this length. */ + float minimum_length; } BrushCurvesSculptSettings; typedef struct Brush { -- cgit v1.2.3