[Bf-blender-cvs] [84abab1dd2d] temp-gpencil-bezier-stroke-type: GPencil: Clean up curve pen brush tool
Falk David
noreply at git.blender.org
Sat Mar 20 15:02:15 CET 2021
Commit: 84abab1dd2d055ba40e133f170b4f895e04da3e2
Author: Falk David
Date: Sat Mar 20 14:41:23 2021 +0100
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB84abab1dd2d055ba40e133f170b4f895e04da3e2
GPencil: Clean up curve pen brush tool
The curve pen was added both as a brush tool and a normal tool.
For now the brush has been disabled.
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M source/blender/blenkernel/intern/brush.c
M source/blender/editors/gpencil/gpencil_ops.c
M source/blender/makesdna/DNA_brush_enums.h
M source/blender/makesrna/intern/rna_brush.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 120c66288d7..12536b4c71e 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1905,21 +1905,6 @@ class _defs_gpencil_paint:
),
)
- @ToolDef.from_fn
- def curve_pen():
- def draw_settings(context, layout, tool):
- pass
-
- return dict(
- idname="builtin.curve_pen",
- label="Curve Pen",
- icon="",
- cursor='DOT',
- widget=None,
- keymap=(),
- draw_settings=draw_settings,
- )
-
@ToolDef.from_fn
def cutter():
def draw_settings(_context, layout, tool):
@@ -2058,7 +2043,7 @@ class _defs_gpencil_paint:
return dict(
idname="builtin.curve_pen",
label="Curve Pen",
- icon="",
+ icon="none",
cursor='DOT',
widget=None,
keymap=(),
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index f4451e7c6e5..331fb7c6a93 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1056,6 +1056,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
zero_v3(brush->secondary_rgb);
break;
}
+#if 0
case GP_BRUSH_PRESET_INK_CURVE: {
brush->size = 25.0f;
brush->gpencil_settings->flag &= ~GP_BRUSH_USE_PRESSURE;
@@ -1075,6 +1076,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
zero_v3(brush->secondary_rgb);
break;
}
+#endif
case GP_BRUSH_PRESET_VERTEX_DRAW: {
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_VERTEX_DRAW;
brush->gpencil_vertex_tool = GPVERTEX_TOOL_DRAW;
@@ -1417,11 +1419,13 @@ void BKE_brush_gpencil_paint_presets(Main *bmain, ToolSettings *ts, const bool r
BKE_gpencil_brush_preset_set(bmain, brush, GP_BRUSH_PRESET_TINT);
}
- /* Tint brush. */
+#if 0
+ /* Curve pen. */
brush = gpencil_brush_ensure(bmain, ts, "Curve pen", OB_MODE_PAINT_GPENCIL, &r_new);
if ((reset) || (r_new)) {
BKE_gpencil_brush_preset_set(bmain, brush, GPAINT_TOOL_CURVE);
}
+#endif
/* Set default Draw brush. */
if (reset || brush_prev == NULL) {
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 496e2f24c44..c715e7c00c3 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -168,10 +168,12 @@ static bool gpencil_stroke_paintmode_tint_poll(bContext *C)
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_TINT);
}
+#if 0
static bool gpencil_stroke_paintmode_curve_poll(bContext *C)
{
return gpencil_stroke_paintmode_poll_with_tool(C, GPAINT_TOOL_CURVE);
}
+#endif
/* Poll callback for stroke sculpting mode */
static bool gpencil_stroke_sculptmode_poll(bContext *C)
@@ -343,12 +345,14 @@ static void ed_keymap_gpencil_painting_tint(wmKeyConfig *keyconf)
keymap->poll = gpencil_stroke_paintmode_tint_poll;
}
+#if 0
/* keys for draw with a curve brush */
static void ed_keymap_gpencil_painting_curve(wmKeyConfig *keyconf)
{
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Paint (Curve)", 0, 0);
keymap->poll = gpencil_stroke_paintmode_curve_poll;
}
+#endif
/* Stroke Painting Keymap - Only when paintmode is enabled */
static void ed_keymap_gpencil_painting(wmKeyConfig *keyconf)
@@ -484,7 +488,9 @@ void ED_keymap_gpencil(wmKeyConfig *keyconf)
ed_keymap_gpencil_painting_erase(keyconf);
ed_keymap_gpencil_painting_fill(keyconf);
ed_keymap_gpencil_painting_tint(keyconf);
+#if 0
ed_keymap_gpencil_painting_curve(keyconf);
+#endif
ed_keymap_gpencil_sculpting(keyconf);
ed_keymap_gpencil_sculptpainting_smooth(keyconf);
ed_keymap_gpencil_sculptpainting_thickness(keyconf);
diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h
index 119cd3c841b..42fb379cf7e 100644
--- a/source/blender/makesdna/DNA_brush_enums.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -557,7 +557,7 @@ typedef enum eBrushGPaintTool {
GPAINT_TOOL_FILL = 1,
GPAINT_TOOL_ERASE = 2,
GPAINT_TOOL_TINT = 3,
- GPAINT_TOOL_CURVE = 4,
+ GPAINT_TOOL_CURVE = 4, /* UNUSED */
} eBrushGPaintTool;
/* BrushGpencilSettings->brush type */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index f8372a33f5a..b1d85e902d9 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -192,11 +192,13 @@ const EnumPropertyItem rna_enum_brush_gpencil_types_items[] = {
ICON_BRUSH_TEXDRAW,
"Tint",
"The brush is of type used for tinting strokes"},
+#if 0
{GPAINT_TOOL_CURVE,
"CURVE",
ICON_STROKE,
- "Curve pen",
+ "Curve",
"The brush is of type used for drawing curves"},
+#endif
{0, NULL, 0, NULL, NULL},
};
More information about the Bf-blender-cvs
mailing list