Blender V4.5
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
8
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{
48 using blender::io::grease_pencil::ExportParams;
49 using SelectMode = ExportParams::SelectMode;
50 using FrameMode = ExportParams::FrameMode;
51
52 static const EnumPropertyItem select_mode_items[] = {
53 {int(SelectMode::Active), "ACTIVE", 0, "Active", "Include only the active object"},
54 {int(SelectMode::Selected), "SELECTED", 0, "Selected", "Include selected objects"},
55 {int(SelectMode::Visible), "VISIBLE", 0, "Visible", "Include all visible objects"},
56 {0, nullptr, 0, nullptr, nullptr},
57 };
58
59 static const EnumPropertyItem frame_mode_items[] = {
60 {int(FrameMode::Active), "ACTIVE", 0, "Active", "Include only active frame"},
61 {int(FrameMode::Selected), "SELECTED", 0, "Selected", "Include selected frames"},
62 {int(FrameMode::Scene), "SCENE", 0, "Scene", "Include all scene frames"},
63 {0, nullptr, 0, nullptr, nullptr},
64 };
65
66 RNA_def_boolean(ot->srna, "use_fill", true, "Fill", "Export strokes with fill enabled");
68 "selected_object_type",
69 select_mode_items,
70 int(SelectMode::Active),
71 "Object",
72 "Which objects to include in the export");
74 "frame_mode",
75 frame_mode_items,
76 int(FrameMode::Active),
77 "Frames",
78 "Which frames to include in the export");
80 "stroke_sample",
81 0.0f,
82 0.0f,
83 100.0f,
84 "Sampling",
85 "Precision of stroke sampling. Low values mean a more precise result, and zero "
86 "disables sampling",
87 0.0f,
88 100.0f);
90 ot->srna, "use_uniform_width", false, "Uniform Width", "Export strokes with uniform width");
91}
92
93# endif
94
95/* Note: Region data is found using "big area" functions, rather than context. This is necessary
96 * since export operators are not always invoked from a View3D. This enables the operator to find
97 * the most relevant 3D view for projection of strokes. */
98static bool get_invoke_region(bContext *C,
99 ARegion **r_region,
100 View3D **r_view3d,
101 RegionView3D **r_rv3d)
102{
103 bScreen *screen = CTX_wm_screen(C);
104 if (screen == nullptr) {
105 return false;
106 }
108 if (area == nullptr) {
109 return false;
110 }
111
113 *r_region = region;
114 *r_view3d = static_cast<View3D *>(area->spacedata.first);
115 *r_rv3d = static_cast<RegionView3D *>(region->regiondata);
116 return true;
117}
118
119} // namespace blender::ed::io
120
121/* -------------------------------------------------------------------- */
124
125namespace blender::ed::io {
126
127static bool grease_pencil_import_svg_check(bContext * /*C*/, wmOperator *op)
128{
129 char filepath[FILE_MAX];
130 RNA_string_get(op->ptr, "filepath", filepath);
131
132 if (!BLI_path_extension_check(filepath, ".svg")) {
133 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
134 RNA_string_set(op->ptr, "filepath", filepath);
135 return true;
136 }
137
138 return false;
139}
140
141static wmOperatorStatus grease_pencil_import_svg_exec(bContext *C, wmOperator *op)
142{
143 using blender::io::grease_pencil::ImportParams;
144 using blender::io::grease_pencil::IOContext;
145
146 Scene *scene = CTX_data_scene(C);
147
148 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false) ||
149 !RNA_struct_find_property(op->ptr, "directory"))
150 {
151 BKE_report(op->reports, RPT_ERROR, "No filepath given");
152 return OPERATOR_CANCELLED;
153 }
154
155 ARegion *region;
156 View3D *v3d;
157 RegionView3D *rv3d;
158 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
159 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
160 return OPERATOR_CANCELLED;
161 }
162
163 const int resolution = RNA_int_get(op->ptr, "resolution");
164 const float scale = RNA_float_get(op->ptr, "scale");
165 const bool use_scene_unit = RNA_boolean_get(op->ptr, "use_scene_unit");
166 const bool recenter_bounds = true;
167
168 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
169 const ImportParams params = {scale, scene->r.cfra, resolution, use_scene_unit, recenter_bounds};
170
171 /* Loop all selected files to import them. All SVG imported shared the same import
172 * parameters, but they are created in separated grease pencil objects. */
174 for (const auto &path : paths) {
175 /* Do Import. */
176 WM_cursor_wait(true);
177
178 const bool done = blender::io::grease_pencil::import_svg(io_context, params, path);
179 WM_cursor_wait(false);
180 if (!done) {
181 BKE_reportf(op->reports, RPT_WARNING, "Unable to import '%s'", path.c_str());
182 }
183 }
184
185 return OPERATOR_FINISHED;
186}
187
188static void grease_pencil_import_svg_draw(bContext * /*C*/, wmOperator *op)
189{
190 uiLayout *layout = op->layout;
191 uiLayoutSetPropSep(layout, true);
192 uiLayoutSetPropDecorate(layout, false);
193 uiLayout *box = &layout->box();
194 uiLayout *col = &box->column(false);
195 col->prop(op->ptr, "resolution", UI_ITEM_NONE, std::nullopt, ICON_NONE);
196 col->prop(op->ptr, "scale", UI_ITEM_NONE, std::nullopt, ICON_NONE);
197}
198
199static bool grease_pencil_import_svg_poll(bContext *C)
200{
201 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
202 return false;
203 }
204
205 return true;
206}
207
208} // namespace blender::ed::io
209
211{
212 ot->name = "Import SVG as Grease Pencil";
213 ot->description = "Import SVG into Grease Pencil";
214 ot->idname = "WM_OT_grease_pencil_import_svg";
215
217 ot->exec = blender::ed::io::grease_pencil_import_svg_exec;
218 ot->poll = blender::ed::io::grease_pencil_import_svg_poll;
219 ot->ui = blender::ed::io::grease_pencil_import_svg_draw;
220 ot->check = blender::ed::io::grease_pencil_import_svg_check;
221
230
231 RNA_def_int(ot->srna,
232 "resolution",
233 10,
234 1,
235 100000,
236 "Resolution",
237 "Resolution of the generated strokes",
238 1,
239 20);
240
241 RNA_def_float(ot->srna,
242 "scale",
243 10.0f,
244 0.000001f,
245 1000000.0f,
246 "Scale",
247 "Scale of the final strokes",
248 0.001f,
249 100.0f);
250
251 RNA_def_boolean(ot->srna,
252 "use_scene_unit",
253 false,
254 "Scene Unit",
255 "Apply current scene's unit (as defined by unit scale) to imported data");
256}
257
259
260/* -------------------------------------------------------------------- */
263
264# ifdef WITH_PUGIXML
265
266namespace blender::ed::io {
267
268static bool grease_pencil_export_svg_check(bContext * /*C*/, wmOperator *op)
269{
270 char filepath[FILE_MAX];
271 RNA_string_get(op->ptr, "filepath", filepath);
272
273 if (!BLI_path_extension_check(filepath, ".svg")) {
274 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
275 RNA_string_set(op->ptr, "filepath", filepath);
276 return true;
277 }
278
279 return false;
280}
281
282static wmOperatorStatus grease_pencil_export_svg_invoke(bContext *C,
283 wmOperator *op,
284 const wmEvent * /*event*/)
285{
287
289
291}
292
293static wmOperatorStatus grease_pencil_export_svg_exec(bContext *C, wmOperator *op)
294{
295 using blender::io::grease_pencil::ExportParams;
297 using blender::io::grease_pencil::IOContext;
298
299 Scene *scene = CTX_data_scene(C);
301
302 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
303 BKE_report(op->reports, RPT_ERROR, "No filepath given");
304 return OPERATOR_CANCELLED;
305 }
306
307 ARegion *region;
308 View3D *v3d;
309 RegionView3D *rv3d;
310 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
311 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
312 return OPERATOR_CANCELLED;
313 }
314
315 char filepath[FILE_MAX];
316 RNA_string_get(op->ptr, "filepath", filepath);
317
318 const bool export_stroke_materials = true;
319 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
320 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
321 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
322 RNA_enum_get(op->ptr, "selected_object_type"));
323 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode(
324 RNA_enum_get(op->ptr, "frame_mode"));
325 const bool use_clip_camera = RNA_boolean_get(op->ptr, "use_clip_camera");
326 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
327
328 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
329 const ExportParams params = {ob,
330 select_mode,
331 frame_mode,
332 export_stroke_materials,
333 export_fill_materials,
334 use_clip_camera,
335 use_uniform_width,
336 stroke_sample};
337
338 WM_cursor_wait(true);
340 io_context, params, *scene, filepath);
341 WM_cursor_wait(false);
342
343 switch (status) {
344 case ExportStatus::Ok:
345 break;
346 case ExportStatus::InvalidActiveObjectType:
347 BKE_report(op->reports, RPT_WARNING, "Active object is not a Grease Pencil object");
348 break;
349 case ExportStatus::NoFramesSelected:
350 BKE_report(op->reports, RPT_WARNING, "No frames selected in the Grease Pencil object");
351 break;
352 case ExportStatus::FileWriteError:
353 BKE_reportf(op->reports, RPT_WARNING, "Error during file write for \"%s\"", filepath);
354 break;
355 case ExportStatus::UnknownError:
357 break;
358 }
359
360 return OPERATOR_FINISHED;
361}
362
363enum class GreasePencilExportFiletype {
364 SVG = 0,
365 PDF = 1,
366};
367
373static void ui_gpencil_export_settings(uiLayout *layout,
374 PointerRNA *ptr,
375 GreasePencilExportFiletype file_type)
376{
377 uiLayout *box, *row, *col, *sub;
378
379 uiLayoutSetPropSep(layout, true);
380 uiLayoutSetPropDecorate(layout, false);
381
382 box = &layout->box();
383
384 row = &box->row(false);
385 row->label(IFACE_("Scene Options"), ICON_NONE);
386
387 row = &box->row(false);
388 row->prop(ptr, "selected_object_type", UI_ITEM_NONE, std::nullopt, ICON_NONE);
389
390 box = &layout->box();
391 row = &box->row(false);
392 row->label(IFACE_("Export Options"), ICON_NONE);
393
394 col = &box->column(false);
395 sub = &col->column(false);
396 sub->prop(ptr, "frame_mode", UI_ITEM_NONE, IFACE_("Frame"), ICON_NONE);
397
398 uiLayoutSetPropSep(box, true);
399
400 sub = &col->column(true);
401 sub->prop(ptr, "stroke_sample", UI_ITEM_NONE, std::nullopt, ICON_NONE);
402 sub->prop(ptr, "use_fill", UI_ITEM_NONE, std::nullopt, ICON_NONE);
403 sub->prop(ptr, "use_uniform_width", UI_ITEM_NONE, std::nullopt, ICON_NONE);
404
405 if (file_type == GreasePencilExportFiletype::SVG) {
406 col->prop(ptr, "use_clip_camera", UI_ITEM_NONE, std::nullopt, ICON_NONE);
407 }
408}
409
410static void grease_pencil_export_svg_draw(bContext * /*C*/, wmOperator *op)
411{
412 ui_gpencil_export_settings(op->layout, op->ptr, GreasePencilExportFiletype::SVG);
413}
414
415static bool grease_pencil_export_svg_poll(bContext *C)
416{
417 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
418 return false;
419 }
420
421 return true;
422}
423
424} // namespace blender::ed::io
425
426void WM_OT_grease_pencil_export_svg(wmOperatorType *ot)
427{
428 ot->name = "Export to SVG";
429 ot->description = "Export Grease Pencil to SVG";
430 ot->idname = "WM_OT_grease_pencil_export_svg";
431
432 ot->invoke = blender::ed::io::grease_pencil_export_svg_invoke;
433 ot->exec = blender::ed::io::grease_pencil_export_svg_exec;
434 ot->poll = blender::ed::io::grease_pencil_export_svg_poll;
435 ot->ui = blender::ed::io::grease_pencil_export_svg_draw;
436 ot->check = blender::ed::io::grease_pencil_export_svg_check;
437
441 FILE_SAVE,
445
446 blender::ed::io::grease_pencil_export_common_props_definition(ot);
447
448 RNA_def_boolean(ot->srna,
449 "use_clip_camera",
450 false,
451 "Clip Camera",
452 "Clip drawings to camera size when exporting in camera view");
453}
454
455# endif /* WITH_PUGIXML */
456
458
459/* -------------------------------------------------------------------- */
462
463# ifdef WITH_HARU
464
465namespace blender::ed::io {
466
467static bool grease_pencil_export_pdf_check(bContext * /*C*/, wmOperator *op)
468{
469
470 char filepath[FILE_MAX];
471 RNA_string_get(op->ptr, "filepath", filepath);
472
473 if (!BLI_path_extension_check(filepath, ".pdf")) {
474 BLI_path_extension_ensure(filepath, FILE_MAX, ".pdf");
475 RNA_string_set(op->ptr, "filepath", filepath);
476 return true;
477 }
478
479 return false;
480}
481
482static wmOperatorStatus grease_pencil_export_pdf_invoke(bContext *C,
483 wmOperator *op,
484 const wmEvent * /*event*/)
485{
487
489
491}
492
493static wmOperatorStatus grease_pencil_export_pdf_exec(bContext *C, wmOperator *op)
494{
495 using blender::io::grease_pencil::ExportParams;
496 using blender::io::grease_pencil::IOContext;
497
498 Scene *scene = CTX_data_scene(C);
500
501 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
502 BKE_report(op->reports, RPT_ERROR, "No filepath given");
503 return OPERATOR_CANCELLED;
504 }
505
506 ARegion *region;
507 View3D *v3d;
508 RegionView3D *rv3d;
509 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
510 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
511 return OPERATOR_CANCELLED;
512 }
513
514 char filepath[FILE_MAX];
515 RNA_string_get(op->ptr, "filepath", filepath);
516
517 const bool export_stroke_materials = true;
518 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
519 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
520 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
521 RNA_enum_get(op->ptr, "selected_object_type"));
522 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode(
523 RNA_enum_get(op->ptr, "frame_mode"));
524 const bool use_clip_camera = false;
525 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
526
527 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
528 const ExportParams params = {ob,
529 select_mode,
530 frame_mode,
531 export_stroke_materials,
532 export_fill_materials,
533 use_clip_camera,
534 use_uniform_width,
535 stroke_sample};
536
537 WM_cursor_wait(true);
538 const bool done = blender::io::grease_pencil::export_pdf(io_context, params, *scene, filepath);
539 WM_cursor_wait(false);
540
541 if (!done) {
542 BKE_report(op->reports, RPT_WARNING, "Unable to export PDF");
543 }
544
545 return OPERATOR_FINISHED;
546}
547
548static void grease_pencil_export_pdf_draw(bContext * /*C*/, wmOperator *op)
549{
550 ui_gpencil_export_settings(op->layout, op->ptr, GreasePencilExportFiletype::PDF);
551}
552
553static bool grease_pencil_export_pdf_poll(bContext *C)
554{
555 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
556 return false;
557 }
558
559 return true;
560}
561
562} // namespace blender::ed::io
563
564void WM_OT_grease_pencil_export_pdf(wmOperatorType *ot)
565{
566 ot->name = "Export to PDF";
567 ot->description = "Export Grease Pencil to PDF";
568 ot->idname = "WM_OT_grease_pencil_export_pdf";
569
570 ot->invoke = blender::ed::io::grease_pencil_export_pdf_invoke;
571 ot->exec = blender::ed::io::grease_pencil_export_pdf_exec;
572 ot->poll = blender::ed::io::grease_pencil_export_pdf_poll;
573 ot->ui = blender::ed::io::grease_pencil_export_pdf_draw;
574 ot->check = blender::ed::io::grease_pencil_export_pdf_check;
575
579 FILE_SAVE,
583
585
586 blender::ed::io::grease_pencil_export_common_props_definition(ot);
587}
588
589# endif /* WITH_HARU */
590
592
593namespace blender::ed::io {
594
596{
597 auto fh = std::make_unique<blender::bke::FileHandlerType>();
598 STRNCPY(fh->idname, "IO_FH_grease_pencil_svg");
599 STRNCPY(fh->import_operator, "WM_OT_grease_pencil_import_svg");
600 STRNCPY(fh->label, "SVG as Grease Pencil");
601 STRNCPY(fh->file_extensions_str, ".svg");
602 fh->poll_drop = poll_file_object_drop;
603 bke::file_handler_add(std::move(fh));
604}
605
606} // namespace blender::ed::io
607
608#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:126
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
Definition screen.cc:938
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:840
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#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
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
#define IFACE_(msgid)
struct Object Object
struct Scene Scene
@ RGN_TYPE_WINDOW
struct bScreen bScreen
struct ScrArea ScrArea
struct ARegion ARegion
@ FILE_SORT_DEFAULT
@ FILE_BLENDER
@ FILE_TYPE_OBJECT_IO
@ FILE_TYPE_FOLDER
@ SPACE_VIEW3D
@ FILE_DEFAULTDISPLAY
struct RegionView3D RegionView3D
struct View3D View3D
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
struct wmOperator wmOperator
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension)
Definition filesel.cc:1490
#define C
Definition RandGen.cpp:29
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
#define UI_ITEM_NONE
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
@ WM_FILESEL_FILES
Definition WM_api.hh:1076
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:1073
@ WM_FILESEL_RELPATH
Definition WM_api.hh:1072
@ WM_FILESEL_SHOW_PROPS
Definition WM_api.hh:1078
@ WM_FILESEL_FILEPATH
Definition WM_api.hh:1075
@ FILE_OPENFILE
Definition WM_api.hh:1084
@ FILE_SAVE
Definition WM_api.hh:1085
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:58
void grease_pencil_file_handler_add()
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
Definition io_utils.cc:75
wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition io_utils.cc:26
bool import_svg(const IOContext &context, const ImportParams &params, StringRefNull filepath)
ExportStatus export_svg(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
bool export_pdf(const IOContext &context, const ExportParams &params, Scene &scene, StringRefNull filepath)
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
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)
void * regiondata
void * first
struct RenderData r
ListBase spacedata
void label(blender::StringRef name, int icon)
uiLayout & column(bool align)
uiLayout & row(bool align)
uiLayout & box()
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
PropertyRNA * prop
Definition WM_types.hh:1136
StructRNA * srna
Definition WM_types.hh:1124
struct ReportList * reports
struct uiLayout * layout
struct PointerRNA * ptr
void WM_cursor_wait(bool val)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
PointerRNA * ptr
Definition wm_files.cc:4227
wmOperatorType * ot
Definition wm_files.cc:4226
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)