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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-08-05 16:42:48 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-08-05 16:47:28 +0300
commit58229b191a177ec0192786df005c9b586991c43a (patch)
treec82f80116a270f045d31f366ca7351473e577a42
parent8f1a55831c893b664f8648eac029b9d9d5aa746d (diff)
Fix T68145: Bone Rotate Individual Axes fail.
Rotation matrix would not get updated every time it would need to, after own changes to handle 'big' rotations from keyboard input (rBcee484a4c51a3d2).
-rw-r--r--source/blender/editors/transform/transform.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 973c1c0b7f7..9723e640259 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -4607,6 +4607,10 @@ static void applyRotationValue(TransInfo *t,
}
axis_angle_normalized_to_mat3(mat, axis, angle);
+ /* Counter for needed updates (when we need to update to non-default matrix,
+ * we also need another update on next iteration to go back to default matrix,
+ * hence the '2' value used here, instead of a mere boolean). */
+ short do_update_matrix = 0;
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
TransData *td = tc->data;
@@ -4623,6 +4627,9 @@ static void applyRotationValue(TransInfo *t,
if (t->con.applyRot) {
t->con.applyRot(t, tc, td, axis, NULL);
angle_final = angle * td->factor;
+ /* Even though final angle might be identical to orig value,
+ * we have to update the rotation matrix in that case... */
+ do_update_matrix = 2;
}
else if (t->flag & T_PROP_EDIT) {
angle_final = angle * td->factor;
@@ -4645,11 +4652,17 @@ static void applyRotationValue(TransInfo *t,
axis_angle_normalized_to_mat3(mat, axis, angle_progress);
ElementRotation(t, tc, td, mat, t->around);
}
- axis_angle_normalized_to_mat3(mat, axis, angle_final);
+ do_update_matrix = 2;
}
else if (angle_final != angle) {
+ do_update_matrix = 2;
+ }
+
+ if (do_update_matrix > 0) {
axis_angle_normalized_to_mat3(mat, axis, angle_final);
+ do_update_matrix--;
}
+
ElementRotation(t, tc, td, mat, t->around);
}
}