Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-12 13:35:52 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-12 23:47:47 +0300
commit504c257daed50bfc28d565de5590ba0929700fc8 (patch)
treeff2c1ce84fde6636b12316b1a3fe08af434645d9 /source/blender/makesrna/intern/rna_object_api.c
parent9abdafe840e5eaa29153565bd7c121f02e1d1fb1 (diff)
GPencil: Add Sample parameter to Convert curve
This allows to resample the stroke to avoid too dense geometry.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 9e698b2b398..05db3dc25a1 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -715,7 +715,8 @@ bool rna_Object_generate_gpencil_strokes(Object *ob,
Object *ob_gpencil,
bool gpencil_lines,
bool use_collections,
- float scale_thickness)
+ float scale_thickness,
+ float sample)
{
if (ob->type != OB_CURVE) {
BKE_reportf(reports,
@@ -727,8 +728,15 @@ 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);
+ BKE_gpencil_convert_curve(bmain,
+ scene,
+ ob_gpencil,
+ ob,
+ gpencil_lines,
+ use_collections,
+ false,
+ scale_thickness,
+ sample);
WM_main_add_notifier(NC_GPENCIL | ND_DATA, NULL);
@@ -1202,6 +1210,8 @@ void RNA_api_object(StructRNA *srna)
parm = RNA_def_boolean(func, "use_collections", true, "", "Use Collections");
parm = RNA_def_float(
func, "scale_thickness", 1.0f, 0.0f, FLT_MAX, "", "Thickness scaling factor", 0.0f, 100.0f);
+ parm = RNA_def_float(
+ func, "sample", 0.0f, 0.0f, FLT_MAX, "", "Sample distance, zero to disable", 0.0f, 100.0f);
parm = RNA_def_boolean(func, "result", 0, "", "Result");
RNA_def_function_return(func, parm);
}