[Bf-blender-cvs] [d00f54e574c] master: Transform: redo resize now constrains axis values

Campbell Barton noreply at git.blender.org
Thu Feb 21 22:58:03 CET 2019


Commit: d00f54e574ccb6c580109ba865ce2e9511510a5e
Author: Campbell Barton
Date:   Fri Feb 22 08:42:08 2019 +1100
Branches: master
https://developer.blender.org/rBd00f54e574ccb6c580109ba865ce2e9511510a5e

Transform: redo resize now constrains axis values

Before 1bfbfa281046b this wasn't essential because the constraints
prevented the axes from being applied.

Now redo ignores constraints - the input values must be constrained.

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

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

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

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index cddd25252a4..e4967e172eb 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -3824,9 +3824,15 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2]))
 	}
 
 	size_to_mat3(mat, t->values);
-
-	if (t->con.applySize) {
+	if (t->con.mode & CON_APPLY) {
 		t->con.applySize(t, NULL, NULL, mat);
+
+		/* Only so we have re-usable value with redo. */
+		for (i = 0; i < 3; i++) {
+			if (!(t->con.mode & (CON_AXIS0 << i))) {
+				t->values[i] = 1.0f;
+			}
+		}
 	}
 
 	copy_m3_m3(t->mat, mat);    // used in gizmo
@@ -3850,8 +3856,9 @@ static void applyResize(TransInfo *t, const int UNUSED(mval[2]))
 	if (t->flag & T_CLIP_UV && clipUVTransform(t, t->values, 1)) {
 		size_to_mat3(mat, t->values);
 
-		if (t->con.applySize)
+		if (t->con.mode & CON_APPLY) {
 			t->con.applySize(t, NULL, NULL, mat);
+		}
 
 
 		FOREACH_TRANS_DATA_CONTAINER (t, tc) {



More information about the Bf-blender-cvs mailing list