[Bf-blender-cvs] [9fd411b6ef7] temp-gpencil-bezier-stroke-type: GPencil: First changes to use evaluated curve data

Antonio Vazquez noreply at git.blender.org
Mon Mar 15 17:14:26 CET 2021


Commit: 9fd411b6ef71d4cd7ffb8f4a75bcb40af18f4279
Author: Antonio Vazquez
Date:   Mon Mar 15 17:14:22 2021 +0100
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB9fd411b6ef71d4cd7ffb8f4a75bcb40af18f4279

GPencil: First changes to use evaluated curve data

Still not working

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

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 9192a3fea4a..09e05482293 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1646,8 +1646,10 @@ static bool gpencil_generic_curve_select(bContext *C,
   bool changed = false;
   bool whole = false;
   bool any_select = false;
-  for (int i = 0; i < gpc_active->tot_curve_points; i++) {
-    bGPDcurve_point *gpc_pt = &gpc_active->curve_points[i];
+  for (int i = 0; i < gpc->tot_curve_points; i++) {
+    bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
+    BezTriple *bezt = &gpc_pt->bezt;
+
     bGPDcurve_point *gpc_pt_active = (gpc_pt->runtime.gpc_pt_orig) ? gpc_pt->runtime.gpc_pt_orig :
                                                                      gpc_pt;
     BezTriple *bezt_active = &gpc_pt_active->bezt;
@@ -1663,7 +1665,7 @@ static bool gpencil_generic_curve_select(bContext *C,
       for (int j = 0; j < 3; j++) {
         const bool is_select = BEZT_ISSEL_IDX(bezt_active, j);
         bool is_inside = is_inside_fn(
-            gsc->region, gpstroke_iter->diff_mat, bezt_active->vec[j], user_data);
+            gsc->region, gpstroke_iter->diff_mat, bezt->vec[j], user_data);
         if (strokemode) {
           if (is_inside) {
             hit = true;
@@ -1698,8 +1700,7 @@ static bool gpencil_generic_curve_select(bContext *C,
     /* if the handles are not visible only check ctrl point (vec[1])*/
     else {
       const bool is_select = bezt_active->f2;
-      bool is_inside = is_inside_fn(
-          gsc->region, gpstroke_iter->diff_mat, bezt_active->vec[1], user_data);
+      bool is_inside = is_inside_fn(gsc->region, gpstroke_iter->diff_mat, bezt->vec[1], user_data);
       if (strokemode) {
         if (is_inside) {
           hit = true;
@@ -1924,9 +1925,8 @@ static int gpencil_generic_select_exec(bContext *C,
   }
 
   GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
-    bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps;
-    if (GPENCIL_STROKE_TYPE_BEZIER(gps_active)) {
-      bGPDcurve *gpc = gps_active->editcurve;
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
+      bGPDcurve *gpc = gps->editcurve;
       if (gpencil_generic_curve_select(C,
                                        ob,
                                        gpd,



More information about the Bf-blender-cvs mailing list