diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-08-30 10:29:14 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-08-30 10:37:26 +0300 |
commit | e7f1c73a4e82ee9323f6a520bb923bc474bc738b (patch) | |
tree | 517d4e922be9cc71b922c6d409c94d9237d7c6f2 /source | |
parent | c29d63aa5e22c202fd39c32ecd4e87b5704edfdd (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |