[Bf-blender-cvs] [f0ebf696cbb] master: Fix T101964: Edge and face snapping no locking to axis

Germano Cavalcante noreply at git.blender.org
Fri Oct 21 14:55:27 CEST 2022


Commit: f0ebf696cbbb521f956c5b612037f4d11e87cb0d
Author: Germano Cavalcante
Date:   Fri Oct 21 09:52:53 2022 -0300
Branches: master
https://developer.blender.org/rBf0ebf696cbbb521f956c5b612037f4d11e87cb0d

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.

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

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

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

diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index fa56456d8e7..7abf0e5c00c 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -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);
           }
         }
       }



More information about the Bf-blender-cvs mailing list