[Bf-blender-cvs] [04ef62177fb] master: UI: Use paint crosshair cursor in all paint & sculpt modes

William Reynish noreply at git.blender.org
Mon Sep 30 13:33:56 CEST 2019


Commit: 04ef62177fb6483dd1424486b8d7ddf994f62204
Author: William Reynish
Date:   Mon Sep 30 13:33:54 2019 +0200
Branches: master
https://developer.blender.org/rB04ef62177fb6483dd1424486b8d7ddf994f62204

UI: Use paint crosshair cursor in all paint & sculpt modes

Currently, we use the crosshair cursor in Sculpt mode, but not in the other paint modes.

  - Sculpt Mode: This crosshair cursor is too weighty.
  - Texture, Weight, Vertex Paint: Using the arrow cursor for painting is not right.

This commit makes the following changes:

  - Use the new special paint crosshair instead
  - Use this cursor in all paint modes, not just Sculpt

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D5940

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/makesrna/intern/rna_wm_api.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 5a48a509f15..aa5be13c01b 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -48,6 +48,7 @@ def generate_from_enum_ex(
         icon_prefix,
         type,
         attr,
+        cursor='DEFAULT',
         tooldef_keywords={},
 ):
     tool_defs = []
@@ -60,6 +61,7 @@ def generate_from_enum_ex(
                     idname=idname_prefix + name,
                     label=name,
                     icon=icon_prefix + idname.lower(),
+                    cursor=cursor,
                     data_block=idname,
                     **tooldef_keywords,
                 )
@@ -1318,6 +1320,7 @@ class _defs_gpencil_paint:
             icon_prefix="brush.gpencil_draw.",
             type=bpy.types.Brush,
             attr="gpencil_tool",
+            cursor='PAINT_CROSS',
             tooldef_keywords=dict(
                 operator="gpencil.draw",
             ),
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 1f706d2f169..411710635d6 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1361,19 +1361,13 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
       is_cursor_over_mesh = sculpt_cursor_geometry_info_update(
           C, &gi, mouse, !(brush->falloff_shape & BRUSH_AIRBRUSH));
     }
+    /* Use special paint crosshair cursor in all paint modes*/
+    wmWindow *win = CTX_wm_window(C);
+    WM_cursor_set(win, WM_CURSOR_CROSSA);
 
     if ((mode == PAINT_MODE_SCULPT) && ss && !is_multires &&
         !(brush->falloff_shape & BRUSH_AIRBRUSH)) {
       Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
-      wmWindow *win = CTX_wm_window(C);
-
-      /* Update WM mouse cursor, disable when the 3D brush cursor is enabled */
-      if (sd->paint.brush->overlay_flags & BRUSH_OVERLAY_CURSOR) {
-        WM_cursor_set(win, WM_CURSOR_DEFAULT);
-      }
-      else {
-        WM_cursor_set(win, WM_CURSOR_EDIT);
-      }
 
       if (!ups->stroke_active) {
         bool update_previews = false;
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index f0bc031c328..1457f0e45e7 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -54,6 +54,7 @@ const EnumPropertyItem rna_enum_window_cursor_items[] = {
     {WM_CURSOR_KNIFE, "KNIFE", 0, "Knife", ""},
     {WM_CURSOR_TEXT_EDIT, "TEXT", 0, "Text", ""},
     {WM_CURSOR_PAINT_BRUSH, "PAINT_BRUSH", 0, "Paint Brush", ""},
+    {WM_CURSOR_CROSSA, "PAINT_CROSS", 0, "Paint Cross", ""},
     {WM_CURSOR_ERASER, "ERASER", 0, "Eraser", ""},
     {WM_CURSOR_HAND, "HAND", 0, "Hand", ""},
     {WM_CURSOR_EW_SCROLL, "SCROLL_X", 0, "Scroll-X", ""},



More information about the Bf-blender-cvs mailing list