Fix T101964: Edge and face snapping no locking to axis

In rBed6c8d82b804 it was wrongly assumed that the constraint functions
always apply the transformations.

But that is not the case for when axes are aligned.

The `mul_m3_v3(t->con.pmtx, out)` fallback is still required.
This commit is contained in:
Germano Cavalcante 2022-10-21 09:52:53 -03:00
parent 899d4ddbd0
commit f0ebf696cb
Notes: blender-bot 2023-02-13 14:12:07 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101964, Regression: Edge snapping and face project snapping no longer locks to axis
1 changed files with 6 additions and 9 deletions

View File

@ -404,9 +404,11 @@ static void applyAxisConstraintVec(const TransInfo *t,
}
}
/* Fallback for when axes are aligned. */
mul_m3_v3(t->con.pmtx, out);
if (is_snap_to_point) {
/* With snap points, a projection is alright, no adjustments needed. */
mul_m3_v3(t->con.pmtx, out);
/* Pass. With snap points, a projection is alright, no adjustments needed. */
}
else {
const int dims = getConstraintSpaceDimension(t);
@ -422,14 +424,9 @@ static void applyAxisConstraintVec(const TransInfo *t,
/* Disabled, as it has not proven to be really useful. (See T82386). */
// constraint_snap_plane_to_face(t, plane, out);
}
else {
else if (!isPlaneProjectionViewAligned(t, plane)) {
/* View alignment correction. */
if (!isPlaneProjectionViewAligned(t, plane)) {
planeProjection(t, plane, in, out);
}
else {
mul_m3_v3(t->con.pmtx, out);
}
planeProjection(t, plane, in, out);
}
}
}