[Bf-blender-cvs] [8d3684c8b9f] greasepencil-object: Cleanup: Remove the now unnecessary modifier_index parameter from Modifier->generateStrokes()

Joshua Leung noreply at git.blender.org
Fri May 4 16:06:40 CEST 2018


Commit: 8d3684c8b9f6186e7991e147367603d728e5d749
Author: Joshua Leung
Date:   Fri May 4 15:58:22 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8d3684c8b9f6186e7991e147367603d728e5d749

Cleanup: Remove the now unnecessary modifier_index parameter from Modifier->generateStrokes()

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

M	source/blender/blenkernel/BKE_modifier.h
M	source/blender/blenkernel/intern/gpencil_modifier.c
M	source/blender/modifiers/intern/MOD_gpencilbuild.c
M	source/blender/modifiers/intern/MOD_gpencilinstance.c

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

diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 48a45080c64..39e67b128c3 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -311,8 +311,7 @@ typedef struct ModifierTypeInfo {
 	 * in the modifier stack in relation to other modifiers.
 	 */
 	void (*generateStrokes)(struct ModifierData *md, struct Depsgraph *depsgraph,
-	                        struct Object *ob, struct bGPDlayer *gpl, struct bGPDframe *gpf,
-	                        int modifier_index);
+	                        struct Object *ob, struct bGPDlayer *gpl, struct bGPDframe *gpf);
 
 	/* Bake-down GP modifier's effects into the GP datablock.
 	 *
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 0f2baeb860b..878ccce9dde 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -383,7 +383,6 @@ void BKE_gpencil_geometry_modifiers(Depsgraph *depsgraph, Object *ob, bGPDlayer
 	bGPdata *gpd = ob->data;
 	bool is_edit = GPENCIL_ANY_EDIT_MODE(gpd);
 
-	int id = 0;
 	for (md = ob->modifiers.first; md; md = md->next) {
 		if (((md->mode & eModifierMode_Realtime) && (is_render == false)) ||
 		    ((md->mode & eModifierMode_Render) && (is_render == true)))
@@ -395,10 +394,9 @@ void BKE_gpencil_geometry_modifiers(Depsgraph *depsgraph, Object *ob, bGPDlayer
 			}
 
 			if (mti->generateStrokes) {
-				mti->generateStrokes(md, depsgraph, ob, gpl, gpf, id);
+				mti->generateStrokes(md, depsgraph, ob, gpl, gpf);
 			}
 		}
-		id++;
 	}
 }
 
diff --git a/source/blender/modifiers/intern/MOD_gpencilbuild.c b/source/blender/modifiers/intern/MOD_gpencilbuild.c
index 865a93f139a..afb57f33e37 100644
--- a/source/blender/modifiers/intern/MOD_gpencilbuild.c
+++ b/source/blender/modifiers/intern/MOD_gpencilbuild.c
@@ -90,19 +90,19 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
  */
 
 /* Remove a particular stroke */
-static void clear_stroke(bGPDframe *gpf, bGPDstroke *gps, int modifier_index)
+static void clear_stroke(bGPDframe *gpf, bGPDstroke *gps)
 {
 	BLI_remlink(&gpf->strokes, gps);
 	BKE_gpencil_free_stroke(gps);
 }
 
 /* Clear all strokes in frame */
-static void gpf_clear_all_strokes(bGPDframe *gpf, int modifier_index)
+static void gpf_clear_all_strokes(bGPDframe *gpf)
 {
 	bGPDstroke *gps, *gps_next;
 	for (gps = gpf->strokes.first; gps; gps = gps_next) {
 		gps_next = gps->next;
-		clear_stroke(gpf, gps, modifier_index);
+		clear_stroke(gpf, gps);
 	}
 	BLI_listbase_clear(&gpf->strokes);
 }
@@ -185,7 +185,7 @@ typedef struct tStrokeBuildDetails {
 
 
 /* Sequential - Show strokes one after the other */
-static void build_sequential(GpencilBuildModifierData *mmd, bGPDframe *gpf, float fac, int modifier_index)
+static void build_sequential(GpencilBuildModifierData *mmd, bGPDframe *gpf, float fac)
 {
 	const size_t tot_strokes = BLI_listbase_count(&gpf->strokes);
 	bGPDstroke *gps;
@@ -258,7 +258,7 @@ static void build_sequential(GpencilBuildModifierData *mmd, bGPDframe *gpf, floa
 		/* Determine what portion of the stroke is visible */
 		if ((cell->end_idx < first_visible) || (cell->start_idx > last_visible)) {
 			/* Not visible at all - Either ended before */
-			clear_stroke(gpf, cell->gps, modifier_index);
+			clear_stroke(gpf, cell->gps);
 		}
 		else {
 			/* Some proportion of stroke is visible */
@@ -288,7 +288,7 @@ static void build_sequential(GpencilBuildModifierData *mmd, bGPDframe *gpf, floa
 /* Concurrent - Show multiple strokes at once */
 // TODO: Allow random offsets to start times
 // TODO: Allow varying speeds? Scaling of progress?
-static void build_concurrent(GpencilBuildModifierData *mmd, bGPDframe *gpf, float fac, int modifier_index)
+static void build_concurrent(GpencilBuildModifierData *mmd, bGPDframe *gpf, float fac)
 {
 	bGPDstroke *gps, *gps_next;
 	int max_points = 0;
@@ -382,7 +382,7 @@ static void build_concurrent(GpencilBuildModifierData *mmd, bGPDframe *gpf, floa
 		/* Modify the stroke geometry */
 		if (num_points <= 0) {
 			/* Nothing Left - Delete the stroke */
-			clear_stroke(gpf, gps, modifier_index);
+			clear_stroke(gpf, gps);
 		}
 		else if (num_points < gps->totpoints) {
 			/* Remove some points */
@@ -395,8 +395,7 @@ static void build_concurrent(GpencilBuildModifierData *mmd, bGPDframe *gpf, floa
 
 /* Entry-point for Build Modifier */
 static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
-	                        Object *UNUSED(ob), bGPDlayer *gpl, bGPDframe *gpf,
-	                        int modifier_index)
+	                        Object *UNUSED(ob), bGPDlayer *gpl, bGPDframe *gpf)
 {
 	GpencilBuildModifierData *mmd = (GpencilBuildModifierData *)md;
 	const bool reverse = (mmd->transition != GP_BUILD_TRANSITION_GROW);
@@ -457,7 +456,7 @@ static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
 			/* 2) Forward Order = Start with nothing, end with the full frame.
 			 *    ==> Free all strokes, and return an empty frame
 			 */
-			gpf_clear_all_strokes(gpf, modifier_index);
+			gpf_clear_all_strokes(gpf);
 		}
 		
 		/* Early exit */
@@ -469,7 +468,7 @@ static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
 			/* 1) Reverse = Start with all, end with nothing.
 			 *    ==> Free all strokes, and return an empty frame
 			 */
-			gpf_clear_all_strokes(gpf, modifier_index);
+			gpf_clear_all_strokes(gpf);
 		}
 		else {
 			/* 2) Forward Order = Start with nothing, end with the full frame.
@@ -489,11 +488,11 @@ static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
 	/* Time management mode */
 	switch (mmd->mode) {
 		case GP_BUILD_MODE_SEQUENTIAL:
-			build_sequential(mmd, gpf, fac, modifier_index);
+			build_sequential(mmd, gpf, fac);
 			break;
 			
 		case GP_BUILD_MODE_CONCURRENT:
-			build_concurrent(mmd, gpf, fac, modifier_index);
+			build_concurrent(mmd, gpf, fac);
 			break;
 			
 		default:
diff --git a/source/blender/modifiers/intern/MOD_gpencilinstance.c b/source/blender/modifiers/intern/MOD_gpencilinstance.c
index 664685d1f96..161ba24b044 100644
--- a/source/blender/modifiers/intern/MOD_gpencilinstance.c
+++ b/source/blender/modifiers/intern/MOD_gpencilinstance.c
@@ -133,8 +133,7 @@ void BKE_gpencil_instance_modifier_instance_tfm(GpencilInstanceModifierData *mmd
 /* array modifier - generate geometry callback (for viewport/rendering) */
 /* TODO: How to skip this for the simplify options?   -->  !GP_SIMPLIFY_MODIF(ts, playing) */
 static void generate_geometry(ModifierData *md, Depsgraph *UNUSED(depsgraph),
-	                          Object *ob, bGPDlayer *gpl, bGPDframe *gpf,
-	                          int modifier_index)
+	                          Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
 {
 	GpencilInstanceModifierData *mmd = (GpencilInstanceModifierData *)md;
 	ListBase stroke_cache = {NULL, NULL};
@@ -243,7 +242,7 @@ static void bakeModifierGP_strokes(const bContext *UNUSED(C), Depsgraph *depsgra
 	
 	for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
 		for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
-			generate_geometry(md, depsgraph, ob, gpl, gpf, -1);
+			generate_geometry(md, depsgraph, ob, gpl, gpf);
 		}
 	}
 }
@@ -339,8 +338,7 @@ static void bakeModifierGP_objects(const bContext *C, ModifierData *md, Object *
 
 /* Generic "generateStrokes" callback */
 static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
-	                        Object *ob, bGPDlayer *gpl, bGPDframe *gpf,
-	                        int modifier_index)
+	                        Object *ob, bGPDlayer *gpl, bGPDframe *gpf)
 {
 	GpencilInstanceModifierData *mmd = (GpencilInstanceModifierData *)md;
 	
@@ -353,7 +351,7 @@ static void generateStrokes(ModifierData *md, Depsgraph *depsgraph,
 	 *        working functionality
 	 */
 	if ((mmd->flag & GP_INSTANCE_MAKE_OBJECTS) == 0) {
-		generate_geometry(md, depsgraph, ob, gpl, gpf, modifier_index);
+		generate_geometry(md, depsgraph, ob, gpl, gpf);
 	}
 }



More information about the Bf-blender-cvs mailing list