[Bf-blender-cvs] [d2b6195bad5] greasepencil-object: Rename brush cur_xxxx to curve_xxx

Antonio Vazquez noreply at git.blender.org
Fri May 11 17:35:28 CEST 2018


Commit: d2b6195bad5fb330379d010f2be3a6a6c95db334
Author: Antonio Vazquez
Date:   Fri May 11 17:35:23 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd2b6195bad5fb330379d010f2be3a6a6c95db334

Rename brush cur_xxxx to curve_xxx

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

M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 84daf2cfa06..4d5fddde1a2 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -144,9 +144,9 @@ static void brush_defaults(Brush *brush)
 	brush->gp_icon_id = GPBRUSH_PEN;
 
 	/* curves */
-	brush->cur_sensitivity = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-	brush->cur_strength = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-	brush->cur_jitter = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+	brush->curve_sensitivity = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+	brush->curve_strength = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+	brush->curve_jitter = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 /* Datablock add/copy/free/make_local */
@@ -359,7 +359,7 @@ void BKE_brush_gpencil_presets(bContext *C)
 	brush->gp_lazy_factor = LAZY_FACTOR;
 
 	/* Curve */
-	custom_curve = brush->cur_sensitivity;
+	custom_curve = brush->curve_sensitivity;
 	curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
 	curvemapping_initialize(custom_curve);
 	brush_gpencil_curvemap_reset(custom_curve->cm, GPCURVE_PRESET_INK);
@@ -396,7 +396,7 @@ void BKE_brush_gpencil_presets(bContext *C)
 	brush->gp_lazy_factor = LAZY_FACTOR;
 
 	/* Curve */
-	custom_curve = brush->cur_sensitivity;
+	custom_curve = brush->curve_sensitivity;
 	curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
 	curvemapping_initialize(custom_curve);
 	brush_gpencil_curvemap_reset(custom_curve->cm, GPCURVE_PRESET_INKNOISE);
@@ -558,9 +558,9 @@ void BKE_brush_copy_data(Main *UNUSED(bmain), Brush *brush_dst, const Brush *bru
 	}
 
 	brush_dst->curve = curvemapping_copy(brush_src->curve);
-	brush_dst->cur_sensitivity = curvemapping_copy(brush_src->cur_sensitivity);
-	brush_dst->cur_strength = curvemapping_copy(brush_src->cur_strength);
-	brush_dst->cur_jitter = curvemapping_copy(brush_src->cur_jitter);
+	brush_dst->curve_sensitivity = curvemapping_copy(brush_src->curve_sensitivity);
+	brush_dst->curve_strength = curvemapping_copy(brush_src->curve_strength);
+	brush_dst->curve_jitter = curvemapping_copy(brush_src->curve_jitter);
 
 	/* enable fake user by default */
 	id_fake_user_set(&brush_dst->id);
@@ -580,9 +580,9 @@ void BKE_brush_free(Brush *brush)
 		IMB_freeImBuf(brush->icon_imbuf);
 	}
 	curvemapping_free(brush->curve);
-	curvemapping_free(brush->cur_sensitivity);
-	curvemapping_free(brush->cur_strength);
-	curvemapping_free(brush->cur_jitter);
+	curvemapping_free(brush->curve_sensitivity);
+	curvemapping_free(brush->curve_strength);
+	curvemapping_free(brush->curve_jitter);
 
 	MEM_SAFE_FREE(brush->gradient);
 
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 4860e172e42..e89f4a31a61 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2361,18 +2361,18 @@ static void direct_link_brush(FileData *fd, Brush *brush)
 		BKE_brush_curve_preset(brush, CURVE_PRESET_SHARP);
 
 	/* grease pencil curves */
-	brush->cur_sensitivity = newdataadr(fd, brush->cur_sensitivity);
-	brush->cur_strength = newdataadr(fd, brush->cur_strength);
-	brush->cur_jitter = newdataadr(fd, brush->cur_jitter);
+	brush->curve_sensitivity = newdataadr(fd, brush->curve_sensitivity);
+	brush->curve_strength = newdataadr(fd, brush->curve_strength);
+	brush->curve_jitter = newdataadr(fd, brush->curve_jitter);
 
-	if (brush->cur_sensitivity)
-		direct_link_curvemapping(fd, brush->cur_sensitivity);
+	if (brush->curve_sensitivity)
+		direct_link_curvemapping(fd, brush->curve_sensitivity);
 
-	if (brush->cur_strength)
-		direct_link_curvemapping(fd, brush->cur_strength);
+	if (brush->curve_strength)
+		direct_link_curvemapping(fd, brush->curve_strength);
 
-	if (brush->cur_jitter)
-		direct_link_curvemapping(fd, brush->cur_jitter);
+	if (brush->curve_jitter)
+		direct_link_curvemapping(fd, brush->curve_jitter);
 
 	brush->preview = NULL;
 	brush->icon_imbuf = NULL;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 8c3797ebb5d..1d1f2042e3b 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3169,14 +3169,14 @@ static void write_brush(WriteData *wd, Brush *brush)
 		if (brush->curve) {
 			write_curvemapping(wd, brush->curve);
 		}
-		if (brush->cur_sensitivity) {
-			write_curvemapping(wd, brush->cur_sensitivity);
+		if (brush->curve_sensitivity) {
+			write_curvemapping(wd, brush->curve_sensitivity);
 		}
-		if (brush->cur_strength) {
-			write_curvemapping(wd, brush->cur_strength);
+		if (brush->curve_strength) {
+			write_curvemapping(wd, brush->curve_strength);
 		}
-		if (brush->cur_jitter) {
-			write_curvemapping(wd, brush->cur_jitter);
+		if (brush->curve_jitter) {
+			write_curvemapping(wd, brush->curve_jitter);
 		}
 		if (brush->gradient) {
 			writestruct(wd, DATA, ColorBand, 1, brush->gradient);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ce35c60a63c..eebcd02a780 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -425,7 +425,7 @@ static void gp_brush_jitter(bGPdata *gpd, Brush *brush, tGPspoint *pt, const int
 	float pressure = pt->pressure;
 	float tmp_pressure = pt->pressure;
 	if (brush->draw_jitter > 0.0f) {
-		float curvef = curvemapping_evaluateF(brush->cur_jitter, 0, pressure);
+		float curvef = curvemapping_evaluateF(brush->curve_jitter, 0, pressure);
 		tmp_pressure = curvef * brush->draw_sensitivity;
 	}
 	const float exfactor = (brush->draw_jitter + 2.0f) * (brush->draw_jitter + 2.0f); /* exponential value */
@@ -617,7 +617,7 @@ static short gp_stroke_addpoint(
 		/* store settings */
 		/* pressure */
 		if (brush->gp_flag & GP_BRUSH_USE_PRESSURE) {
-			float curvef = curvemapping_evaluateF(brush->cur_sensitivity, 0, pressure);
+			float curvef = curvemapping_evaluateF(brush->curve_sensitivity, 0, pressure);
 			pt->pressure = curvef * brush->draw_sensitivity;
 		}
 		else {
@@ -637,7 +637,7 @@ static short gp_stroke_addpoint(
 		if ((brush->gp_flag & GP_BRUSH_GROUP_RANDOM) && 
 			(brush->draw_random_press > 0.0f)) 
 		{
-			float curvef = curvemapping_evaluateF(brush->cur_sensitivity, 0, pressure);
+			float curvef = curvemapping_evaluateF(brush->curve_sensitivity, 0, pressure);
 			float tmp_pressure = curvef * brush->draw_sensitivity;
 			if (BLI_frand() > 0.5f) {
 				pt->pressure -= tmp_pressure * brush->draw_random_press * BLI_frand();
@@ -669,7 +669,7 @@ static short gp_stroke_addpoint(
 
 		/* color strength */
 		if (brush->gp_flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
-			float curvef = curvemapping_evaluateF(brush->cur_strength, 0, pressure);
+			float curvef = curvemapping_evaluateF(brush->curve_strength, 0, pressure);
 			float tmp_pressure = curvef * brush->draw_sensitivity;
 
 			pt->strength = tmp_pressure * brush->draw_strength;
@@ -1537,9 +1537,9 @@ static void gp_init_drawing_brush(bContext *C, tGPsdata *p)
 		brush = BKE_brush_getactive_gpencil(ts);
 	}
 	/* be sure curves are initializated */
-	curvemapping_initialize(brush->cur_sensitivity);
-	curvemapping_initialize(brush->cur_strength);
-	curvemapping_initialize(brush->cur_jitter);
+	curvemapping_initialize(brush->curve_sensitivity);
+	curvemapping_initialize(brush->curve_strength);
+	curvemapping_initialize(brush->curve_jitter);
 
 	/* asign to temp tGPsdata */
 	p->brush = brush;
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index c99cde9eade..e12a82f0bec 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -158,9 +158,9 @@ typedef struct Brush {
 	float draw_random_sub;    /* factor of randomness for subdivision */
 	char pad2[4];
 
-	struct CurveMapping *cur_sensitivity;
-	struct CurveMapping *cur_strength;
-	struct CurveMapping *cur_jitter;
+	struct CurveMapping *curve_sensitivity;
+	struct CurveMapping *curve_strength;
+	struct CurveMapping *curve_jitter;
 
 	float gp_thick_smoothfac; /* amount of thickness smoothing to apply to newly created strokes */
 	short gp_thick_smoothlvl; /* number of times to apply thickness smooth factor to new strokes */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 83841013c8a..64ecab2d3ad 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1671,19 +1671,19 @@ static void rna_def_brush(BlenderRNA *brna)
 
 	/* Curves for pressure */
 	prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "cur_sensitivity");
+	RNA_def_property_pointer_sdna(prop, NULL, "curve_sensitivity");
 	RNA_def_property_struct_type(prop, "CurveMapping");
 	RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
 	prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "cur_strength");
+	RNA_def_property_pointer_sdna(prop, NULL, "curve_strength");
 	RNA_def_property_struct_type(prop, "CurveMapping");
 	RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
 	prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "cur_jitter");
+	RNA_def_property_pointer_sdna(prop, NULL, "curve_jitter");
 	RNA_def_property_struct_type(prop, "CurveMapping");
 	RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);



More information about the Bf-blender-cvs mailing list