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