[Bf-blender-cvs] [854af0cd09f] master: Cleanup/Refactor: remove unused 'SNAP_ONLY_ACTIVE' enum parameter

Germano Cavalcante noreply at git.blender.org
Mon Mar 28 19:23:31 CEST 2022


Commit: 854af0cd09f194fadb688e899916cdc91e931623
Author: Germano Cavalcante
Date:   Mon Mar 28 13:49:31 2022 -0300
Branches: master
https://developer.blender.org/rB854af0cd09f194fadb688e899916cdc91e931623

Cleanup/Refactor: remove unused 'SNAP_ONLY_ACTIVE' enum parameter

`SNAP_ONLY_ACTIVE` was implemented in order to be used in the Knife tool,
but the project did not go ahead.

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

M	source/blender/editors/include/ED_transform_snap_object_context.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/space_view3d/view3d_cursor_snap.c
M	source/blender/editors/transform/transform_snap_object.c

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

diff --git a/source/blender/editors/include/ED_transform_snap_object_context.h b/source/blender/editors/include/ED_transform_snap_object_context.h
index 16ec1221eea..a8a11cd7dda 100644
--- a/source/blender/editors/include/ED_transform_snap_object_context.h
+++ b/source/blender/editors/include/ED_transform_snap_object_context.h
@@ -30,8 +30,7 @@ typedef enum {
   SNAP_NOT_SELECTED = 1,
   SNAP_NOT_ACTIVE = 2,
   SNAP_NOT_EDITED = 3,
-  SNAP_ONLY_ACTIVE = 4,
-  SNAP_SELECTABLE = 5,
+  SNAP_SELECTABLE = 4,
 } eSnapSelect;
 
 typedef enum {
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index d2ff5637a13..53591e02f71 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -273,9 +273,8 @@ typedef enum {
   V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE = 1 << 0,
   V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE = 1 << 1,
   V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE = 1 << 2, /* TODO. */
-  V3D_SNAPCURSOR_SNAP_ONLY_ACTIVE = 1 << 3,
-  V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL = 1 << 4,
-  V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE = 1 << 5,
+  V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL = 1 << 3,
+  V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE = 1 << 4,
 } eV3DSnapCursor;
 
 typedef enum {
diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.c b/source/blender/editors/space_view3d/view3d_cursor_snap.c
index 53f7b3d5871..f3e45a14565 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -620,9 +620,6 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
       snap_elements &= ~SCE_SNAP_MODE_EDGE_PERPENDICULAR;
     }
 
-    eSnapSelect snap_select = (state->flag & V3D_SNAPCURSOR_SNAP_ONLY_ACTIVE) ? SNAP_ONLY_ACTIVE :
-                                                                                SNAP_ALL;
-
     eSnapEditType edit_mode_type = (state->flag & V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL) ?
                                        SNAP_GEOM_FINAL :
                                    (state->flag & V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE) ?
@@ -640,7 +637,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
         v3d,
         snap_elements,
         &(const struct SnapObjectParams){
-            .snap_select = snap_select,
+            .snap_select = SNAP_ALL,
             .edit_mode_type = edit_mode_type,
             .use_occlusion_test = use_occlusion_test,
         },
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index cb06361a62d..329c5104136 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -494,12 +494,6 @@ static void iter_snap_objects(SnapObjectContext *sctx,
   const eSnapSelect snap_select = params->snap_select;
 
   Base *base_act = view_layer->basact;
-  if (snap_select == SNAP_ONLY_ACTIVE) {
-    Object *obj_eval = DEG_get_evaluated_object(sctx->runtime.depsgraph, base_act->object);
-    sob_callback(sctx, params, obj_eval, obj_eval->obmat, true, data);
-    return;
-  }
-
   const bool is_in_object_mode = !base_act || base_act->object->mode == OB_MODE_OBJECT;
   for (Base *base = view_layer->object_bases.first; base != NULL; base = base->next) {
     if (!snap_object_is_snappable(sctx, snap_select, base_act, base, is_in_object_mode)) {



More information about the Bf-blender-cvs mailing list