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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-01-31 16:21:05 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-01-31 16:26:36 +0300
commita80c0ee16784a7338a041474fed3f609bb59fa14 (patch)
tree66e2953f469a61902e05f71a02930b0078234c59 /source/blender/editors/transform
parent194f6c7880c85aea8656d48119bfa3c271a57d33 (diff)
Revert "Cleanup: remove unused argument"
This reverts commit 780857f8e8139613711cba041f5f0af9799804ec. The `axismtx` argument was supposed to be used.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_constraints.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index b6383cce79c..3d80894c1e0 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -537,7 +537,10 @@ static void applyObjectConstraintSize(TransInfo *t,
}
}
-static void constraints_rotation_imp(TransInfo *t, float r_vec[3], float *r_angle)
+static void constraints_rotation_imp(TransInfo *t,
+ float axismtx[3][3],
+ float r_vec[3],
+ float *r_angle)
{
BLI_assert(t->con.mode & CON_APPLY);
int mode = t->con.mode & (CON_AXIS0 | CON_AXIS1 | CON_AXIS2);
@@ -581,7 +584,7 @@ static void applyAxisConstraintRot(
TransInfo *t, TransDataContainer *UNUSED(tc), TransData *td, float vec[3], float *angle)
{
if (!td && t->con.mode & CON_APPLY) {
- constraints_rotation_imp(t, vec, angle);
+ constraints_rotation_imp(t, t->spacemtx, vec, angle);
}
}
@@ -602,13 +605,25 @@ static void applyObjectConstraintRot(
TransInfo *t, TransDataContainer *tc, TransData *td, float vec[3], float *angle)
{
if (t->con.mode & CON_APPLY) {
+ float tmp_axismtx[3][3];
+ float(*axismtx)[3];
+
/* on setup call, use first object */
if (td == NULL) {
BLI_assert(tc == NULL);
tc = TRANS_DATA_CONTAINER_FIRST_OK(t);
td = tc->data;
}
- constraints_rotation_imp(t, vec, angle);
+
+ if (t->flag & T_EDIT) {
+ mul_m3_m3m3(tmp_axismtx, tc->mat3_unit, td->axismtx);
+ axismtx = tmp_axismtx;
+ }
+ else {
+ axismtx = td->axismtx;
+ }
+
+ constraints_rotation_imp(t, axismtx, vec, angle);
}
}