[Bf-blender-cvs] [28e7c94de26] blender2.8: Gizmo: minor fix for navigation axis color

Campbell Barton noreply at git.blender.org
Wed Nov 14 22:19:14 CET 2018


Commit: 28e7c94de26a4706af16d6f2893917ca910a27ce
Author: Campbell Barton
Date:   Thu Nov 15 08:17:16 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB28e7c94de26a4706af16d6f2893917ca910a27ce

Gizmo: minor fix for navigation axis color

When view aligned, the near axis was hidden,
making it seem as if the opposite axis was at the front.

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

M	source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c

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

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index c32a8f46182..422f6e07c68 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -341,13 +341,18 @@ static void axis_geom_draw(
 
 			/* Axis Ball. */
 			{
+				/* Flip the faded state when axis aligned, since we're hiding the front-mode axis
+				 * otherwise we see the color for the back-most axis, which is useful for
+				 * click-to-rotate 180d but not useful to visualize. */
+				const bool is_pos_color = is_pos == (axis_align != axis);
+
 				GPU_matrix_push();
 				GPU_matrix_translate_3fv(v_final);
 				GPU_matrix_scale_1f(show_axis_char ? AXIS_HANDLE_SIZE_FG : AXIS_HANDLE_SIZE_BG);
 
 				GPUBatch *sphere = GPU_batch_preset_sphere(0);
 				GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
-				GPU_batch_uniform_4fv(sphere, "color", is_pos ? color_current : color_current_fade);
+				GPU_batch_uniform_4fv(sphere, "color", is_pos_color ? color_current : color_current_fade);
 				GPU_batch_draw(sphere);
 				GPU_matrix_pop();
 			}



More information about the Bf-blender-cvs mailing list