From b571516237a94e944b9182d233b9ba64819d92c4 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Thu, 7 May 2020 15:02:21 +0200 Subject: GPencil: Include new Brush random curves Now the brushes have several new random settings and use curves to define the effect. The curves have been moved below the parameter to keep UI standards and extra curve panels have been removed. {F8505387} The new curves are: * Hue. * Saturation. * Value. New option to random at stroke level instead to random at point level for the following values: * Thickness. * Strength. * UV. * Hue. * Saturation. * Value. Curves have been moved below the corresponding parameter and only are displayed in properties panel. Display the curves in the popover made it unusable. {F8505392} Also, the Pressure random has been renamed to Radius because the old name was not clear enough. Reviewed By: mendio, pablovazquez Differential Revision: https://developer.blender.org/D7577 --- source/blender/makesdna/DNA_brush_types.h | 44 +++++++++++++++++++++++++++-- source/blender/makesdna/DNA_gpencil_types.h | 3 -- 2 files changed, 42 insertions(+), 5 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 0e16abf76f7..c143c2a442a 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -75,7 +75,7 @@ typedef struct BrushGpencilSettings { short fill_leak; /** Fill zoom factor */ short fill_factor; - char _pad1[4]; + int flag2; /** Number of simplify steps. */ int fill_simplylvl; @@ -118,11 +118,24 @@ typedef struct BrushGpencilSettings { int sculpt_mode_flag; /** Preset type (used to reset brushes - internal). */ short preset_type; - char _pad3[6]; + char _pad3[2]; + + /** Randomness for Hue. */ + float random_hue; + /** Randomness for Saturation. */ + float random_saturation; + /** Randomness for Value. */ + float random_value; struct CurveMapping *curve_sensitivity; struct CurveMapping *curve_strength; struct CurveMapping *curve_jitter; + struct CurveMapping *curve_rand_pressure; + struct CurveMapping *curve_rand_strength; + struct CurveMapping *curve_rand_uv; + struct CurveMapping *curve_rand_hue; + struct CurveMapping *curve_rand_saturation; + struct CurveMapping *curve_rand_value; /* optional link of material to replace default in context */ /** Material. */ @@ -204,6 +217,33 @@ typedef enum eGPDbrush_Flag { GP_BRUSH_TRIM_STROKE = (1 << 16), } eGPDbrush_Flag; +typedef enum eGPDbrush_Flag2 { + /* Brush use random Hue at stroke level */ + GP_BRUSH_USE_HUE_AT_STROKE = (1 << 0), + /* Brush use random Saturation at stroke level */ + GP_BRUSH_USE_SAT_AT_STROKE = (1 << 1), + /* Brush use random Value at stroke level */ + GP_BRUSH_USE_VAL_AT_STROKE = (1 << 2), + /* Brush use random Pressure at stroke level */ + GP_BRUSH_USE_PRESS_AT_STROKE = (1 << 3), + /* Brush use random Strength at stroke level */ + GP_BRUSH_USE_STRENGTH_AT_STROKE = (1 << 4), + /* Brush use random UV at stroke level */ + GP_BRUSH_USE_UV_AT_STROKE = (1 << 5), + /* Brush use Hue random pressure */ + GP_BRUSH_USE_HUE_RAND_PRESS = (1 << 6), + /* Brush use Saturation random pressure */ + GP_BRUSH_USE_SAT_RAND_PRESS = (1 << 7), + /* Brush use Value random pressure */ + GP_BRUSH_USE_VAL_RAND_PRESS = (1 << 8), + /* Brush use Pressure random pressure */ + GP_BRUSH_USE_PRESSURE_RAND_PRESS = (1 << 9), + /* Brush use Strength random pressure */ + GP_BRUSH_USE_STRENGTH_RAND_PRESS = (1 << 10), + /* Brush use UV random pressure */ + GP_BRUSH_USE_UV_RAND_PRESS = (1 << 11), +} eGPDbrush_Flag2; + /* BrushGpencilSettings->gp_fill_draw_mode */ typedef enum eGP_FillDrawModes { GP_FILL_DMODE_BOTH = 0, diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index cfc9324a100..c3180ae79db 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -520,9 +520,6 @@ typedef struct bGPdata_Runtime { /** Number of total elements available in cache. */ int sbuffer_size; - /** Vertex Color applied to point (while drawing). */ - float vert_color[4]; - /** Vertex Color applied to Fill (while drawing). */ float vert_color_fill[4]; -- cgit v1.2.3