53 #if defined(WITH_PUGIXML) || defined(WITH_HARU)
67 "selected_object_type",
71 "Which objects to include in the export");
78 "Precision of stroke sampling. Low values mean a more precise result, and zero "
83 "use_normalized_thickness",
86 "Export strokes with constant thickness");
96 BLI_strncpy(filepath,
"untitled",
sizeof(filepath));
126 set_export_filepath(
C, op,
".svg");
144 if (region ==
NULL) {
175 .select_mode = select_mode,
205 uiItemR(row, imfptr,
"selected_object_type", 0,
NULL, ICON_NONE);
214 uiItemR(
col, imfptr,
"use_normalized_thickness", 0,
NULL, ICON_NONE);
225 ui_gpencil_export_svg_settings(op->
layout, &
ptr);
228 static bool wm_gpencil_export_svg_poll(
bContext *
C)
239 ot->
name =
"Export to SVG";
241 ot->
idname =
"WM_OT_gpencil_export_svg";
243 ot->
invoke = wm_gpencil_export_svg_invoke;
244 ot->
exec = wm_gpencil_export_svg_exec;
245 ot->
poll = wm_gpencil_export_svg_poll;
246 ot->
ui = wm_gpencil_export_svg_draw;
247 ot->
check = wm_gpencil_export_svg_common_check;
257 gpencil_export_common_props_definition(
ot);
263 "Clip drawings to camera size when export in camera view");
286 set_export_filepath(
C, op,
".pdf");
304 if (region ==
NULL) {
315 const short select_mode =
RNA_enum_get(op->
ptr,
"selected_object_type");
333 .select_mode = select_mode,
334 .frame_mode = frame_mode,
363 uiItemR(row, imfptr,
"selected_object_type", 0,
NULL, ICON_NONE);
371 uiItemR(sub, imfptr,
"frame_mode", 0,
IFACE_(
"Frame"), ICON_NONE);
376 uiItemR(sub, imfptr,
"stroke_sample", 0,
NULL, ICON_NONE);
377 uiItemR(sub, imfptr,
"use_fill", 0,
NULL, ICON_NONE);
378 uiItemR(sub, imfptr,
"use_normalized_thickness", 0,
NULL, ICON_NONE);
388 ui_gpencil_export_pdf_settings(op->
layout, &
ptr);
391 static bool wm_gpencil_export_pdf_poll(
bContext *
C)
402 ot->
name =
"Export to PDF";
404 ot->
idname =
"WM_OT_gpencil_export_pdf";
406 ot->
invoke = wm_gpencil_export_pdf_invoke;
407 ot->
exec = wm_gpencil_export_pdf_exec;
408 ot->
poll = wm_gpencil_export_pdf_poll;
409 ot->
ui = wm_gpencil_export_pdf_draw;
410 ot->
check = wm_gpencil_export_pdf_common_check;
426 gpencil_export_common_props_definition(
ot);
429 gpencil_export_frame_items,
432 "Which frames to include in the export");
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(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, ReportType 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, const 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)
#define WM_FILESEL_SHOW_PROPS
#define WM_FILESEL_FILEPATH
bool gpencil_io_export(const char *filename, struct GpencilIOParams *iparams)
@ GP_EXPORT_FRAME_SELECTED
@ GP_EXPORT_NORM_THICKNESS
struct View3D * get_invoke_view3d(struct bContext *C)
struct ARegion * get_invoke_region(struct bContext *C)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
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
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, short action, short flag, short display, short sort)