[Bf-blender-cvs] [b1908f2e0b2] master: View 3D: disable object mode selection cycling on first-click

Campbell Barton noreply at git.blender.org
Thu Apr 14 09:21:28 CEST 2022


Commit: b1908f2e0b23988627772f6a6d968d8351dca6d7
Author: Campbell Barton
Date:   Thu Apr 14 17:15:07 2022 +1000
Branches: master
https://developer.blender.org/rBb1908f2e0b23988627772f6a6d968d8351dca6d7

View 3D: disable object mode selection cycling on first-click

Unlike regular selection cycling that is activated when clicking again
in the same location, object mode would cycle to another object
if the object that was selected happened to already be active.

This made it impossible to click-drag to tweak the active object
if there were other objects behind it as those would be activated first.

Resolves T96752.

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

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 035c4fd1352..b954d726ca3 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2281,7 +2281,8 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
             ),
         )
 
-
+# Keep this as tweaks can be useful to restore.
+"""
 class USERPREF_PT_experimental_tweaks(ExperimentalPanel, Panel):
     bl_label = "Tweaks"
 
@@ -2292,6 +2293,7 @@ class USERPREF_PT_experimental_tweaks(ExperimentalPanel, Panel):
             ),
         )
 
+"""
 
 class USERPREF_PT_experimental_debugging(ExperimentalPanel, Panel):
     bl_label = "Debugging"
@@ -2413,7 +2415,7 @@ classes = (
 
     USERPREF_PT_experimental_new_features,
     USERPREF_PT_experimental_prototypes,
-    USERPREF_PT_experimental_tweaks,
+    # USERPREF_PT_experimental_tweaks,
     USERPREF_PT_experimental_debugging,
 
     # Add dynamically generated editor theme panels last,
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 520d234e261..03862c6bdff 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -2125,49 +2125,6 @@ static Base *mouse_select_eval_buffer(ViewContext *vc,
           hit_index = a;
         }
       }
-
-      /* Find the best active & non-active hits.
-       * NOTE(@campbellbarton): Checking if `hits > 1` isn't a reliable way to know
-       * if there are multiple objects selected since it's possible the same object
-       * generates multiple hits, either from:
-       * - Multiple sub-components (bones & camera tracks).
-       * - Multiple selectable elements such as the object center and the geometry.
-       *
-       * For this reason, keep track of the best hit as well as the best hit that
-       * excludes the selected & active object, using this value when it's valid. */
-      if ((hit_index != -1) &&
-          /* Special case, cycling away from the active object should only be done when it
-           * 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)) &&
-          /* 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;
-
-        /* Check if `hit_index` is the current active object. */
-        if ((buffer[hit_index].id & 0xFFFF) == select_id_active) {
-          uint min_not_active = 0xFFFFFFFF;
-          int hit_index_not_active = -1;
-          for (a = 0; a < hits; a++) {
-            /* Any object other than the active-selected. */
-            if (select_id_active == (buffer[a].id & 0xFFFF)) {
-              continue;
-            }
-            if (min_not_active > buffer[a].depth) {
-              min_not_active = buffer[a].depth;
-              hit_index_not_active = a;
-            }
-          }
-
-          /* When the active was selected, first try to use the index
-           * for the best non-active hit that was found. */
-          if (hit_index_not_active != -1) {
-            hit_index = hit_index_not_active;
-          }
-        }
-      }
     }
 
     if (hit_index != -1) {
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 0f6c32e4ddf..619f4c05875 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -649,9 +649,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 use_sculpt_texture_paint;
+  char _pad0[1];
   /** `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 cf622818a3d..8c86e44aebf 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6440,12 +6440,6 @@ 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