[Bf-blender-cvs] [41b45d9159f] master: Fix T76260: Inverted rotation in non-3d views

Germano Cavalcante noreply at git.blender.org
Thu Apr 30 13:52:57 CEST 2020


Commit: 41b45d9159fcb349c5b98e8af57cb1e5318616e8
Author: Germano Cavalcante
Date:   Thu Apr 30 08:38:18 2020 -0300
Branches: master
https://developer.blender.org/rB41b45d9159fcb349c5b98e8af57cb1e5318616e8

Fix T76260: Inverted rotation in non-3d views

Issue introduced in rBc57e4418bb85.

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

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

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

diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 4e34c469258..3b1f3559daa 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -476,20 +476,20 @@ void initTransformOrientation(bContext *C, TransInfo *t, short orientation)
 
       break;
 
-    case V3D_ORIENT_VIEW:
+    case V3D_ORIENT_VIEW: {
+      float mat[3][3];
       if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) {
-        float mat[3][3];
-
         BLI_strncpy(t->spacename, TIP_("view"), sizeof(t->spacename));
         copy_m3_m4(mat, t->viewinv);
         normalize_m3(mat);
-        negate_v3(mat[2]);
-        copy_m3_m3(t->spacemtx, mat);
       }
       else {
-        unit_m3(t->spacemtx);
+        unit_m3(mat);
       }
+      negate_v3(mat[2]);
+      copy_m3_m3(t->spacemtx, mat);
       break;
+    }
     case V3D_ORIENT_CURSOR: {
       BLI_strncpy(t->spacename, TIP_("cursor"), sizeof(t->spacename));
       BKE_scene_cursor_rot_to_mat3(&t->scene->cursor, t->spacemtx);



More information about the Bf-blender-cvs mailing list