From db7cfd03b08cbe5a2c986cfebfa4a04d8aa8a40d Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 12 Aug 2020 20:24:29 +0200 Subject: GPencil: Remove unused parameter in convert curve The only_stroke parameter is not used --- source/blender/blenkernel/BKE_gpencil_curve.h | 1 - source/blender/blenkernel/intern/gpencil_curve.c | 17 ++++------------- source/blender/editors/object/object_add.c | 2 +- source/blender/makesrna/intern/rna_object_api.c | 11 ++--------- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/BKE_gpencil_curve.h b/source/blender/blenkernel/BKE_gpencil_curve.h index 213ebf7832c..9a5950bcfab 100644 --- a/source/blender/blenkernel/BKE_gpencil_curve.h +++ b/source/blender/blenkernel/BKE_gpencil_curve.h @@ -37,7 +37,6 @@ void BKE_gpencil_convert_curve(struct Main *bmain, struct Object *ob_cu, const bool gpencil_lines, const bool use_collections, - const bool only_stroke, const float scale_thickness, const float sample); diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index 429faefd923..c2cf54adca7 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -216,12 +216,8 @@ static Collection *gpencil_get_parent_collection(Scene *scene, Object *ob) return mycol; } -static int gpencil_get_stroke_material_fromcurve(Main *bmain, - Object *ob_gp, - Object *ob_cu, - const bool only_stroke, - bool *do_stroke, - bool *do_fill) +static int gpencil_get_stroke_material_fromcurve( + Main *bmain, Object *ob_gp, Object *ob_cu, bool *do_stroke, bool *do_fill) { Curve *cu = (Curve *)ob_cu->data; @@ -295,7 +291,6 @@ static void gpencil_convert_spline(Main *bmain, Object *ob_gp, Object *ob_cu, const bool gpencil_lines, - const bool only_stroke, const float scale_thickness, const float sample, bGPDframe *gpf, @@ -336,8 +331,7 @@ static void gpencil_convert_spline(Main *bmain, * Notice: The color of the material is the color of viewport and not the final shader color. */ bool do_stroke, do_fill; - int r_idx = gpencil_get_stroke_material_fromcurve( - bmain, ob_gp, ob_cu, only_stroke, &do_stroke, &do_fill); + int r_idx = gpencil_get_stroke_material_fromcurve(bmain, ob_gp, ob_cu, &do_stroke, &do_fill); CLAMP_MIN(r_idx, 0); /* Assign material index to stroke. */ @@ -468,7 +462,6 @@ static void gpencil_convert_spline(Main *bmain, * \param ob_cu: Curve to convert. * \param gpencil_lines: Use lines for strokes. * \param use_collections: Create layers using collection names. - * \param only_stroke: The material must be only stroke without fill. * \param scale_thickness: Scale thickness factor. * \param sample: Sample distance, zero to disable. */ @@ -478,7 +471,6 @@ void BKE_gpencil_convert_curve(Main *bmain, Object *ob_cu, const bool gpencil_lines, const bool use_collections, - const bool only_stroke, const float scale_thickness, const float sample) { @@ -518,8 +510,7 @@ void BKE_gpencil_convert_curve(Main *bmain, /* Read all splines of the curve and create a stroke for each. */ LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) { - gpencil_convert_spline( - bmain, ob_gp, ob_cu, gpencil_lines, only_stroke, scale_thickness, sample, gpf, nu); + gpencil_convert_spline(bmain, ob_gp, ob_cu, gpencil_lines, scale_thickness, sample, gpf, nu); } /* Merge any similar material. */ diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index febd7457c0f..197c1c3bdbe 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2647,7 +2647,7 @@ static int object_convert_exec(bContext *C, wmOperator *op) ob_gpencil = ED_gpencil_add_object(C, ob->loc, local_view_bits); copy_v3_v3(ob_gpencil->rot, ob->rot); copy_v3_v3(ob_gpencil->scale, ob->scale); - BKE_gpencil_convert_curve(bmain, scene, ob_gpencil, ob, false, false, true, 1.0f, 0.0f); + BKE_gpencil_convert_curve(bmain, scene, ob_gpencil, ob, false, false, 1.0f, 0.0f); gpencilConverted = true; } } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 05db3dc25a1..609340888e1 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -728,15 +728,8 @@ bool rna_Object_generate_gpencil_strokes(Object *ob, Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - BKE_gpencil_convert_curve(bmain, - scene, - ob_gpencil, - ob, - gpencil_lines, - use_collections, - false, - scale_thickness, - sample); + BKE_gpencil_convert_curve( + bmain, scene, ob_gpencil, ob, gpencil_lines, use_collections, scale_thickness, sample); WM_main_add_notifier(NC_GPENCIL | ND_DATA, NULL); -- cgit v1.2.3