[Bf-blender-cvs] [c33870ab14c] blender-v3.1-release: Fix T96812: Regression: Snapping is broken with proportional editing

Germano Cavalcante noreply at git.blender.org
Mon Mar 28 16:53:51 CEST 2022


Commit: c33870ab14c305d3bb4e2bac6d664f6e83a94653
Author: Germano Cavalcante
Date:   Mon Mar 28 11:26:48 2022 -0300
Branches: blender-v3.1-release
https://developer.blender.org/rBc33870ab14c305d3bb4e2bac6d664f6e83a94653

Fix T96812: Regression: Snapping is broken with proportional editing

This was a mistake in the conditional structure introduced in 4b35d6950d4f

This commit also adds a new type of snap exclusion: `SNAP_NOT_EDITED`.

Thanks to @Ethan1080 for pointing out the error.

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

M	source/blender/editors/include/ED_transform_snap_object_context.h
M	source/blender/editors/transform/transform_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 fd65d8f3663..bd96dd3930e 100644
--- a/source/blender/editors/include/ED_transform_snap_object_context.h
+++ b/source/blender/editors/include/ED_transform_snap_object_context.h
@@ -43,8 +43,9 @@ typedef enum {
   SNAP_ALL = 0,
   SNAP_NOT_SELECTED = 1,
   SNAP_NOT_ACTIVE = 2,
-  SNAP_ONLY_ACTIVE = 3,
-  SNAP_SELECTABLE = 4,
+  SNAP_NOT_EDITED = 3,
+  SNAP_ONLY_ACTIVE = 4,
+  SNAP_SELECTABLE = 5,
 } eSnapSelect;
 
 typedef enum {
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index dd18e8d4656..64679f72e04 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -639,7 +639,7 @@ static short snap_select_type_get(TransInfo *t)
 
       if ((obedit_type == OB_MESH) && (t->flag & T_PROP_EDIT)) {
         /* Exclude editmesh if using proportional edit */
-        r_snap_select = SNAP_NOT_ACTIVE;
+        r_snap_select = SNAP_NOT_EDITED;
       }
       else if (!t->tsnap.snap_self) {
         r_snap_select = SNAP_NOT_ACTIVE;
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 0f5e4707db0..994ec666075 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -473,7 +473,11 @@ static bool snap_object_is_snappable(const SnapObjectContext *sctx,
   }
 
   if (snap_select == SNAP_NOT_ACTIVE) {
-    return base_act == base;
+    return base_act != base;
+  }
+
+  if (snap_select == SNAP_NOT_EDITED) {
+    return base->object->mode != OB_MODE_EDIT;
   }
 
   if (snap_select == SNAP_NOT_SELECTED) {



More information about the Bf-blender-cvs mailing list