[Bf-blender-cvs] [827a5289ef3] greasepencil-object: Cleanup: Rename subdivide field

Antonio Vazquez noreply at git.blender.org
Fri Mar 9 18:32:05 CET 2018


Commit: 827a5289ef35b6e397fe136c3c27c16b32bcf275
Author: Antonio Vazquez
Date:   Fri Mar 9 17:52:49 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB827a5289ef35b6e397fe136c3c27c16b32bcf275

Cleanup: Rename subdivide field

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 8f2727d63b8..25007a6bb13 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -587,7 +587,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 	brush->draw_random_sub = 0.0f;
 	copy_v3_v3(brush->curcolor, curcolor);
 	brush->icon = GPBRUSH_PENCIL;
@@ -617,7 +617,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->flag_group |= GP_BRUSH_GROUP_SETTINGS;
 	brush->draw_smoothfac = 0.5f;
 	brush->draw_smoothlvl = 1;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
 	brush->draw_random_sub = 0.0f;
@@ -649,7 +649,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 	brush->draw_random_sub = 0.0f;
 	copy_v3_v3(brush->curcolor, curcolor);
 	brush->icon = GPBRUSH_INK;
@@ -685,7 +685,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 2;
 	brush->thick_smoothfac = 0.5f;
 	brush->thick_smoothlvl = 2;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 	brush->draw_random_sub = 0.0f;
 	copy_v3_v3(brush->curcolor, curcolor);
 	brush->icon = GPBRUSH_INKNOISE;
@@ -722,7 +722,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
-	brush->sublevel = 0;
+	brush->subdivide = 0;
 	brush->draw_random_sub = 0;
 	copy_v3_v3(brush->curcolor, curcolor);
 	brush->icon = GPBRUSH_BLOCK;
@@ -752,7 +752,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 	brush->draw_random_sub = 0.0f;
 	copy_v3_v3(brush->curcolor, curcolor);
 	brush->icon = GPBRUSH_MARKER;
@@ -776,7 +776,7 @@ void BKE_gpencil_brush_init_presets(ToolSettings *ts)
 	brush->draw_smoothlvl = 1;
 	brush->thick_smoothfac = 1.0f;
 	brush->thick_smoothlvl = 3;
-	brush->sublevel = 1;
+	brush->subdivide = 1;
 
 	brush->lazy_radius = LAZY_RADIUS;
 	brush->lazy_factor = LAZY_FACTOR;
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index ef1e14f62de..b9352c37d17 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1673,7 +1673,7 @@ static int gp_brush_copy_exec(bContext *C, wmOperator *op)
 	newbrush->thickness = brush->thickness;
 	newbrush->draw_smoothfac = brush->draw_smoothfac;
 	newbrush->draw_smoothlvl = brush->draw_smoothlvl;
-	newbrush->sublevel = brush->sublevel;
+	newbrush->subdivide = brush->subdivide;
 	newbrush->flag = brush->flag;
 	newbrush->draw_sensitivity = brush->draw_sensitivity;
 	newbrush->draw_strength = brush->draw_strength;
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 08ea551c440..f3b6248d5b9 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -241,7 +241,7 @@ int gp_delete_selected_point_wrap(bContext *C);
 bool gp_smooth_stroke(bGPDstroke *gps, int i, float inf, bool affect_pressure);
 bool gp_smooth_stroke_strength(bGPDstroke *gps, int i, float inf);
 bool gp_smooth_stroke_thickness(bGPDstroke *gps, int i, float inf);
-void gp_subdivide_stroke(bGPDstroke *gps, const int sublevel);
+void gp_subdivide_stroke(bGPDstroke *gps, const int subdivide);
 void gp_randomize_stroke(bGPDstroke *gps, bGPDbrush *brush);
 
 /* Layers Enums -------------------------------------- */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 34c66ada4df..c8603de26ca 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -938,7 +938,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 	gps->flag |= GP_STROKE_RECALC_CACHES;
 
 	/* allocate enough memory for a continuous array for storage points */
-	const int sublevel = brush->sublevel;
+	const int subdivide = brush->subdivide;
 
 	gps->points = MEM_callocN(sizeof(bGPDspoint) * gps->totpoints, "gp_stroke_points");
 	/* initialize triangle memory to dummy data */
@@ -1096,8 +1096,8 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 		}
 
 		/* subdivide and smooth the stroke */
-		if ((brush->flag_group & GP_BRUSH_GROUP_SETTINGS) && (sublevel > 0)) {
-			gp_subdivide_stroke(gps, sublevel);
+		if ((brush->flag_group & GP_BRUSH_GROUP_SETTINGS) && (subdivide > 0)) {
+			gp_subdivide_stroke(gps, subdivide);
 		}
 		/* apply randomness to stroke */
 		if ((brush->flag_group & GP_BRUSH_GROUP_RANDOM) && (brush->draw_random_sub > 0.0f)) {
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index c61263d7025..fd545c9decb 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -886,16 +886,16 @@ void ED_gp_project_point_to_plane(Object *ob, RegionView3D *rv3d, const float or
 /**
  * Subdivide a stroke once, by adding a point half way between each pair of existing points
  * \param gps           Stroke data
- * \param sublevel      Number of times to subdivide
+ * \param subdivide      Number of times to subdivide
  */
-void gp_subdivide_stroke(bGPDstroke *gps, const int sublevel)
+void gp_subdivide_stroke(bGPDstroke *gps, const int subdivide)
 {
 	bGPDspoint *temp_points;
 	int totnewpoints, oldtotpoints;
 	int i2;
 
 	/* loop as many times as levels */
-	for (int s = 0; s < sublevel; s++) {
+	for (int s = 0; s < subdivide; s++) {
 		totnewpoints = gps->totpoints - 1;
 		/* duplicate points in a temp area */
 		temp_points = MEM_dupallocN(gps->points);
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 07929210a01..9e3a4815de8 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -110,7 +110,7 @@ typedef struct bGPDbrush {
 	short flag;
 	float draw_smoothfac;     /* amount of smoothing to apply to newly created strokes */
 	short draw_smoothlvl;     /* number of times to apply smooth factor to new strokes */
-	short sublevel;           /* number of times to subdivide new strokes */
+	short subdivide;          /* number of times to subdivide new strokes */
 
 	float draw_sensitivity;   /* amount of sensivity to apply to newly created strokes */
 	float draw_strength;      /* amount of alpha strength to apply to newly created strokes */
@@ -143,7 +143,7 @@ typedef struct bGPDbrush {
 	int   eraser_mode;        /* soft, hard or stroke */
 	float active_smooth;      /* smooth while drawing factor */
 
-	int   flag_group;         /* falg to enable/disable groups of options */
+	int   flag_group;         /* flag to enable/disable groups of options */
 	char pad[4];
 } bGPDbrush;
 
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 24872bd4f12..46db7851a1d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2367,7 +2367,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 
 	/* Subdivision level for new strokes */
 	prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "sublevel");
+	RNA_def_property_int_sdna(prop, NULL, "subdivide");
 	RNA_def_property_range(prop, 0, 3);
 	RNA_def_property_ui_text(prop, "Subdivision Steps",
 	                         "Number of times to subdivide newly created strokes, for less jagged strokes");



More information about the Bf-blender-cvs mailing list