[Bf-blender-cvs] [87310c0af16] blender-v2.91-release: Fix T83092: Direction of rotation with View orientation changed in 2.91

Germano Cavalcante noreply at git.blender.org
Wed Jan 13 15:08:44 CET 2021


Commit: 87310c0af164db5b7f3de33cf8612c4f490b112d
Author: Germano Cavalcante
Date:   Fri Nov 27 10:41:33 2020 -0300
Branches: blender-v2.91-release
https://developer.blender.org/rB87310c0af164db5b7f3de33cf8612c4f490b112d

Fix T83092: Direction of rotation with View orientation changed in 2.91

The change was intentional so that the orientation matrices match
(`rv3d->viewinv` becomes equal to the orientation matrix).

But, although in a projection matrix the Z axis is negative, this
should not be so from the user's point of view.

So the solution here is to negate the Z axis when the View orientation
is chosen.

This affects all modes, but is only evident for rotation.

---
Another change here is to use the final rotation value (`values_final`)
for the gizmo drawing since this value can be changed by the mode.

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

M	source/blender/editors/transform/transform_gizmo_3d.c
M	source/blender/editors/transform/transform_mode_shear.c
M	source/blender/editors/transform/transform_orientations.c

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

diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index a22f6c35139..b51335c71ed 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -1304,7 +1304,7 @@ void drawDial3d(const TransInfo *t)
     }
     else {
       axis_idx = MAN_AXIS_ROT_C;
-      copy_v3_v3(mat_basis[2], t->spacemtx[t->orient_axis]);
+      negate_v3_v3(mat_basis[2], t->spacemtx[t->orient_axis]);
       scale *= 1.2f;
       line_with -= 1.0f;
     }
@@ -1352,7 +1352,7 @@ void drawDial3d(const TransInfo *t)
                                     false,
                                     &(struct Dial3dParams){
                                         .draw_options = ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE,
-                                        .angle_delta = t->values[0],
+                                        .angle_delta = t->values_final[0],
                                         .angle_increment = increment,
                                     });
 
diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c
index dfc6f69b341..067a309ede8 100644
--- a/source/blender/editors/transform/transform_mode_shear.c
+++ b/source/blender/editors/transform/transform_mode_shear.c
@@ -58,12 +58,12 @@ static void initShear_mouseInputMode(TransInfo *t)
   /* Needed for axis aligned view gizmo. */
   if (t->orient[t->orient_curr].type == V3D_ORIENT_VIEW) {
     if (t->orient_axis_ortho == 0) {
-      if (t->center2d[1] > t->mouse.imval[1]) {
+      if (t->center2d[1] < t->mouse.imval[1]) {
         dir_flip = !dir_flip;
       }
     }
     else if (t->orient_axis_ortho == 1) {
-      if (t->center2d[0] > t->mouse.imval[0]) {
+      if (t->center2d[0] < t->mouse.imval[0]) {
         dir_flip = !dir_flip;
       }
     }
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index b353dba9e54..031cff72095 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -552,6 +552,7 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C,
       if (rv3d != NULL) {
         copy_m3_m4(r_mat, rv3d->viewinv);
         normalize_m3(r_mat);
+        negate_v3(r_mat[2]);
       }
       else {
         unit_m3(r_mat);



More information about the Bf-blender-cvs mailing list