[Bf-blender-cvs] [24c30e001f6] master: 3D View: preference to disable selection cycling on first click

Campbell Barton noreply at git.blender.org
Thu Mar 24 11:49:30 CET 2022


Commit: 24c30e001f6ec80215a8eaa3341f260168dfdca8
Author: Campbell Barton
Date:   Thu Mar 24 21:37:51 2022 +1100
Branches: master
https://developer.blender.org/rB24c30e001f6ec80215a8eaa3341f260168dfdca8

3D View: preference to disable selection cycling on first click

Object mode selection does a kind of cycling that excludes the active
selected object. This is separate from regular selection cycling which
is enabled when clicking multiple times without moving the cursor.

This has the down-side that clicking on an object to drag it always
selects the object behind it (in the case of overlapping objects).

Since object mode selection is fundamental functionality, this is
exposed as an experimental preference for user feedback & testing.

See T96752 for details.

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 5fcb573b583..3a72d3e2096 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2261,6 +2261,7 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
             context, (
                 ({"property": "use_sculpt_vertex_colors"}, "T71947"),
                 ({"property": "use_sculpt_tools_tilt"}, "T82877"),
+                ({"property": "use_select_nearest_on_first_click"}, "T96752"),
                 ({"property": "use_extended_asset_browser"}, ("project/view/130/", "Project Page")),
                 ({"property": "use_override_templates"}, ("T73318", "Milestone 4")),
                 ({"property": "use_named_attribute_nodes"}, ("T91742")),
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 6ae9b463cfb..30282df8026 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -2142,7 +2142,9 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
            * doesn't have a bone selection, otherwise selecting sub-elements is difficult. */
           ((buffer[hit_index].id & 0xFFFF0000) == 0) &&
           /* Only exclude active object when it is selected. */
-          (BASACT(view_layer) && (BASACT(view_layer)->flag & BASE_SELECTED))) {
+          (BASACT(view_layer) && (BASACT(view_layer)->flag & BASE_SELECTED)) &&
+          /* Allow disabling this behavior entirely. */
+          (U.experimental.use_select_nearest_on_first_click == false)) {
 
         const int select_id_active = BASACT(view_layer)->object->runtime.select_id;
 
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 4dee89db274..5fb8d0328f1 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -650,8 +650,9 @@ typedef struct UserDef_Experimental {
   char use_extended_asset_browser;
   char use_override_templates;
   char use_named_attribute_nodes;
+  char use_select_nearest_on_first_click;
   char enable_eevee_next;
-  char _pad[1];
+  // char _pad[0];
   /** `makesdna` does not allow empty structs. */
 } UserDef_Experimental;
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index a02feb44aaa..03f512b5528 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6439,6 +6439,12 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
                            "Named Attribute Nodes",
                            "Enable named attribute nodes in the geometry nodes add menu");
 
+  prop = RNA_def_property(srna, "use_select_nearest_on_first_click", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "use_select_nearest_on_first_click", 1);
+  RNA_def_property_ui_text(prop,
+                           "Object Select Nearest on First Click",
+                           "When enabled, always select the front-most object on the first click");
+
   prop = RNA_def_property(srna, "enable_eevee_next", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "enable_eevee_next", 1);
   RNA_def_property_ui_text(prop, "EEVEE Next", "Enable the new EEVEE codebase, requires restart");



More information about the Bf-blender-cvs mailing list