Blender V4.3
io_grease_pencil.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#ifdef WITH_IO_GREASE_PENCIL
10
11# include "BLI_path_utils.hh"
12# include "BLI_string.h"
13
14# include "DNA_space_types.h"
15# include "DNA_view3d_types.h"
16
17# include "BKE_context.hh"
18# include "BKE_file_handler.hh"
19# include "BKE_report.hh"
20# include "BKE_screen.hh"
21
22# include "BLT_translation.hh"
23
24# include "RNA_access.hh"
25# include "RNA_define.hh"
26
27# include "ED_fileselect.hh"
28
29# include "UI_interface.hh"
30# include "UI_resources.hh"
31
32# include "WM_api.hh"
33# include "WM_types.hh"
34
35# include "io_grease_pencil.hh"
36# include "io_utils.hh"
37
38# include "grease_pencil_io.hh"
39
40namespace blender::ed::io {
41
42# if defined(WITH_PUGIXML) || defined(WITH_HARU)
43
44/* Definition of enum elements to export. */
45/* Common props for exporting. */
46static void grease_pencil_export_common_props_definition(wmOperatorType *ot)
47{
49 using SelectMode = ExportParams::SelectMode;
50
51 static const EnumPropertyItem select_mode_items[] = {
52 {int(SelectMode::Active), "ACTIVE", 0, "Active", "Include only the active object"},
53 {int(SelectMode::Selected), "SELECTED", 0, "Selected", "Include selected objects"},
54 {int(SelectMode::Visible), "VISIBLE", 0, "Visible", "Include all visible objects"},
55 {0, nullptr, 0, nullptr, nullptr},
56 };
57
58 RNA_def_boolean(ot->srna, "use_fill", true, "Fill", "Export strokes with fill enabled");
60 "selected_object_type",
61 select_mode_items,
62 int(SelectMode::Active),
63 "Object",
64 "Which objects to include in the export");
66 "stroke_sample",
67 0.0f,
68 0.0f,
69 100.0f,
70 "Sampling",
71 "Precision of stroke sampling. Low values mean a more precise result, and zero "
72 "disables sampling",
73 0.0f,
74 100.0f);
76 ot->srna, "use_uniform_width", false, "Uniform Width", "Export strokes with uniform width");
77}
78
79# endif
80
81/* Note: Region data is found using "big area" functions, rather than context. This is necessary
82 * since export operators are not always invoked from a View3D. This enables the operator to find
83 * the most relevant 3D view for projection of strokes. */
84static bool get_invoke_region(bContext *C,
85 ARegion **r_region,
86 View3D **r_view3d,
87 RegionView3D **r_rv3d)
88{
89 bScreen *screen = CTX_wm_screen(C);
90 if (screen == nullptr) {
91 return false;
92 }
94 if (area == nullptr) {
95 return false;
96 }
97
99 *r_region = region;
100 *r_view3d = static_cast<View3D *>(area->spacedata.first);
101 *r_rv3d = static_cast<RegionView3D *>(region->regiondata);
102 return true;
103}
104
105} // namespace blender::ed::io
106
107/* -------------------------------------------------------------------- */
111namespace blender::ed::io {
112
113static bool grease_pencil_import_svg_check(bContext * /*C*/, wmOperator *op)
114{
115 char filepath[FILE_MAX];
116 RNA_string_get(op->ptr, "filepath", filepath);
117
118 if (!BLI_path_extension_check(filepath, ".svg")) {
119 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
120 RNA_string_set(op->ptr, "filepath", filepath);
121 return true;
122 }
123
124 return false;
125}
126
127static int grease_pencil_import_svg_exec(bContext *C, wmOperator *op)
128{
131
132 Scene *scene = CTX_data_scene(C);
133
134 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false) ||
135 !RNA_struct_find_property(op->ptr, "directory"))
136 {
137 BKE_report(op->reports, RPT_ERROR, "No filepath given");
138 return OPERATOR_CANCELLED;
139 }
140
141 ARegion *region;
142 View3D *v3d;
143 RegionView3D *rv3d;
144 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
145 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
146 return OPERATOR_CANCELLED;
147 }
148
149 const int resolution = RNA_int_get(op->ptr, "resolution");
150 const float scale = RNA_float_get(op->ptr, "scale");
151 const bool use_scene_unit = RNA_boolean_get(op->ptr, "use_scene_unit");
152 const bool recenter_bounds = true;
153
154 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
155 const ImportParams params = {scale, scene->r.cfra, resolution, use_scene_unit, recenter_bounds};
156
157 /* Loop all selected files to import them. All SVG imported shared the same import
158 * parameters, but they are created in separated grease pencil objects. */
160 for (const auto &path : paths) {
161 /* Do Import. */
162 WM_cursor_wait(true);
163
164 const bool done = blender::io::grease_pencil::import_svg(io_context, params, path);
165 WM_cursor_wait(false);
166 if (!done) {
167 BKE_reportf(op->reports, RPT_WARNING, "Unable to import '%s'", path.c_str());
168 }
169 }
170
171 return OPERATOR_FINISHED;
172}
173
174static void grease_pencil_import_svg_draw(bContext * /*C*/, wmOperator *op)
175{
176 uiLayout *layout = op->layout;
177 uiLayoutSetPropSep(layout, true);
178 uiLayoutSetPropDecorate(layout, false);
179 uiLayout *box = uiLayoutBox(layout);
180 uiLayout *col = uiLayoutColumn(box, false);
181 uiItemR(col, op->ptr, "resolution", UI_ITEM_NONE, nullptr, ICON_NONE);
182 uiItemR(col, op->ptr, "scale", UI_ITEM_NONE, nullptr, ICON_NONE);
183}
184
185static bool grease_pencil_import_svg_poll(bContext *C)
186{
187 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
188 return false;
189 }
190
191 return true;
192}
193
194} // namespace blender::ed::io
195
197{
198 ot->name = "Import SVG as Grease Pencil";
199 ot->description = "Import SVG into grease pencil";
200 ot->idname = "WM_OT_grease_pencil_import_svg";
201
203 ot->exec = blender::ed::io::grease_pencil_import_svg_exec;
204 ot->poll = blender::ed::io::grease_pencil_import_svg_poll;
205 ot->ui = blender::ed::io::grease_pencil_import_svg_draw;
206 ot->check = blender::ed::io::grease_pencil_import_svg_check;
207
216
218 "resolution",
219 10,
220 1,
221 100000,
222 "Resolution",
223 "Resolution of the generated strokes",
224 1,
225 20);
226
228 "scale",
229 10.0f,
230 0.000001f,
231 1000000.0f,
232 "Scale",
233 "Scale of the final strokes",
234 0.001f,
235 100.0f);
236
238 "use_scene_unit",
239 false,
240 "Scene Unit",
241 "Apply current scene's unit (as defined by unit scale) to imported data");
242}
243
246/* -------------------------------------------------------------------- */
250# ifdef WITH_PUGIXML
251
252namespace blender::ed::io {
253
254static bool grease_pencil_export_svg_check(bContext * /*C*/, wmOperator *op)
255{
256 char filepath[FILE_MAX];
257 RNA_string_get(op->ptr, "filepath", filepath);
258
259 if (!BLI_path_extension_check(filepath, ".svg")) {
260 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
261 RNA_string_set(op->ptr, "filepath", filepath);
262 return true;
263 }
264
265 return false;
266}
267
268static int grease_pencil_export_svg_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
269{
271
273
275}
276
277static int grease_pencil_export_svg_exec(bContext *C, wmOperator *op)
278{
281
282 Scene *scene = CTX_data_scene(C);
284
285 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
286 BKE_report(op->reports, RPT_ERROR, "No filepath given");
287 return OPERATOR_CANCELLED;
288 }
289
290 ARegion *region;
291 View3D *v3d;
292 RegionView3D *rv3d;
293 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
294 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
295 return OPERATOR_CANCELLED;
296 }
297
298 char filepath[FILE_MAX];
299 RNA_string_get(op->ptr, "filepath", filepath);
300
301 const bool export_stroke_materials = true;
302 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
303 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
304 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
305 RNA_enum_get(op->ptr, "selected_object_type"));
306 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode::Active;
307 const bool use_clip_camera = RNA_boolean_get(op->ptr, "use_clip_camera");
308 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
309
310 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
311 const ExportParams params = {ob,
312 select_mode,
313 frame_mode,
314 export_stroke_materials,
315 export_fill_materials,
316 use_clip_camera,
317 use_uniform_width,
318 stroke_sample};
319
320 WM_cursor_wait(true);
321 const bool done = blender::io::grease_pencil::export_svg(io_context, params, *scene, filepath);
322 WM_cursor_wait(false);
323
324 if (!done) {
325 BKE_report(op->reports, RPT_WARNING, "Unable to export SVG");
326 }
327
328 return OPERATOR_FINISHED;
329}
330
331static void grease_pencil_export_svg_draw(bContext * /*C*/, wmOperator *op)
332{
333 uiLayout *layout = op->layout;
334 uiLayout *box, *row;
335
336 uiLayoutSetPropSep(layout, true);
337 uiLayoutSetPropDecorate(layout, false);
338
339 box = uiLayoutBox(layout);
340
341 row = uiLayoutRow(box, false);
342 uiItemL(row, IFACE_("Scene Options"), ICON_NONE);
343
344 row = uiLayoutRow(box, false);
345 uiItemR(row, op->ptr, "selected_object_type", UI_ITEM_NONE, nullptr, ICON_NONE);
346
347 box = uiLayoutBox(layout);
348 row = uiLayoutRow(box, false);
349 uiItemL(row, IFACE_("Export Options"), ICON_NONE);
350
351 uiLayout *col = uiLayoutColumn(box, false);
352 uiItemR(col, op->ptr, "stroke_sample", UI_ITEM_NONE, nullptr, ICON_NONE);
353 uiItemR(col, op->ptr, "use_fill", UI_ITEM_NONE, nullptr, ICON_NONE);
354 uiItemR(col, op->ptr, "use_uniform_width", UI_ITEM_NONE, nullptr, ICON_NONE);
355 uiItemR(col, op->ptr, "use_clip_camera", UI_ITEM_NONE, nullptr, ICON_NONE);
356}
357
358static bool grease_pencil_export_svg_poll(bContext *C)
359{
360 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
361 return false;
362 }
363
364 return true;
365}
366
367} // namespace blender::ed::io
368
369void WM_OT_grease_pencil_export_svg(wmOperatorType *ot)
370{
371 ot->name = "Export to SVG";
372 ot->description = "Export grease pencil to SVG";
373 ot->idname = "WM_OT_grease_pencil_export_svg";
374
375 ot->invoke = blender::ed::io::grease_pencil_export_svg_invoke;
376 ot->exec = blender::ed::io::grease_pencil_export_svg_exec;
377 ot->poll = blender::ed::io::grease_pencil_export_svg_poll;
378 ot->ui = blender::ed::io::grease_pencil_export_svg_draw;
379 ot->check = blender::ed::io::grease_pencil_export_svg_check;
380
384 FILE_SAVE,
388
389 blender::ed::io::grease_pencil_export_common_props_definition(ot);
390
392 "use_clip_camera",
393 false,
394 "Clip Camera",
395 "Clip drawings to camera size when exporting in camera view");
396}
397
398# endif /* WITH_PUGIXML */
399
402/* -------------------------------------------------------------------- */
406# ifdef WITH_HARU
407
408namespace blender::ed::io {
409
410static bool grease_pencil_export_pdf_check(bContext * /*C*/, wmOperator *op)
411{
412
413 char filepath[FILE_MAX];
414 RNA_string_get(op->ptr, "filepath", filepath);
415
416 if (!BLI_path_extension_check(filepath, ".pdf")) {
417 BLI_path_extension_ensure(filepath, FILE_MAX, ".pdf");
418 RNA_string_set(op->ptr, "filepath", filepath);
419 return true;
420 }
421
422 return false;
423}
424
425static int grease_pencil_export_pdf_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
426{
428
430
432}
433
434static int grease_pencil_export_pdf_exec(bContext *C, wmOperator *op)
435{
438
439 Scene *scene = CTX_data_scene(C);
441
442 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
443 BKE_report(op->reports, RPT_ERROR, "No filepath given");
444 return OPERATOR_CANCELLED;
445 }
446
447 ARegion *region;
448 View3D *v3d;
449 RegionView3D *rv3d;
450 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
451 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
452 return OPERATOR_CANCELLED;
453 }
454
455 char filepath[FILE_MAX];
456 RNA_string_get(op->ptr, "filepath", filepath);
457
458 const bool export_stroke_materials = true;
459 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
460 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
461 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
462 RNA_enum_get(op->ptr, "selected_object_type"));
463 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode(
464 RNA_enum_get(op->ptr, "frame_mode"));
465 const bool use_clip_camera = false;
466 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
467
468 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
469 const ExportParams params = {ob,
470 select_mode,
471 frame_mode,
472 export_stroke_materials,
473 export_fill_materials,
474 use_clip_camera,
475 use_uniform_width,
476 stroke_sample};
477
478 WM_cursor_wait(true);
479 const bool done = blender::io::grease_pencil::export_pdf(io_context, params, *scene, filepath);
480 WM_cursor_wait(false);
481
482 if (!done) {
483 BKE_report(op->reports, RPT_WARNING, "Unable to export PDF");
484 }
485
486 return OPERATOR_FINISHED;
487}
488
489static void ui_gpencil_export_pdf_settings(uiLayout *layout, PointerRNA *imfptr)
490{
491 uiLayout *box, *row, *col, *sub;
492
493 uiLayoutSetPropSep(layout, true);
494 uiLayoutSetPropDecorate(layout, false);
495
496 box = uiLayoutBox(layout);
497
498 row = uiLayoutRow(box, false);
499 uiItemL(row, IFACE_("Scene Options"), ICON_NONE);
500
501 row = uiLayoutRow(box, false);
502 uiItemR(row, imfptr, "selected_object_type", UI_ITEM_NONE, nullptr, ICON_NONE);
503
504 box = uiLayoutBox(layout);
505 row = uiLayoutRow(box, false);
506 uiItemL(row, IFACE_("Export Options"), ICON_NONE);
507
508 col = uiLayoutColumn(box, false);
509 sub = uiLayoutColumn(col, true);
510 uiItemR(sub, imfptr, "frame_mode", UI_ITEM_NONE, IFACE_("Frame"), ICON_NONE);
511
512 uiLayoutSetPropSep(box, true);
513
514 sub = uiLayoutColumn(col, true);
515 uiItemR(sub, imfptr, "stroke_sample", UI_ITEM_NONE, nullptr, ICON_NONE);
516 uiItemR(sub, imfptr, "use_fill", UI_ITEM_NONE, nullptr, ICON_NONE);
517 uiItemR(sub, imfptr, "use_uniform_width", UI_ITEM_NONE, nullptr, ICON_NONE);
518}
519
520static void grease_pencil_export_pdf_draw(bContext * /*C*/, wmOperator *op)
521{
522 ui_gpencil_export_pdf_settings(op->layout, op->ptr);
523}
524
525static bool grease_pencil_export_pdf_poll(bContext *C)
526{
527 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
528 return false;
529 }
530
531 return true;
532}
533
534} // namespace blender::ed::io
535
536void WM_OT_grease_pencil_export_pdf(wmOperatorType *ot)
537{
538 ot->name = "Export to PDF";
539 ot->description = "Export grease pencil to PDF";
540 ot->idname = "WM_OT_grease_pencil_export_pdf";
541
542 ot->invoke = blender::ed::io::grease_pencil_export_pdf_invoke;
543 ot->exec = blender::ed::io::grease_pencil_export_pdf_exec;
544 ot->poll = blender::ed::io::grease_pencil_export_pdf_poll;
545 ot->ui = blender::ed::io::grease_pencil_export_pdf_draw;
546 ot->check = blender::ed::io::grease_pencil_export_pdf_check;
547
551 FILE_SAVE,
555
557
558 static const EnumPropertyItem frame_mode_items[] = {
559 {int(ExportParams::FrameMode::Active), "ACTIVE", 0, "Active", "Include only active frame"},
560 {int(ExportParams::FrameMode::Selected),
561 "SELECTED",
562 0,
563 "Selected",
564 "Include selected frames"},
565 {int(ExportParams::FrameMode::Scene), "SCENE", 0, "Scene", "Include all scene frames"},
566 {0, nullptr, 0, nullptr, nullptr},
567 };
568
569 blender::ed::io::grease_pencil_export_common_props_definition(ot);
571 "frame_mode",
572 frame_mode_items,
573 int(ExportParams::FrameMode::Active),
574 "Frames",
575 "Which frames to include in the export");
576}
577
578# endif /* WITH_HARU */
579
582namespace blender::ed::io {
583
585{
586 auto fh = std::make_unique<blender::bke::FileHandlerType>();
587 STRNCPY(fh->idname, "IO_FH_grease_pencil_svg");
588 STRNCPY(fh->import_operator, "WM_OT_grease_pencil_import_svg");
589 STRNCPY(fh->label, "SVG as Grease Pencil");
590 STRNCPY(fh->file_extensions_str, ".svg");
591 fh->poll_drop = poll_file_object_drop;
592 bke::file_handler_add(std::move(fh));
593}
594
595} // namespace blender::ed::io
596
597#endif /* WITH_IO_GREASE_PENCIL */
bScreen * CTX_wm_screen(const bContext *C)
@ CTX_MODE_OBJECT
wmWindow * CTX_wm_window(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
Definition screen.cc:903
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:815
#define FILE_MAX
bool BLI_path_extension_check(const char *path, const char *ext) ATTR_NONNULL(1
bool BLI_path_extension_ensure(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define IFACE_(msgid)
@ RGN_TYPE_WINDOW
@ FILE_SORT_DEFAULT
@ FILE_BLENDER
@ FILE_TYPE_OBJECT_IO
@ FILE_TYPE_FOLDER
@ SPACE_VIEW3D
@ FILE_DEFAULTDISPLAY
@ OPERATOR_RUNNING_MODAL
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension)
Definition filesel.cc:1466
uiLayout * uiLayoutBox(uiLayout *layout)
void uiItemL(uiLayout *layout, const char *name, int icon)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
#define UI_ITEM_NONE
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ WM_FILESEL_FILES
Definition WM_api.hh:937
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:934
@ WM_FILESEL_RELPATH
Definition WM_api.hh:933
@ WM_FILESEL_SHOW_PROPS
Definition WM_api.hh:939
@ WM_FILESEL_FILEPATH
Definition WM_api.hh:936
@ FILE_OPENFILE
Definition WM_api.hh:945
@ FILE_SAVE
Definition WM_api.hh:946
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
uint col
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void WM_OT_grease_pencil_import_svg(wmOperatorType *ot)
void file_handler_add(std::unique_ptr< FileHandlerType > file_handler)
bool poll_file_object_drop(const bContext *C, blender::bke::FileHandlerType *)
Definition io_utils.cc:57
void grease_pencil_file_handler_add()
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
Definition io_utils.cc:74
int filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition io_utils.cc:25
bool export_svg(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
bool import_svg(const IOContext &context, const ImportParams &params, StringRefNull filepath)
bool export_pdf(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
int RNA_int_get(PointerRNA *ptr, const char *name)
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, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
bool(* check)(bContext *C, wmOperator *op)
Definition WM_types.hh:1014
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
void(* ui)(bContext *C, wmOperator *op)
Definition WM_types.hh:1053
PropertyRNA * prop
Definition WM_types.hh:1092
StructRNA * srna
Definition WM_types.hh:1080
struct ReportList * reports
struct uiLayout * layout
struct PointerRNA * ptr
void WM_cursor_wait(bool val)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
wmOperatorType * ot
Definition wm_files.cc:4125
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)