[Bf-blender-cvs] [a351eb07265] master: GPencil: Cleanup function names replace gp_ by gpencil_ prefix

Antonio Vazquez noreply at git.blender.org
Mon Jun 29 15:52:12 CEST 2020


Commit: a351eb072658ce6fb84290f80d8f17bb397fb7ff
Author: Antonio Vazquez
Date:   Mon Jun 29 15:28:38 2020 +0200
Branches: master
https://developer.blender.org/rBa351eb072658ce6fb84290f80d8f17bb397fb7ff

GPencil: Cleanup function names replace gp_ by gpencil_ prefix

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

M	source/blender/editors/gpencil/gpencil_add_stroke.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/gpencil/gpencil_merge.c
M	source/blender/editors/gpencil/gpencil_mesh.c
M	source/blender/editors/gpencil/gpencil_ops.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_primitive.c

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

diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c
index 60a4404beaf..39a2d594c13 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -49,7 +49,10 @@ typedef struct ColorTemplate {
 } ColorTemplate;
 
 /* Add color an ensure duplications (matched by name) */
-static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate *pct, const bool fill)
+static int gpencil_stroke_material(Main *bmain,
+                                   Object *ob,
+                                   const ColorTemplate *pct,
+                                   const bool fill)
 {
   short *totcol = BKE_object_material_len_p(ob);
   Material *ma = NULL;
@@ -224,12 +227,12 @@ void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4])
   bGPDstroke *gps;
 
   /* create colors */
-  int color_black = gp_stroke_material(bmain, ob, &gp_stroke_material_black, false);
-  gp_stroke_material(bmain, ob, &gp_stroke_material_white, false);
-  gp_stroke_material(bmain, ob, &gp_stroke_material_red, false);
-  gp_stroke_material(bmain, ob, &gp_stroke_material_green, false);
-  gp_stroke_material(bmain, ob, &gp_stroke_material_blue, false);
-  gp_stroke_material(bmain, ob, &gp_stroke_material_grey, true);
+  int color_black = gpencil_stroke_material(bmain, ob, &gp_stroke_material_black, false);
+  gpencil_stroke_material(bmain, ob, &gp_stroke_material_white, false);
+  gpencil_stroke_material(bmain, ob, &gp_stroke_material_red, false);
+  gpencil_stroke_material(bmain, ob, &gp_stroke_material_green, false);
+  gpencil_stroke_material(bmain, ob, &gp_stroke_material_blue, false);
+  gpencil_stroke_material(bmain, ob, &gp_stroke_material_grey, true);
 
   /* set first color as active and in brushes */
   ob->actcol = color_black + 1;
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index 49b97b1df66..e111ce44bc4 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -154,12 +154,12 @@ static const EnumPropertyItem *rna_GPConvert_mode_items(bContext *UNUSED(C),
 /* convert the coordinates from the given stroke point into 3d-coordinates
  * - assumes that the active space is the 3D-View
  */
-static void gp_strokepoint_convertcoords(bContext *C,
-                                         bGPDlayer *gpl,
-                                         bGPDstroke *gps,
-                                         bGPDspoint *source_pt,
-                                         float p3d[3],
-                                         const rctf *subrect)
+static void gpencil_strokepoint_convertcoords(bContext *C,
+                                              bGPDlayer *gpl,
+                                              bGPDstroke *gps,
+                                              bGPDspoint *source_pt,
+                                              float p3d[3],
+                                              const rctf *subrect)
 {
   Scene *scene = CTX_data_scene(C);
   View3D *v3d = CTX_wm_view3d(C);
@@ -243,7 +243,7 @@ typedef struct tGpTimingData {
 /* Init point buffers for timing data.
  * Note this assumes we only grow those arrays!
  */
-static void gp_timing_data_set_nbr(tGpTimingData *gtd, const int nbr)
+static void gpencil_timing_data_set_nbr(tGpTimingData *gtd, const int nbr)
 {
   float *tmp;
 
@@ -269,10 +269,10 @@ static void gp_timing_data_set_nbr(tGpTimingData *gtd, const int nbr)
 }
 
 /* add stroke point to timing buffers */
-static void gp_timing_data_add_point(tGpTimingData *gtd,
-                                     const double stroke_inittime,
-                                     const float time,
-                                     const float delta_dist)
+static void gpencil_timing_data_add_point(tGpTimingData *gtd,
+                                          const double stroke_inittime,
+                                          const float time,
+                                          const float delta_dist)
 {
   float delta_time = 0.0f;
   const int cur_point = gtd->cur_point;
@@ -308,14 +308,14 @@ static void gp_timing_data_add_point(tGpTimingData *gtd,
 #define MIN_TIME_DELTA 0.02f
 
 /* Loop over next points to find the end of the stroke, and compute */
-static int gp_find_end_of_stroke_idx(tGpTimingData *gtd,
-                                     RNG *rng,
-                                     const int idx,
-                                     const int nbr_gaps,
-                                     int *nbr_done_gaps,
-                                     const float tot_gaps_time,
-                                     const float delta_time,
-                                     float *next_delta_time)
+static int gpencil_find_end_of_stroke_idx(tGpTimingData *gtd,
+                                          RNG *rng,
+                                          const int idx,
+                                          const int nbr_gaps,
+                                          int *nbr_done_gaps,
+                                          const float tot_gaps_time,
+                                          const float delta_time,
+                                          float *next_delta_time)
 {
   int j;
 
@@ -365,10 +365,10 @@ static int gp_find_end_of_stroke_idx(tGpTimingData *gtd,
   return j - 1;
 }
 
-static void gp_stroke_path_animation_preprocess_gaps(tGpTimingData *gtd,
-                                                     RNG *rng,
-                                                     int *nbr_gaps,
-                                                     float *tot_gaps_time)
+static void gpencil_stroke_path_animation_preprocess_gaps(tGpTimingData *gtd,
+                                                          RNG *rng,
+                                                          int *nbr_gaps,
+                                                          float *tot_gaps_time)
 {
   int i;
   float delta_time = 0.0f;
@@ -396,16 +396,16 @@ static void gp_stroke_path_animation_preprocess_gaps(tGpTimingData *gtd,
   }
 }
 
-static void gp_stroke_path_animation_add_keyframes(ReportList *reports,
-                                                   PointerRNA ptr,
-                                                   PropertyRNA *prop,
-                                                   FCurve *fcu,
-                                                   Curve *cu,
-                                                   tGpTimingData *gtd,
-                                                   RNG *rng,
-                                                   const float time_range,
-                                                   const int nbr_gaps,
-                                                   const float tot_gaps_time)
+static void gpencil_stroke_path_animation_add_keyframes(ReportList *reports,
+                                                        PointerRNA ptr,
+                                                        PropertyRNA *prop,
+                                                        FCurve *fcu,
+                                                        Curve *cu,
+                                                        tGpTimingData *gtd,
+                                                        RNG *rng,
+                                                        const float time_range,
+                                                        const int nbr_gaps,
+                                                        const float tot_gaps_time)
 {
   /* Use actual recorded timing! */
   const float time_start = (float)gtd->start_frame;
@@ -431,7 +431,7 @@ static void gp_stroke_path_animation_add_keyframes(ReportList *reports,
       start_stroke_idx = i;
       delta_time = next_delta_time;
       /* find end of that new stroke */
-      end_stroke_idx = gp_find_end_of_stroke_idx(
+      end_stroke_idx = gpencil_find_end_of_stroke_idx(
           gtd, rng, i, nbr_gaps, &nbr_done_gaps, tot_gaps_time, delta_time, &next_delta_time);
       /* This one should *never* be negative! */
       end_stroke_time = time_start +
@@ -489,10 +489,10 @@ static void gp_stroke_path_animation_add_keyframes(ReportList *reports,
   }
 }
 
-static void gp_stroke_path_animation(bContext *C,
-                                     ReportList *reports,
-                                     Curve *cu,
-                                     tGpTimingData *gtd)
+static void gpencil_stroke_path_animation(bContext *C,
+                                          ReportList *reports,
+                                          Curve *cu,
+                                          tGpTimingData *gtd)
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
@@ -560,7 +560,7 @@ static void gp_stroke_path_animation(bContext *C,
 
     /* Pre-process gaps, in case we don't want to keep their original timing */
     if (gtd->mode == GP_STROKECONVERT_TIMING_CUSTOMGAP) {
-      gp_stroke_path_animation_preprocess_gaps(gtd, rng, &nbr_gaps, &tot_gaps_time);
+      gpencil_stroke_path_animation_preprocess_gaps(gtd, rng, &nbr_gaps, &tot_gaps_time);
     }
 
     if (gtd->realtime) {
@@ -574,7 +574,7 @@ static void gp_stroke_path_animation(bContext *C,
       printf("GP Stroke Path Conversion: Starting keying!\n");
     }
 
-    gp_stroke_path_animation_add_keyframes(
+    gpencil_stroke_path_animation_add_keyframes(
         reports, ptr, prop, fcu, cu, gtd, rng, time_range, nbr_gaps, tot_gaps_time);
 
     BLI_rng_free(rng);
@@ -606,16 +606,16 @@ static void gp_stroke_path_animation(bContext *C,
 /* convert stroke to 3d path */
 
 /* helper */
-static void gp_stroke_to_path_add_point(tGpTimingData *gtd,
-                                        BPoint *bp,
-                                        const float p[3],
-                                        const float prev_p[3],
-                                        const bool do_gtd,
-                                        const double inittime,
-                                        const float time,
-                                

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list