Revert new grease pencil cursor for paint modes
This reverts commita412f49e75and873c756e5d. The change was only supposed to affect grease pencil, but also changed the cursor for sculpt mode, where it's not clearly visible. Since this has not been quickly resolved I'm reverting the commit. Ref D5036.
This commit is contained in:
@@ -60,7 +60,6 @@ def generate_from_enum_ex(
|
||||
idname=idname_prefix + name,
|
||||
label=name,
|
||||
icon=icon_prefix + idname.lower(),
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
data_block=idname,
|
||||
**tooldef_keywords,
|
||||
)
|
||||
@@ -200,7 +199,7 @@ class _defs_annotate:
|
||||
idname="builtin.annotate_line",
|
||||
label="Annotate Line",
|
||||
icon="ops.gpencil.draw.line",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
keymap="Generic Tool: Annotate Line",
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
@@ -211,7 +210,7 @@ class _defs_annotate:
|
||||
idname="builtin.annotate_polygon",
|
||||
label="Annotate Polygon",
|
||||
icon="ops.gpencil.draw.poly",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
keymap="Generic Tool: Annotate Polygon",
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
@@ -226,7 +225,7 @@ class _defs_annotate:
|
||||
idname="builtin.annotate_eraser",
|
||||
label="Annotate Eraser",
|
||||
icon="ops.gpencil.draw.eraser",
|
||||
cursor='PAINT_CROSSHAIR', # XXX: Always show brush circle when enabled
|
||||
cursor='CROSSHAIR', # XXX: Always show brush circle when enabled
|
||||
keymap="Generic Tool: Annotate Eraser",
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
@@ -1287,7 +1286,7 @@ class _defs_gpencil_paint:
|
||||
idname="builtin.line",
|
||||
label="Line",
|
||||
icon="ops.gpencil.primitive_line",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
widget=None,
|
||||
keymap=(),
|
||||
)
|
||||
@@ -1298,7 +1297,7 @@ class _defs_gpencil_paint:
|
||||
idname="builtin.box",
|
||||
label="Box",
|
||||
icon="ops.gpencil.primitive_box",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
widget=None,
|
||||
keymap=(),
|
||||
)
|
||||
@@ -1309,7 +1308,7 @@ class _defs_gpencil_paint:
|
||||
idname="builtin.circle",
|
||||
label="Circle",
|
||||
icon="ops.gpencil.primitive_circle",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
widget=None,
|
||||
keymap=(),
|
||||
)
|
||||
@@ -1320,7 +1319,7 @@ class _defs_gpencil_paint:
|
||||
idname="builtin.arc",
|
||||
label="Arc",
|
||||
icon="ops.gpencil.primitive_arc",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
widget=None,
|
||||
keymap=(),
|
||||
)
|
||||
@@ -1331,7 +1330,7 @@ class _defs_gpencil_paint:
|
||||
idname="builtin.curve",
|
||||
label="Curve",
|
||||
icon="ops.gpencil.primitive_curve",
|
||||
cursor='PAINT_CROSSHAIR',
|
||||
cursor='CROSSHAIR',
|
||||
widget=None,
|
||||
keymap=(),
|
||||
)
|
||||
|
||||
@@ -2392,6 +2392,10 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op)
|
||||
WM_cursor_modal_restore(CTX_wm_window(C));
|
||||
}
|
||||
else {
|
||||
/* or restore paint if 3D view */
|
||||
if ((p) && (p->paintmode == GP_PAINTMODE_ERASER)) {
|
||||
WM_cursor_modal_set(p->win, CURSOR_STD);
|
||||
}
|
||||
|
||||
/* drawing batch cache is dirty now */
|
||||
bGPdata *gpd = CTX_data_gpencil_data(C);
|
||||
@@ -2405,6 +2409,8 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op)
|
||||
gpencil_undo_finish();
|
||||
|
||||
/* cleanup */
|
||||
WM_cursor_modal_set(p->win, CURSOR_STD);
|
||||
|
||||
gp_paint_cleanup(p);
|
||||
gp_session_cleanup(p);
|
||||
ED_gpencil_toggle_brush_cursor(C, true, NULL);
|
||||
@@ -2469,6 +2475,18 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
|
||||
/* ------------------------------- */
|
||||
|
||||
/* ensure that the correct cursor icon is set */
|
||||
static void gpencil_draw_cursor_set(tGPsdata *p)
|
||||
{
|
||||
Brush *brush = p->brush;
|
||||
if ((p->paintmode == GP_PAINTMODE_ERASER) || (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
|
||||
WM_cursor_modal_set(p->win, BC_CROSSCURSOR); /* XXX need a better cursor */
|
||||
}
|
||||
else {
|
||||
WM_cursor_modal_set(p->win, CURSOR_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/* update UI indicators of status, including cursor and header prints */
|
||||
static void gpencil_draw_status_indicators(bContext *C, tGPsdata *p)
|
||||
{
|
||||
@@ -3183,6 +3201,11 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
|
||||
else {
|
||||
ED_gpencil_toggle_brush_cursor(C, true, NULL);
|
||||
}
|
||||
/* set cursor
|
||||
* NOTE: This may change later (i.e. intentionally via brush toggle,
|
||||
* or unintentionally if the user scrolls outside the area)...
|
||||
*/
|
||||
gpencil_draw_cursor_set(p);
|
||||
|
||||
/* only start drawing immediately if we're allowed to do so... */
|
||||
if (RNA_boolean_get(op->ptr, "wait_for_input") == false) {
|
||||
@@ -3749,6 +3772,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
else {
|
||||
/* update status indicators - cursor, header, etc. */
|
||||
gpencil_draw_status_indicators(C, p);
|
||||
gpencil_draw_cursor_set(p); /* cursor may have changed outside our control - T44084 */
|
||||
}
|
||||
|
||||
/* process last operations before exiting */
|
||||
|
||||
@@ -59,7 +59,6 @@ const EnumPropertyItem rna_enum_window_cursor_items[] = {
|
||||
{BC_NS_SCROLLCURSOR, "SCROLL_Y", 0, "Scroll-Y", ""},
|
||||
{BC_NSEW_SCROLLCURSOR, "SCROLL_XY", 0, "Scroll-XY", ""},
|
||||
{BC_EYEDROPPER_CURSOR, "EYEDROPPER", 0, "Eyedropper", ""},
|
||||
{BC_PAINTCROSSCURSOR, "PAINT_CROSSHAIR", 0, "Paint Crosshair", ""},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
|
||||
|
||||
@@ -1546,65 +1546,5 @@ void wm_init_cursor_data(void)
|
||||
|
||||
END_CURSOR_BLOCK;
|
||||
|
||||
/********************** PaintCross Cursor ***********************/
|
||||
BEGIN_CURSOR_BLOCK;
|
||||
static char paintcross_sbm[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static char paintcross_smsk[] = {
|
||||
0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x0e, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static char paintcross_sbm_large[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static char paintcross_smsk_large[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00,
|
||||
0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x0f,
|
||||
0xfc, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
|
||||
0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
|
||||
0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static BCursor PaintCrossCursor = {
|
||||
/* small */
|
||||
paintcross_sbm,
|
||||
paintcross_smsk,
|
||||
16,
|
||||
16,
|
||||
7,
|
||||
7,
|
||||
/* big */
|
||||
paintcross_sbm_large,
|
||||
paintcross_smsk_large,
|
||||
32,
|
||||
32,
|
||||
15,
|
||||
15,
|
||||
/* can invert color */
|
||||
true,
|
||||
};
|
||||
|
||||
BlenderCursor[BC_PAINTCROSSCURSOR] = &PaintCrossCursor;
|
||||
END_CURSOR_BLOCK;
|
||||
|
||||
/********************** Put the cursors in the array ***********************/
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ enum {
|
||||
BC_E_ARROWCURSOR,
|
||||
BC_W_ARROWCURSOR,
|
||||
BC_STOPCURSOR,
|
||||
BC_PAINTCROSSCURSOR,
|
||||
/* --- ALWAYS LAST ----- */
|
||||
BC_NUMCURSORS,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user