From e7f1c73a4e82ee9323f6a520bb923bc474bc738b Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Tue, 30 Aug 2022 09:29:14 +0200 Subject: [PATCH] GPencil: Add `thickness` parameter to Outline operator Instead to use always a value of 1, now the thickness of the stroke perimeter can be set. This thickness is added to the original perimeter, so using a big number can increase the global thickness of the stroke. --- source/blender/editors/gpencil/gpencil_edit.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 537696a606e..da63bf9af9b 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -3987,6 +3987,7 @@ static int gpencil_stroke_outline_exec(bContext *C, wmOperator *op) bGPdata *gpd = (bGPdata *)ob->data; const int subdivisions = RNA_int_get(op->ptr, "subdivisions"); const float length = RNA_float_get(op->ptr, "length"); + const int thickness = RNA_int_get(op->ptr, "thickness"); const int view_mode = RNA_enum_get(op->ptr, "view_mode"); const int mode = RNA_enum_get(op->ptr, "mode"); @@ -4131,6 +4132,8 @@ static int gpencil_stroke_outline_exec(bContext *C, wmOperator *op) if (length > 0.0f) { BKE_gpencil_stroke_sample(gpd, gps_perimeter, length, false, 0); } + /* Set stroke thickness. */ + gps_perimeter->thickness = thickness; /* Set pressure constant. */ bGPDspoint *pt; @@ -4216,6 +4219,15 @@ void GPENCIL_OT_stroke_outline(wmOperatorType *ot) RNA_def_enum( ot->srna, "mode", material_mode, GP_STROKE_USE_ACTIVE_MATERIAL, "Material Mode", ""); + RNA_def_int(ot->srna, + "thickness", + 1, + 1, + 1000, + "Thickness", + "Thickness of the stroke perimeter", + 1, + 1000); RNA_def_int(ot->srna, "subdivisions", 3, 0, 10, "Subdivisions", "", 0, 10); RNA_def_float(ot->srna, "length", 0.0f, 0.0f, 100.0f, "Sample Length", "", 0.0f, 100.0f);