WIP: Demonstration of Edit Mode Cursor Preference #116645

Closed
Harley Acheson wants to merge 2 commits from Harley/blender:EditCursors into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
5 changed files with 20 additions and 2 deletions

View File

@ -538,6 +538,7 @@ class USERPREF_PT_edit_misc(EditingPanel, CenterAlignMixIn, Panel):
col = layout.column()
col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
col.prop(edit, "cursor_editmode")
# -----------------------------------------------------------------------------

View File

@ -45,6 +45,7 @@
#include "readfile.hh" /* Own include. */
#include "WM_types.hh"
#include "wm_cursors.hh"
#include "wm_event_types.hh"
/* Don't use translation strings in versioning!
@ -922,6 +923,7 @@ void blo_do_versions_userdef(UserDef *userdef)
*/
{
/* Keep this block, even when empty. */
userdef->cursor_editmode = WM_CURSOR_CROSS;
}
LISTBASE_FOREACH (bTheme *, btheme, &userdef->themes) {

View File

@ -1516,7 +1516,7 @@ static void view3d_main_region_cursor(wmWindow *win, ScrArea *area, ARegion *reg
BKE_view_layer_synced_ensure(scene, view_layer);
Object *obedit = BKE_view_layer_edit_object_get(view_layer);
if (obedit) {
WM_cursor_set(win, WM_CURSOR_EDIT);
WM_cursor_set(win, U.cursor_editmode);
}
else {
WM_cursor_set(win, WM_CURSOR_DEFAULT);

View File

@ -923,7 +923,8 @@ typedef struct UserDef {
/** Number of samples for FPS display calculations. */
short playback_fps_samples;
char _pad7[2];
char cursor_editmode;
char _pad7[1];
/** Private, defaults to 20 for 72 DPI setting. */
short widget_unit;

View File

@ -5635,6 +5635,20 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_CURSOR);
RNA_def_property_ui_text(
prop, "Cursor Surface Project", "Use the surface depth for cursor placement");
static const EnumPropertyItem editmode_cursors[] = {
{WM_CURSOR_CROSS, "CROSS", 0, "Cross", "Cross cursor"},
{WM_CURSOR_PAINT, "PAINT_CROSS", 0, "Paint", "Paint cross cursor"},
{WM_CURSOR_CROSSC, "ALT_CROSS", 0, "Alternate Cross", "Alternate cross cursor"},
{WM_CURSOR_DEFAULT, "ARROW", 0, "Arrow", "Arrow cursor"},
{0, NULL, 0, NULL, NULL},
};
prop = RNA_def_property(srna, "cursor_editmode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, editmode_cursors);
RNA_def_property_enum_default(prop, WM_CURSOR_CROSS);
RNA_def_property_ui_text(prop, "Edit Cursor", "Cursor used while editing.");
RNA_def_property_update(prop, 0, "rna_userdef_gpu_update");
}
static void rna_def_userdef_system(BlenderRNA *brna)