GPencil: Remove unused parameter in convert curve

The only_stroke parameter is not used
This commit is contained in:
2020-08-12 20:24:29 +02:00
parent e188a798c6
commit db7cfd03b0
4 changed files with 7 additions and 24 deletions

View File

@@ -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);

View File

@@ -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. */

View File

@@ -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;
}
}

View File

@@ -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);