diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-06-10 12:41:57 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-06-10 12:42:35 +0300 |
commit | 146473f08335e8cb774ccaf1baad82a1d308fbe1 (patch) | |
tree | 6f38dbca2a1a7caca1b81248281fbbe933614c88 /source/blender/editors/gpencil/gpencil_convert.c | |
parent | 82f51fe9132f50d10f1263e97ecde9655af97671 (diff) |
GPencil: Include new Bevel parameters when convert stroke to Curve
These new parameters allow to define bevel depth and resolution.
Related to T77631
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_convert.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 5441d4e24a6..78a34cda2f5 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -231,6 +231,10 @@ typedef struct tGpTimingData { /* Only used during creation of dists & times lists. */ float offset_time; + + /* Curve bevel. */ + float bevel_depth; + int bevel_resolution; } tGpTimingData; /* Init point buffers for timing data. @@ -1302,6 +1306,8 @@ static void gp_layer_to_curve(bContext *C, DEG_relations_tag_update(bmain); /* added object */ cu->flag |= CU_3D; + cu->bevresol = gtd->bevel_resolution; + cu->ext2 = gtd->bevel_depth; gtd->inittime = ((bGPDstroke *)gpf->strokes.first)->inittime; @@ -1518,6 +1524,8 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op) /* grab all relevant settings */ gtd.frame_range = RNA_int_get(op->ptr, "frame_range"); gtd.start_frame = RNA_int_get(op->ptr, "start_frame"); + gtd.bevel_depth = RNA_float_get(op->ptr, "bevel_depth"); + gtd.bevel_resolution = RNA_int_get(op->ptr, "bevel_resolution"); gtd.realtime = valid_timing ? RNA_boolean_get(op->ptr, "use_realtime") : false; gtd.end_frame = RNA_int_get(op->ptr, "end_frame"); gtd.gap_duration = RNA_float_get(op->ptr, "gap_duration"); @@ -1567,7 +1575,8 @@ static bool gp_convert_poll_property(const bContext *UNUSED(C), /* Always show those props */ if (STREQ(prop_id, "type") || STREQ(prop_id, "use_normalize_weights") || - STREQ(prop_id, "radius_multiplier") || STREQ(prop_id, "use_link_strokes")) { + STREQ(prop_id, "radius_multiplier") || STREQ(prop_id, "use_link_strokes") || + STREQ(prop_id, "bevel_depth") || STREQ(prop_id, "bevel_resolution")) { return true; } @@ -1643,6 +1652,18 @@ void GPENCIL_OT_convert(wmOperatorType *ot) ot->prop = RNA_def_enum( ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", "Which type of curve to convert to"); + RNA_def_float_distance( + ot->srna, "bevel_depth", 0.0f, 0.0f, 1000.0f, "Bevel Depth", "", 0.0f, 10.0f); + RNA_def_int(ot->srna, + "bevel_resolution", + 0, + 0, + 32, + "Bevel_Resolution", + "Bevel resolution when depth is non-zero", + 0, + 32); + RNA_def_boolean(ot->srna, "use_normalize_weights", true, |