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>2020-09-25 01:16:41 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-09-25 16:24:05 +0300
commit388b9162469650c7b0523c2fb9c88bbe2dee1567 (patch)
tree0aedf3c08117091d6092b3a630deb5e0df22b34e /source/blender/editors/transform/transform_mode_rotate.c
parentd5a6b3b18c5d6c751b6b0091453d836313dbcde1 (diff)
Fix T80937: Changing the contrain axis does not return to the scene orientation
This was the behavior in old versions of blender. During a transformation operation, when pressing a contrain key, the chosen orientation is that of the scene. If you press the same key, the orientation changes to Global or Local. However, if you choose another contrain axis with the orientation changed, the orientation does not return to the set for the scene. It remains Global or Local. Now when changing a contrain axis, no matter what the current orientation is, it always returns to the scene orientation.
Diffstat (limited to 'source/blender/editors/transform/transform_mode_rotate.c')
-rw-r--r--source/blender/editors/transform/transform_mode_rotate.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c
index c0ddd4eb2a6..37b68877b08 100644
--- a/source/blender/editors/transform/transform_mode_rotate.c
+++ b/source/blender/editors/transform/transform_mode_rotate.c
@@ -195,28 +195,30 @@ static void applyRotationValue(TransInfo *t,
static void applyRotation(TransInfo *t, const int UNUSED(mval[2]))
{
char str[UI_MAX_DRAW_STR];
-
- float final;
-
- final = t->values[0];
-
- transform_snap_increment(t, &final);
-
float axis_final[3];
- /* Use the negative axis to match the default Z axis of the view matrix. */
- negate_v3_v3(axis_final, t->spacemtx[t->orient_axis]);
+ float final = t->values[0];
if ((t->con.mode & CON_APPLY) && t->con.applyRot) {
t->con.applyRot(t, NULL, NULL, axis_final, NULL);
}
-
- applySnapping(t, &final);
+ else {
+ copy_v3_v3(axis_final, t->spacemtx[t->orient_axis]);
+ if (!(t->flag & T_INPUT_IS_VALUES_FINAL) && (dot_v3v3(axis_final, t->viewinv[2]) > 0.0f)) {
+ /* The input is obtained according to the position of the mouse.
+ * Flip to better match the movement. */
+ final *= -1;
+ }
+ }
if (applyNumInput(&t->num, &final)) {
/* We have to limit the amount of turns to a reasonable number here,
* to avoid things getting *very* slow, see how applyRotationValue() handles those... */
final = large_rotation_limit(final);
}
+ else {
+ transform_snap_increment(t, &final);
+ applySnapping(t, &final);
+ }
t->values_final[0] = final;