[Bf-blender-cvs] [882ffe6a2e6] greasepencil-edit-curve: GPencil: Hide curve points when the curve in unselected

Antonio Vazquez noreply at git.blender.org
Sat Jun 20 11:57:59 CEST 2020


Commit: 882ffe6a2e63978a7ad31fe4295d3a18d2632fec
Author: Antonio Vazquez
Date:   Sat Jun 20 11:57:50 2020 +0200
Branches: greasepencil-edit-curve
https://developer.blender.org/rB882ffe6a2e63978a7ad31fe4295d3a18d2632fec

GPencil: Hide curve points when the curve in unselected

The points are displayed only if the stroke is selected or if the stroke is unselected but the Handles display mode is ALL.

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

M	source/blender/draw/intern/draw_cache_impl_gpencil.c

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

diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c
index 42f82d3f141..599e0b6a3af 100644
--- a/source/blender/draw/intern/draw_cache_impl_gpencil.c
+++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c
@@ -774,13 +774,16 @@ static void gpencil_edit_curve_stroke_iter_cb(bGPDlayer *gpl,
   gpEditCurveIterData *iter = (gpEditCurveIterData *)thunk;
   const int v = gps->runtime.curve_start;
   gpEditCurveVert *vert_ptr = iter->verts + v;
+  /* Hide points when the curve is unselected. Passing the control point
+   * as handle produces the point shader skip it if you are not in ALL mode. */
+  const bool hide = !(editcurve->flag & GP_CURVE_SELECT);
 
   for (int i = 0; i < editcurve->tot_curve_points; i++) {
     BezTriple *bezt = &editcurve->curve_points[i].bezt;
     const bool handle_selected = BEZT_ISSEL_ANY(bezt);
     const char vflag[3] = {
         gpencil_beztriple_vflag_get(bezt->f1, bezt->h1, true, handle_selected),
-        gpencil_beztriple_vflag_get(bezt->f2, bezt->h1, false, handle_selected),
+        gpencil_beztriple_vflag_get(bezt->f2, bezt->h1, hide, handle_selected),
         gpencil_beztriple_vflag_get(bezt->f3, bezt->h2, true, handle_selected),
     };



More information about the Bf-blender-cvs mailing list