Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-27 20:02:03 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-27 20:02:03 +0400
commit2b080dbc4ee17d3562e74637d23d12e429e8c309 (patch)
tree5d45d5a7c5168ea0e822ebc2531e35ec90d64634 /source/blender
parent21db9ac0f49dc23ed300db8133f2467e6f88767d (diff)
Fix part of #32248: transform with a size limit constraint did not preserve negative scale.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 7fbfe8fc719..6145fec7e51 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2427,6 +2427,8 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
bConstraintTypeInfo *cti = get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
bConstraintOb cob = {NULL};
bConstraint *con;
+ float size_sign[3], size_abs[3];
+ int i;
/* Make a temporary bConstraintOb for using these limit constraints
* - they only care that cob->matrix is correctly set ;-)
@@ -2440,8 +2442,14 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
/* Reset val if SINGLESIZE but using a constraint */
if (td->flag & TD_SINGLESIZE)
return;
+
+ /* separate out sign to apply back later */
+ for (i = 0; i < 3; i++) {
+ size_sign[i] = signf(td->ext->size[i]);
+ size_abs[i] = fabsf(td->ext->size[i]);
+ }
- size_to_mat4(cob.matrix, td->ext->size);
+ size_to_mat4(cob.matrix, size_abs);
}
/* Evaluate valid constraints */
@@ -2489,7 +2497,9 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
if (td->flag & TD_SINGLESIZE)
return;
+ /* extrace scale from matrix and apply back sign */
mat4_to_size(td->ext->size, cob.matrix);
+ mul_v3_v3(td->ext->size, size_sign);
}
}
}