diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:35:14 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-01 20:38:05 +0300 |
commit | baca8611e5fe4b3dcd6f5065fb125bc0a9d65934 (patch) | |
tree | bb1230387cd53b15f9621f10c4d0e5e2050b5580 /source/blender/makesrna/intern/rna_object_api.c | |
parent | 31705201dddebf7e3be5c4533b89f380aad1ede1 (diff) | |
parent | 2930d4fcea405985f2212c5f28c061af7c4849f8 (diff) |
Merge branch 'master' into active-fcurve-keyframeactive-fcurve-keyframe
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 3b80714bcc5..ab6b60603c7 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -713,8 +713,9 @@ bool rna_Object_generate_gpencil_strokes(Object *ob, bContext *C, ReportList *reports, Object *ob_gpencil, - bool gpencil_lines, - bool use_collections) + bool use_collections, + float scale_thickness, + float sample) { if (ob->type != OB_CURVE) { BKE_reportf(reports, @@ -726,7 +727,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); + BKE_gpencil_convert_curve( + bmain, scene, ob_gpencil, ob, use_collections, scale_thickness, sample); WM_main_add_notifier(NC_GPENCIL | ND_DATA, NULL); @@ -1190,12 +1192,17 @@ void RNA_api_object(StructRNA *srna) RNA_def_function_ui_description(func, "Convert a curve object to grease pencil strokes."); RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); - parm = RNA_def_pointer( - func, "ob_gpencil", "Object", "", "Grease Pencil object used to create new strokes"); + parm = RNA_def_pointer(func, + "grease_pencil_object", + "Object", + "", + "Grease Pencil object used to create new strokes"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); - parm = RNA_def_boolean(func, "gpencil_lines", 0, "", "Create Lines"); - parm = RNA_def_boolean(func, "use_collections", 1, "", "Use Collections"); - + 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); } |