[Bf-blender-cvs] [2f5d2f5d6ce] greasepencil-object: GPencil: Rename functions

Antonio Vazquez noreply at git.blender.org
Mon Apr 20 22:58:33 CEST 2020


Commit: 2f5d2f5d6ce395c93b36abc7e2a649acff65a827
Author: Antonio Vazquez
Date:   Mon Apr 20 22:58:20 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2f5d2f5d6ce395c93b36abc7e2a649acff65a827

GPencil: Rename functions

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

M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 242c7361207..890c8d220b1 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3049,7 +3049,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
     p = op->customdata;
   }
   /* Init random vertex color. */
-  ED_gpencil_sbuffer_random_color(p->brush, event->mval, p->gps_random_color);
+  ED_gpencil_init_random_color(p->brush, event->mval, p->gps_random_color);
 
   /* TODO: set any additional settings that we can take from the events?
    * if eraser is on, draw radial aid */
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 004378c9d09..49e729c7a21 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -2713,7 +2713,7 @@ void ED_gpencil_point_vertex_color_set(ToolSettings *ts,
   }
 }
 
-void ED_gpencil_sbuffer_random_color(Brush *brush, const int mval[2], float r_value[3])
+void ED_gpencil_init_random_color(Brush *brush, const int mval[2], float r_value[3])
 {
   /* Use mouse position to get randomness. */
   int ix = mval[0] / 3;
@@ -2803,7 +2803,6 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
   Object *ob_eval = (Object *)DEG_get_evaluated_id(depsgraph, &ob->id);
   bGPdata *gpd_eval = (bGPdata *)ob_eval->data;
   MaterialGPencilStyle *gp_style = material->gp_style;
-  BrushGpencilSettings *brush_settings = brush->gpencil_settings;
 
   int idx = gpd->runtime.sbuffer_used;
   tGPspoint *tpt = (tGPspoint *)gpd->runtime.sbuffer + idx;
@@ -2829,9 +2828,7 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
   }
 
   /* Random Color. */
-  if (brush_settings->flag & GP_BRUSH_GROUP_RANDOM) {
-    ED_gpencil_sbuffer_vertex_color_random(gpd, brush, tpt, random_color);
-  }
+  ED_gpencil_sbuffer_vertex_color_random(gpd, brush, tpt, random_color);
 
   /* Copy to eval data because paint operators don't tag refresh until end for speedup
      painting. */
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index a0fdcc46559..252a122f1a7 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -331,7 +331,7 @@ void ED_gpencil_sbuffer_vertex_color_random(struct bGPdata *gpd,
                                             struct Brush *brush,
                                             struct tGPspoint *tpt,
                                             float random_color[3]);
-void ED_gpencil_sbuffer_random_color(struct Brush *brush, const int mval[2], float r_value[3]);
+void ED_gpencil_init_random_color(struct Brush *brush, const int mval[2], float r_value[3]);
 
 bool ED_gpencil_stroke_check_collision(struct GP_SpaceConversion *gsc,
                                        struct bGPDstroke *gps,



More information about the Bf-blender-cvs mailing list