[Bf-blender-cvs] [eee81532991] blender2.8: Gizmo: depth sort shear gizmos

Campbell Barton noreply at git.blender.org
Thu Oct 18 03:06:28 CEST 2018


Commit: eee8153299174cdb445e341339a2153ffab87333
Author: Campbell Barton
Date:   Thu Oct 18 11:41:07 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBeee8153299174cdb445e341339a2153ffab87333

Gizmo: depth sort shear gizmos

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

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

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

diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index b9c984f7f21..bf9f09abf3a 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -2035,8 +2035,9 @@ static void WIDGETGROUP_xform_shear_setup(const bContext *UNUSED(C), wmGizmoGrou
 		for (int j = 0; j < 2; j++) {
 			wmGizmo *gz = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
 			RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_BOX);
-			const int i_ortho = (i + j + 1) % 3;
-			interp_v3_v3v3(gz->color, axis_color[i], axis_color[i_ortho], 0.33f);
+			const int i_ortho_a = (i + j + 1) % 3;
+			const int i_ortho_b = (i + (1 - j) + 1) % 3;
+			interp_v3_v3v3(gz->color, axis_color[i_ortho_a], axis_color[i_ortho_b], 0.75f);
 			gz->color[3] = 0.5f;
 			PointerRNA *ptr = WM_gizmo_operator_set(gz, 0, ot_shear, NULL);
 			RNA_boolean_set(ptr, "release_confirm", 1);
@@ -2132,6 +2133,14 @@ static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup
 			}
 		}
 	}
+
+	/* Basic ordering for drawing only. */
+	{
+		LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
+			gz->temp.f = dot_v3v3(rv3d->viewinv[2], gz->matrix_basis[2]);
+		}
+		BLI_listbase_sort(&gzgroup->gizmos, WM_gizmo_cmp_temp_fl_reverse);
+	}
 }
 
 void VIEW3D_GGT_xform_shear(wmGizmoGroupType *gzgt)



More information about the Bf-blender-cvs mailing list