39 # if defined(WITH_PUGIXML) || defined(WITH_HARU)
53 "selected_object_type",
57 "Which objects to include in the export");
64 "Precision of stroke sampling. Low values mean a more precise result, and zero "
69 "use_normalized_thickness",
72 "Export strokes with constant thickness");
82 BLI_strncpy(filepath,
"untitled",
sizeof(filepath));
112 set_export_filepath(
C, op,
".svg");
130 if (region ==
NULL) {
161 .select_mode = select_mode,
191 uiItemR(row, imfptr,
"selected_object_type", 0,
NULL, ICON_NONE);
200 uiItemR(
col, imfptr,
"use_normalized_thickness", 0,
NULL, ICON_NONE);
206 ui_gpencil_export_svg_settings(op->
layout, op->
ptr);
209 static bool wm_gpencil_export_svg_poll(
bContext *
C)
220 ot->
name =
"Export to SVG";
222 ot->
idname =
"WM_OT_gpencil_export_svg";
224 ot->
invoke = wm_gpencil_export_svg_invoke;
225 ot->
exec = wm_gpencil_export_svg_exec;
226 ot->
poll = wm_gpencil_export_svg_poll;
227 ot->
ui = wm_gpencil_export_svg_draw;
228 ot->
check = wm_gpencil_export_svg_common_check;
238 gpencil_export_common_props_definition(
ot);
244 "Clip drawings to camera size when export in camera view");
267 set_export_filepath(
C, op,
".pdf");
285 if (region ==
NULL) {
296 const short select_mode =
RNA_enum_get(op->
ptr,
"selected_object_type");
314 .select_mode = select_mode,
315 .frame_mode = frame_mode,
344 uiItemR(row, imfptr,
"selected_object_type", 0,
NULL, ICON_NONE);
352 uiItemR(sub, imfptr,
"frame_mode", 0,
IFACE_(
"Frame"), ICON_NONE);
357 uiItemR(sub, imfptr,
"stroke_sample", 0,
NULL, ICON_NONE);
358 uiItemR(sub, imfptr,
"use_fill", 0,
NULL, ICON_NONE);
359 uiItemR(sub, imfptr,
"use_normalized_thickness", 0,
NULL, ICON_NONE);
364 ui_gpencil_export_pdf_settings(op->
layout, op->
ptr);
367 static bool wm_gpencil_export_pdf_poll(
bContext *
C)
378 ot->
name =
"Export to PDF";
380 ot->
idname =
"WM_OT_gpencil_export_pdf";
382 ot->
invoke = wm_gpencil_export_pdf_invoke;
383 ot->
exec = wm_gpencil_export_pdf_exec;
384 ot->
poll = wm_gpencil_export_pdf_poll;
385 ot->
ui = wm_gpencil_export_pdf_draw;
386 ot->
check = wm_gpencil_export_pdf_common_check;
403 gpencil_export_common_props_definition(
ot);
406 gpencil_export_frame_items,
409 "Which frames to include in the export");
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
void BKE_report(ReportList *reports, eReportType type, const char *message)
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define SET_FLAG_FROM_TEST(value, test, flag)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemL(uiLayout *layout, const char *name, int icon)
uiLayout * uiLayoutBox(uiLayout *layout)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
@ GP_EXPORT_FRAME_SELECTED
bool gpencil_io_export(const char *filepath, struct GpencilIOParams *iparams)
@ GP_EXPORT_NORM_THICKNESS
struct View3D * get_invoke_view3d(struct bContext *C)
struct ARegion * get_invoke_region(struct bContext *C)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* ui)(struct bContext *, struct wmOperator *)
bool(* check)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_wait(bool val)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)