Workbench: StudioLight: Fix worldspace rotation
authorClément Foucault <foucault.clem@gmail.com>
Fri, 30 Nov 2018 01:02:21 +0000 (02:02 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 30 Nov 2018 01:02:36 +0000 (02:02 +0100)
source/blender/draw/engines/workbench/workbench_studiolight.c

index f0a166105ab6e6be2e841df4fbcec9ecece14f35..7b348cfd8ec8c50a5a83a891eacaffe4493ebdc6 100644 (file)
@@ -38,8 +38,8 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd, StudioLight *studiolig
        DRW_viewport_matrix_get(view_matrix, DRW_MAT_VIEW);
 
        if (USE_WORLD_ORIENTATION(wpd)) {
-               axis_angle_to_mat4_single(rot_matrix, 'Y', -wpd->shading.studiolight_rot_z);
-               mul_m4_m4m4(rot_matrix, rot_matrix, view_matrix);
+               axis_angle_to_mat4_single(rot_matrix, 'Z', -wpd->shading.studiolight_rot_z);
+               mul_m4_m4m4(rot_matrix, view_matrix, rot_matrix);
                swap_v3_v3(rot_matrix[2], rot_matrix[1]);
                negate_v3(rot_matrix[2]);
        }