From 612a4382c443bcd02e0bb5ffd1b1fdbb251f6e7b Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 3 Oct 2022 12:22:30 +0200 Subject: [PATCH] FiX #101518: Curves sculptmode Stabilize Stroke misses indicator line Drawing code `paint_draw_smooth_cursor` would be called correctly, it was just the color not being initialized. This is usually done with `BKE_paint_init`, but in the case of curves sculpting brushes this would create an additional (unnamed) brush which should be avoided since the workspace toolsystem creates the "right" brush anyways. So this patch just does the minimal work to get the Stabilize Stroke indicator line to draw (which is initializing the color). Brought over from https://archive.blender.org/developer/D16793 --- source/blender/blenkernel/BKE_paint.h | 1 + source/blender/blenkernel/intern/paint.cc | 1 + source/blender/editors/sculpt_paint/curves_sculpt_ops.cc | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 1a380addfbb..0247bfcf673 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -66,6 +66,7 @@ extern const uchar PAINT_CURSOR_SCULPT[3]; extern const uchar PAINT_CURSOR_VERTEX_PAINT[3]; extern const uchar PAINT_CURSOR_WEIGHT_PAINT[3]; extern const uchar PAINT_CURSOR_TEXTURE_PAINT[3]; +extern const uchar PAINT_CURSOR_SCULPT_CURVES[3]; typedef enum ePaintMode { PAINT_MODE_SCULPT = 0, diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 3ec6525ac6b..a838eae788d 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -234,6 +234,7 @@ const uchar PAINT_CURSOR_SCULPT[3] = {255, 100, 100}; const uchar PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255}; const uchar PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255}; const uchar PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255}; +const uchar PAINT_CURSOR_SCULPT_CURVES[3] = {255, 100, 100}; static ePaintOverlayControlFlags overlay_flags = (ePaintOverlayControlFlags)0; diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc index 2b024c22b7d..447ca0d5b64 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc @@ -286,6 +286,11 @@ static void curves_sculptmode_enter(bContext *C) ob->mode = OB_MODE_SCULPT_CURVES; + /* Setup cursor color. BKE_paint_init() could be used, but creates an additional brush. */ + Paint *paint = BKE_paint_get_active_from_paintmode(scene, PAINT_MODE_SCULPT_CURVES); + copy_v3_v3_uchar(paint->paint_cursor_col, PAINT_CURSOR_SCULPT_CURVES); + paint->paint_cursor_col[3] = 128; + ED_paint_cursor_start(&curves_sculpt->paint, CURVES_SCULPT_mode_poll_view3d); paint_init_pivot(ob, scene); -- 2.30.2