[Bf-blender-cvs] [962e221cd32] blender-v3.4-release: Fix T102720: Snapping in 3dViewport affects Graph, Action and NLA editors

Germano Cavalcante noreply at git.blender.org
Wed Nov 23 18:06:54 CET 2022


Commit: 962e221cd32cfad7759eb7f0485799dce2f57424
Author: Germano Cavalcante
Date:   Wed Nov 23 14:06:21 2022 -0300
Branches: blender-v3.4-release
https://developer.blender.org/rB962e221cd32cfad7759eb7f0485799dce2f57424

Fix T102720: Snapping in 3dViewport affects Graph, Action and NLA editors

These editors have their own "Auto-Snap" activation option.

So ignore the option in the 3D View in these cases.

The generic incremental snap function doesn't seem really useful in these cases.

If an incremental snap needs to be implemented, this should be a new option of `eAnimEdit_AutoSnap`.

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

M	source/blender/editors/transform/transform_snap.c

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

diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 11cb57dc911..4a26a736351 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -609,16 +609,26 @@ static bool bm_face_is_snap_target(BMFace *f, void *UNUSED(user_data))
 static eSnapFlag snap_flag_from_spacetype(TransInfo *t)
 {
   ToolSettings *ts = t->settings;
-  if (t->spacetype == SPACE_NODE) {
-    return ts->snap_flag_node;
-  }
-  if (t->spacetype == SPACE_IMAGE) {
-    return ts->snap_uv_flag;
-  }
-  if (t->spacetype == SPACE_SEQ) {
-    return ts->snap_flag_seq;
+  switch (t->spacetype) {
+    case SPACE_VIEW3D:
+      return ts->snap_flag;
+    case SPACE_NODE:
+      return ts->snap_flag_node;
+    case SPACE_IMAGE:
+      return ts->snap_uv_flag;
+    case SPACE_SEQ:
+      return ts->snap_flag_seq;
+    case SPACE_GRAPH:
+    case SPACE_ACTION:
+    case SPACE_NLA:
+      /* These editors have their own "Auto-Snap" activation option.
+       * See #getAnimEdit_SnapMode. */
+      return 0;
+    default:
+      BLI_assert(false);
+      break;
   }
-  return ts->snap_flag;
+  return 0;
 }
 
 static eSnapMode snap_mode_from_spacetype(TransInfo *t)



More information about the Bf-blender-cvs mailing list