[Bf-blender-cvs] [d1260a0820a] greasepencil-object: Cleanup: Rename variables and comments

Antonio Vazquez noreply at git.blender.org
Wed Jun 13 15:49:10 CEST 2018


Commit: d1260a0820adf4f0d31daa73ce7ff5bf1040597d
Author: Antonio Vazquez
Date:   Wed Jun 13 15:49:02 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd1260a0820adf4f0d31daa73ce7ff5bf1040597d

Cleanup: Rename variables and comments

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

M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/gpencil_modifier.c

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

diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index e84fc380f78..fa2aa4e14d0 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -181,9 +181,9 @@ void BKE_gpencil_simplify_fixed(struct bGPDstroke *gps);
 void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
 
 bool BKE_gpencil_smooth_stroke(struct bGPDstroke *gps, int i, float inf);
-bool BKE_gpencil_smooth_stroke_strength(struct bGPDstroke *gps, int i, float inf);
-bool BKE_gpencil_smooth_stroke_thickness(struct bGPDstroke *gps, int i, float inf);
-bool BKE_gpencil_smooth_stroke_uv(struct bGPDstroke *gps, int i, float inf);
+bool BKE_gpencil_smooth_stroke_strength(struct bGPDstroke *gps, int point_index, float influence);
+bool BKE_gpencil_smooth_stroke_thickness(struct bGPDstroke *gps, int point_index, float influence);
+bool BKE_gpencil_smooth_stroke_uv(struct bGPDstroke *gps, int point_index, float influence);
 
 void BKE_gpencil_get_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe);
 float BKE_gpencil_multiframe_falloff_calc(struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff);
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 1a47ec8385c..c327369e7fe 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1382,14 +1382,10 @@ bool BKE_gpencil_smooth_stroke(bGPDstroke *gps, int i, float inf)
 }
 
 /**
- * Apply smooth for strength to stroke point
- * \param gps              Stroke to smooth
- * \param i                Point index
- * \param inf              Amount of smoothing to apply
- */
-bool BKE_gpencil_smooth_stroke_strength(bGPDstroke *gps, int i, float inf)
+ * Apply smooth for strength to stroke point */
+bool BKE_gpencil_smooth_stroke_strength(bGPDstroke *gps, int point_index, float influence)
 {
-	bGPDspoint *ptb = &gps->points[i];
+	bGPDspoint *ptb = &gps->points[point_index];
 
 	/* Do nothing if not enough points */
 	if (gps->totpoints <= 2) {
@@ -1398,8 +1394,8 @@ bool BKE_gpencil_smooth_stroke_strength(bGPDstroke *gps, int i, float inf)
 
 	/* Compute theoretical optimal value using distances */
 	bGPDspoint *pta, *ptc;
-	int before = i - 1;
-	int after = i + 1;
+	int before = point_index - 1;
+	int after = point_index + 1;
 
 	CLAMP_MIN(before, 0);
 	CLAMP_MAX(after, gps->totpoints - 1);
@@ -1414,20 +1410,16 @@ bool BKE_gpencil_smooth_stroke_strength(bGPDstroke *gps, int i, float inf)
 	const float optimal = (1.0f - fac) * pta->strength + fac * ptc->strength;
 
 	/* Based on influence factor, blend between original and optimal */
-	ptb->strength = (1.0f - inf) * ptb->strength + inf * optimal;
+	ptb->strength = (1.0f - influence) * ptb->strength + influence * optimal;
 
 	return true;
 }
 
 /**
- * Apply smooth for thickness to stroke point (use pressure)
- * \param gps              Stroke to smooth
- * \param i                Point index
- * \param inf              Amount of smoothing to apply
- */
-bool BKE_gpencil_smooth_stroke_thickness(bGPDstroke *gps, int i, float inf)
+ * Apply smooth for thickness to stroke point (use pressure) */
+bool BKE_gpencil_smooth_stroke_thickness(bGPDstroke *gps, int point_index, float influence)
 {
-	bGPDspoint *ptb = &gps->points[i];
+	bGPDspoint *ptb = &gps->points[point_index];
 
 	/* Do nothing if not enough points */
 	if (gps->totpoints <= 2) {
@@ -1436,8 +1428,8 @@ bool BKE_gpencil_smooth_stroke_thickness(bGPDstroke *gps, int i, float inf)
 
 	/* Compute theoretical optimal value using distances */
 	bGPDspoint *pta, *ptc;
-	int before = i - 1;
-	int after = i + 1;
+	int before = point_index - 1;
+	int after = point_index + 1;
 
 	CLAMP_MIN(before, 0);
 	CLAMP_MAX(after, gps->totpoints - 1);
@@ -1452,20 +1444,16 @@ bool BKE_gpencil_smooth_stroke_thickness(bGPDstroke *gps, int i, float inf)
 	float optimal = interpf(ptc->pressure, pta->pressure, fac);
 
 	/* Based on influence factor, blend between original and optimal */
-	ptb->pressure = interpf(optimal, ptb->pressure, inf);
+	ptb->pressure = interpf(optimal, ptb->pressure, influence);
 
 	return true;
 }
 
 /**
-* Apply smooth for UV rotation to stroke point (use pressure)
-* \param gps              Stroke to smooth
-* \param i                Point index
-* \param inf              Amount of smoothing to apply
-*/
-bool BKE_gpencil_smooth_stroke_uv(bGPDstroke *gps, int i, float inf)
+* Apply smooth for UV rotation to stroke point (use pressure) */
+bool BKE_gpencil_smooth_stroke_uv(bGPDstroke *gps, int point_index, float influence)
 {
-	bGPDspoint *ptb = &gps->points[i];
+	bGPDspoint *ptb = &gps->points[point_index];
 
 	/* Do nothing if not enough points */
 	if (gps->totpoints <= 2) {
@@ -1474,8 +1462,8 @@ bool BKE_gpencil_smooth_stroke_uv(bGPDstroke *gps, int i, float inf)
 
 	/* Compute theoretical optimal value */
 	bGPDspoint *pta, *ptc;
-	int before = i - 1;
-	int after = i + 1;
+	int before = point_index - 1;
+	int after = point_index + 1;
 
 	CLAMP_MIN(before, 0);
 	CLAMP_MAX(after, gps->totpoints - 1);
@@ -1490,7 +1478,7 @@ bool BKE_gpencil_smooth_stroke_uv(bGPDstroke *gps, int i, float inf)
 	float optimal = interpf(ptc->uv_rot, pta->uv_rot, fac);
 
 	/* Based on influence factor, blend between original and optimal */
-	ptb->uv_rot = interpf(optimal, ptb->uv_rot, inf);
+	ptb->uv_rot = interpf(optimal, ptb->uv_rot, influence);
 	CLAMP(ptb->uv_rot, -M_PI_2, M_PI_2);
 
 	return true;
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 9af55adfa79..cc1f88c125d 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -354,7 +354,7 @@ void BKE_gpencil_lattice_clear(Object *ob)
 /* *************************************************** */
 /* Modifier Methods - Evaluation Loops, etc. */
 
-/* verify if exist geometry modifiers */
+/* check if exist geometry modifiers */
 bool BKE_gpencil_has_geometry_modifiers(Object *ob)
 {
 	ModifierData *md;



More information about the Bf-blender-cvs mailing list