[Bf-blender-cvs] [3752c44b448] master: GPencil: Remove Fill selection with Tweak tool and fix bug

Antonio Vazquez noreply at git.blender.org
Mon Jun 22 10:50:55 CEST 2020


Commit: 3752c44b4488ba262c98f2be102ad7cf551d1c69
Author: Antonio Vazquez
Date:   Mon Jun 22 10:40:50 2020 +0200
Branches: master
https://developer.blender.org/rB3752c44b4488ba262c98f2be102ad7cf551d1c69

GPencil: Remove Fill selection with Tweak tool and fix bug

* Fixed selection of point in multiframe mode. The point was not selected.

* Removed the fill area selection because makes the tool imprecise, and for this tool need to be precise or the selection is impossible. Now only select if it's over the point, not over the filled area.

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

M	source/blender/editors/gpencil/gpencil_select.c

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

diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index c41b2993a80..b3256628ab3 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1431,7 +1431,6 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
   bGPdata *gpd = ED_gpencil_data_get_active(C);
   ToolSettings *ts = CTX_data_tool_settings(C);
   const float scale = ts->gp_sculpt.isect_threshold;
-  const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 
   /* "radius" is simply a threshold (screen space) to make it easier to test with a tolerance */
   const float radius = 0.4f * U.widget_unit;
@@ -1495,9 +1494,6 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
     /* firstly, check for hit-point */
     for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
       int xy[2];
-      if ((!is_multiedit) && (pt->runtime.pt_orig == NULL)) {
-        continue;
-      }
 
       bGPDspoint pt2;
       gp_point_to_parent_space(pt, gpstroke_iter.diff_mat, &pt2);
@@ -1513,27 +1509,12 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
           if (pt_distance < hit_distance) {
             hit_layer = gpl;
             hit_stroke = gps_active;
-            hit_point = (!is_multiedit) ? pt->runtime.pt_orig : pt;
+            hit_point = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
             hit_distance = pt_distance;
           }
         }
       }
     }
-    if (ELEM(NULL, hit_stroke, hit_point)) {
-      /* If nothing hit, check if the mouse is inside any filled stroke.
-       * Only check filling materials. */
-      MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
-      if ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0) {
-        continue;
-      }
-      bool hit_fill = ED_gpencil_stroke_point_is_inside(gps, &gsc, mval, gpstroke_iter.diff_mat);
-      if (hit_fill) {
-        hit_stroke = gps_active;
-        hit_point = &gps_active->points[0];
-        /* Extend selection to all stroke. */
-        whole = true;
-      }
-    }
   }
   GP_EVALUATED_STROKES_END(gpstroke_iter);



More information about the Bf-blender-cvs mailing list