Fix T96812: Regression: Snapping is broken with proportional editing

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

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

Thanks to @Ethan1080 for pointing out the error.
This commit is contained in:
Germano Cavalcante 2022-03-28 11:26:48 -03:00
parent e6dfe570cc
commit 2e99295d5e
Notes: blender-bot 2023-02-14 02:27:56 +01:00
Referenced by issue #96812, Regression: Snapping is broken with proportional editing
Referenced by issue #96241, 3.1: Potential candidates for corrective releases
3 changed files with 9 additions and 4 deletions

View File

@ -29,8 +29,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 {

View File

@ -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;

View File

@ -459,7 +459,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) {