[Bf-blender-cvs] [f13967e468c] temp-gpencil-bezier-v2: GPencil: Rename macro

Falk David noreply at git.blender.org
Fri Mar 12 20:14:10 CET 2021


Commit: f13967e468c1a2867d3cb86311c42267a207b1a7
Author: Falk David
Date:   Fri Mar 12 17:45:24 2021 +0100
Branches: temp-gpencil-bezier-v2
https://developer.blender.org/rBf13967e468c1a2867d3cb86311c42267a207b1a7

GPencil: Rename macro

Rename the GPENCIL_STROKE_IS_CURVE macro to GPENCIL_STROKE_TYPE_BEZIER

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/gpencil_curve.c
M	source/blender/blenkernel/intern/gpencil_geom.c
M	source/blender/editors/gpencil/gpencil_edit_curve.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_sculpt_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M	source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M	source/blender/makesdna/DNA_gpencil_types.h

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9607608b833..29928cd25d2 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2779,7 +2779,7 @@ void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig
     /* Assign original stroke pointer. */
     if (gps_eval != NULL) {
       gps_eval->runtime.gps_orig = gps_orig;
-      if (GPENCIL_STROKE_IS_CURVE(gps_orig)) {
+      if (GPENCIL_STROKE_TYPE_BEZIER(gps_orig)) {
         bGPDcurve *gpc_orig = gps_orig->editcurve;
         bGPDcurve *gpc_eval = gps_eval->editcurve;
 
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 33ede0e58e8..011b0efdb94 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -1009,7 +1009,7 @@ void BKE_gpencil_stroke_editcurve_update(bGPDstroke *gps,
   short prev_flag = 0;
 
   /* If editcurve exists save the selection to the stroke points (only for syncing later). */
-  if (GPENCIL_STROKE_IS_CURVE(gps)) {
+  if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
     BKE_gpencil_stroke_editcurve_sync_selection(NULL, gps, gps->editcurve);
   }
 
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c
index a8f9bb9535a..132f4ef5dff 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@ -1291,7 +1291,7 @@ void BKE_gpencil_stroke_geometry_update(bGPdata *gpd, bGPDstroke *gps)
   }
 
   /* If the stroke is a curve, update stroke points first. */
-  if (GPENCIL_STROKE_IS_CURVE(gps)) {
+  if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
 
     /* If the stroke geometry was updated, refit the curve.
      * NOTE: Normally the stroke points of a curve should not be updated directly. Only if it is
diff --git a/source/blender/editors/gpencil/gpencil_edit_curve.c b/source/blender/editors/gpencil/gpencil_edit_curve.c
index f1b58ca81ff..b2cff613f40 100644
--- a/source/blender/editors/gpencil/gpencil_edit_curve.c
+++ b/source/blender/editors/gpencil/gpencil_edit_curve.c
@@ -146,7 +146,7 @@ static int gpencil_stroke_make_curve_exec(bContext *C, wmOperator *op)
 
   bool changed = false;
   GP_EDITABLE_STROKES_BEGIN (gps_iter, C, gpl, gps) {
-    if (!GPENCIL_STROKE_IS_CURVE(gps) && (gps->flag & GP_STROKE_SELECT)) {
+    if (!GPENCIL_STROKE_TYPE_BEZIER(gps) && (gps->flag & GP_STROKE_SELECT)) {
       BKE_gpencil_stroke_editcurve_update(gps, threshold, corner_angle, false);
       if (gps->editcurve != NULL) {
         bGPDcurve *gpc = gps->editcurve;
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 3f42fa6bb14..eec96bb48e0 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -681,7 +681,7 @@ struct GP_EditableStrokes_Iter {
             /* skip strokes that are invalid for current view */ \
             if (ED_gpencil_stroke_can_use(C, gps) == false) \
               continue; \
-            if (!GPENCIL_STROKE_IS_CURVE(gps)) \
+            if (!GPENCIL_STROKE_TYPE_BEZIER(gps)) \
               continue; \
             bGPDcurve *gpc = gps->editcurve; \
     /* ... Do Stuff With Curves ...  */
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index d23f4c91989..399b190dd97 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -305,7 +305,7 @@ static void gpencil_update_geometry(bGPdata *gpd)
 
       LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
         if (gps->flag & GP_STROKE_TAG) {
-          if (GPENCIL_STROKE_IS_CURVE(gps)) {
+          if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
             gps->editcurve->flag |= GP_CURVE_NEEDS_STROKE_UPDATE;
           }
           BKE_gpencil_stroke_geometry_update(gpd, gps);
@@ -1452,7 +1452,7 @@ static bool gpencil_sculpt_brush_do_stroke(tGP_BrushEditData *gso,
   bool include_last = false;
   bool changed = false;
   float rot_eval = 0.0f;
-  const bool is_curve = GPENCIL_STROKE_IS_CURVE(gps_active);
+  const bool is_curve = GPENCIL_STROKE_TYPE_BEZIER(gps_active);
 
   if (gps->totpoints == 1) {
     bGPDspoint pt_temp;
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index c8544e7ceaf..e76ef8283b5 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -162,7 +162,7 @@ static void deselect_all_selected(bContext *C)
   gpd->select_last_index = 0;
 
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcurve;
 
       if (gpc->flag & GP_CURVE_SELECT) {
@@ -315,7 +315,7 @@ static int gpencil_select_linked_exec(bContext *C, wmOperator *op)
   bool changed = false;
   /* select all points in selected strokes */
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcurve;
       if (gpc->flag & GP_CURVE_SELECT) {
         for (int i = 0; i < gpc->tot_curve_points; i++) {
@@ -394,7 +394,7 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
 
   bool changed = false;
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcurve;
       if ((gpc->flag & GP_CURVE_SELECT) && (gpc->tot_curve_points > 1)) {
         int idx = 0;
@@ -544,7 +544,7 @@ static bool gpencil_select_same_layer(bContext *C)
       }
 
       if (gps->flag & GP_STROKE_SELECT ||
-          (GPENCIL_STROKE_IS_CURVE(gps) && gps->editcurve->flag & GP_CURVE_SELECT)) {
+          (GPENCIL_STROKE_TYPE_BEZIER(gps) && gps->editcurve->flag & GP_CURVE_SELECT)) {
         found = true;
         break;
       }
@@ -557,7 +557,7 @@ static bool gpencil_select_same_layer(bContext *C)
           continue;
         }
 
-        if (GPENCIL_STROKE_IS_CURVE(gps)) {
+        if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
           bGPDcurve *gpc = gps->editcurve;
           for (int i = 0; i < gpc->tot_curve_points; i++) {
             bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
@@ -596,7 +596,7 @@ static bool gpencil_select_same_material(bContext *C)
 
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
     if (gps->flag & GP_STROKE_SELECT ||
-        (GPENCIL_STROKE_IS_CURVE(gps) && gps->editcurve->flag & GP_CURVE_SELECT)) {
+        (GPENCIL_STROKE_TYPE_BEZIER(gps) && gps->editcurve->flag & GP_CURVE_SELECT)) {
       /* add instead of insert here, otherwise the uniqueness check gets skipped,
        * and we get many duplicate entries...
        */
@@ -610,7 +610,7 @@ static bool gpencil_select_same_material(bContext *C)
   /* Second, select any visible stroke that uses these colors */
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
     if (BLI_gset_haskey(selected_colors, &gps->mat_nr)) {
-      if (GPENCIL_STROKE_IS_CURVE(gps)) {
+      if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
         bGPDcurve *gpc = gps->editcurve;
         for (int i = 0; i < gpc->tot_curve_points; i++) {
           bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
@@ -734,14 +734,14 @@ static int gpencil_select_first_exec(bContext *C, wmOperator *op)
     /* skip stroke if we're only manipulating selected strokes */
     if (only_selected &&
         !((gps->flag & GP_STROKE_SELECT) ||
-          (GPENCIL_STROKE_IS_CURVE(gps) && gps->editcurve->flag & GP_CURVE_SELECT))) {
+          (GPENCIL_STROKE_TYPE_BEZIER(gps) && gps->editcurve->flag & GP_CURVE_SELECT))) {
       continue;
     }
 
     /* select first point */
     BLI_assert(gps->totpoints >= 1);
 
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcurve;
 
       gpc->curve_points[0].flag |= GP_CURVE_POINT_SELECT;
@@ -842,14 +842,14 @@ static int gpencil_select_last_exec(bContext *C, wmOperator *op)
     /* skip stroke if we're only manipulating selected strokes */
     if (only_selected &&
         !((gps->flag & GP_STROKE_SELECT) ||
-          (GPENCIL_STROKE_IS_CURVE(gps) && gps->editcurve->flag & GP_CURVE_SELECT))) {
+          (GPENCIL_STROKE_TYPE_BEZIER(gps) && gps->editcurve->flag & GP_CURVE_SELECT))) {
       continue;
     }
 
     /* select last point */
     BLI_assert(gps->totpoints >= 1);
 
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcurve;
 
       gpc->curve_points[gpc->tot_curve_points - 1].flag |= GP_CURVE_POINT_SELECT;
@@ -943,7 +943,7 @@ static int gpencil_select_more_exec(bContext *C, wmOperator *UNUSED(op))
 
   bool changed = false;
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
-    if (GPENCIL_STROKE_IS_CURVE(gps) && (gps->editcurve->flag & GP_CURVE_SELECT)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps) && (gps->editcurve->flag & GP_CURVE_SELECT)) {
       bGPDcurve *gpc = gps->editcurve;
 
       bool prev_sel = false;
@@ -1075,7 +1075,7 @@ static int gpencil_select_less_exec(bContext *C, wmOperator *UNUSED(op))
 
   bool changed = false;
   CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
-    if (GPENCIL_STROKE_IS_CURVE(gps) && (gps->editcurve->flag & GP_CURVE_SELECT)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps) && (gps->editcurve->flag & GP_CURVE_SELECT)) {
       bGPDcurve *gpc = gps->editcurve;
       int tot_selected = 0, num_deselected = 0;
 
@@ -1478,7 +1478,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
 
   /* find visible strokes, and select if hit */
   GP_EVALUATED_STROKES_BEGIN (gpstroke_iter, C, gpl, gps) {
-    if (GPENCIL_STROKE_IS_CURVE(gps)) {
+    if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
       bGPDcurve *gpc = gps->editcu

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list