[Bf-blender-cvs] [7f7de6051aa] greasepencil-refactor: GPencil: Hide Guide tools for other modes

Antonio Vazquez noreply at git.blender.org
Thu Jan 9 18:11:03 CET 2020


Commit: 7f7de6051aacf14be86b879b46b64ce7a7d9f734
Author: Antonio Vazquez
Date:   Thu Jan 9 18:10:52 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB7f7de6051aacf14be86b879b46b64ce7a7d9f734

GPencil: Hide Guide tools for other modes

Still pending hide the guide if using a tool not related.

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

M	source/blender/draw/engines/overlay/overlay_gpencil.c

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

diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.c b/source/blender/draw/engines/overlay/overlay_gpencil.c
index ae8e4aa65ac..ab220a9d0b3 100644
--- a/source/blender/draw/engines/overlay/overlay_gpencil.c
+++ b/source/blender/draw/engines/overlay/overlay_gpencil.c
@@ -129,7 +129,14 @@ void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata)
     }
   }
 
-  if (gpd->runtime.cp_points || ts->gp_sculpt.guide.use_guide) {
+  /* control points for primitives and speed guide */
+  const bool is_cppoint = (gpd->runtime.tot_cp_points > 0);
+  const bool is_speed_guide = (ts->gp_sculpt.guide.use_guide &&
+                               (draw_ctx->object_mode == OB_MODE_PAINT_GPENCIL));
+  const bool is_show_gizmo = (((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) &&
+                              ((v3d->gizmo_flag & V3D_GIZMO_HIDE_TOOL) == 0));
+
+  if ((is_cppoint || is_speed_guide) && (is_show_gizmo)) {
     DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_ALPHA;
     DRW_PASS_CREATE(psl->edit_gpencil_gizmos_ps, state);



More information about the Bf-blender-cvs mailing list