[Bf-blender-cvs] [47fe846254a] temp-gpencil-bezier-v2: GPencil: curve select alternated

Falk David noreply at git.blender.org
Fri Feb 19 18:16:41 CET 2021


Commit: 47fe846254a86f1e48c75ba356765fa55a0a7154
Author: Falk David
Date:   Thu Feb 18 12:12:25 2021 +0100
Branches: temp-gpencil-bezier-v2
https://developer.blender.org/rB47fe846254a86f1e48c75ba356765fa55a0a7154

GPencil: curve select alternated

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

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 4e511198ddc..a0308e036c9 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -372,7 +372,6 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
 {
   bGPdata *gpd = ED_gpencil_data_get_active(C);
   const bool unselect_ends = RNA_boolean_get(op->ptr, "unselect_ends");
-  const bool is_curve_edit = (bool)GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd);
 
   if (gpd == NULL) {
     BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data");
@@ -385,10 +384,10 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
   }
 
   bool changed = false;
-  if (is_curve_edit) {
-    GP_EDITABLE_CURVES_BEGIN(gps_iter, C, gpl, gps, gpc)
-    {
-      if ((gps->flag & GP_STROKE_SELECT) && (gps->totpoints > 1)) {
+  CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
+    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+      bGPDcurve *gpc = gps->editcurve;
+      if ((gpc->flag & GP_CURVE_SELECT) && (gpc->tot_curve_points > 1)) {
         int idx = 0;
         int start = 0;
         if (unselect_ends) {
@@ -418,15 +417,10 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
           BEZT_DESEL_ALL(&gpc_pt->bezt);
         }
 
-        BKE_gpencil_curve_sync_selection(gps);
         changed = true;
       }
     }
-    GP_EDITABLE_CURVES_END(gps_iter);
-  }
-  else {
-    /* select all points in selected strokes */
-    CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
+    else {
       if ((gps->flag & GP_STROKE_SELECT) && (gps->totpoints > 1)) {
         bGPDspoint *pt;
         int row = 0;
@@ -458,8 +452,8 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
         changed = true;
       }
     }
-    CTX_DATA_END;
   }
+  CTX_DATA_END;
 
   if (changed) {
     /* updates */



More information about the Bf-blender-cvs mailing list