Blender V5.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
8
9#ifdef WITH_IO_GREASE_PENCIL
10
11# include "BLI_path_utils.hh"
12# include "BLI_string.hh"
13# include "BLI_string_utf8.hh"
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 {
43
44namespace ed::io {
45
46# if defined(WITH_PUGIXML) || defined(WITH_HARU)
47
48/* Definition of enum elements to export. */
49/* Common props for exporting. */
50static void grease_pencil_export_common_props_definition(wmOperatorType *ot)
51{
52 using blender::io::grease_pencil::ExportParams;
53 using SelectMode = ExportParams::SelectMode;
54 using FrameMode = ExportParams::FrameMode;
55
56 static const EnumPropertyItem select_mode_items[] = {
57 {int(SelectMode::Active), "ACTIVE", 0, "Active", "Include only the active object"},
58 {int(SelectMode::Selected), "SELECTED", 0, "Selected", "Include selected objects"},
59 {int(SelectMode::Visible), "VISIBLE", 0, "Visible", "Include all visible objects"},
60 {0, nullptr, 0, nullptr, nullptr},
61 };
62
63 static const EnumPropertyItem frame_mode_items[] = {
64 {int(FrameMode::Active), "ACTIVE", 0, "Active", "Include only active frame"},
65 {int(FrameMode::Selected), "SELECTED", 0, "Selected", "Include selected frames"},
66 {int(FrameMode::Scene), "SCENE", 0, "Scene", "Include all scene frames"},
67 {0, nullptr, 0, nullptr, nullptr},
68 };
69
70 RNA_def_boolean(ot->srna, "use_fill", true, "Fill", "Export strokes with fill enabled");
71 RNA_def_enum(ot->srna,
72 "selected_object_type",
73 select_mode_items,
74 int(SelectMode::Active),
75 "Object",
76 "Which objects to include in the export");
77 ot->prop = RNA_def_enum(ot->srna,
78 "frame_mode",
79 frame_mode_items,
80 int(FrameMode::Active),
81 "Frames",
82 "Which frames to include in the export");
83 RNA_def_float(ot->srna,
84 "stroke_sample",
85 0.0f,
86 0.0f,
87 100.0f,
88 "Sampling",
89 "Precision of stroke sampling. Low values mean a more precise result, and zero "
90 "disables sampling",
91 0.0f,
92 100.0f);
94 ot->srna, "use_uniform_width", false, "Uniform Width", "Export strokes with uniform width");
95}
96
97# endif
98
99/* Note: Region data is found using "big area" functions, rather than context. This is necessary
100 * since export operators are not always invoked from a View3D. This enables the operator to find
101 * the most relevant 3D view for projection of strokes. */
102static bool get_invoke_region(bContext *C,
103 ARegion **r_region,
104 View3D **r_view3d,
105 RegionView3D **r_rv3d)
106{
107 bScreen *screen = CTX_wm_screen(C);
108 if (screen == nullptr) {
109 return false;
110 }
111 ScrArea *area = BKE_screen_find_big_area(screen, SPACE_VIEW3D, 0);
112 if (area == nullptr) {
113 return false;
114 }
115
116 ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
117 *r_region = region;
118 *r_view3d = area->spacedata.first_as<View3D>();
119 *r_rv3d = static_cast<RegionView3D *>(region->regiondata);
120 return true;
121}
122
123} // namespace ed::io
124
125/* -------------------------------------------------------------------- */
128
129namespace ed::io {
130
131static bool grease_pencil_import_svg_check(bContext * /*C*/, wmOperator *op)
132{
133 char filepath[FILE_MAX];
134 RNA_string_get(op->ptr, "filepath", filepath);
135
136 if (!BLI_path_extension_check(filepath, ".svg")) {
137 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
138 RNA_string_set(op->ptr, "filepath", filepath);
139 return true;
140 }
141
142 return false;
143}
144
145static wmOperatorStatus grease_pencil_import_svg_exec(bContext *C, wmOperator *op)
146{
147 using blender::io::grease_pencil::ImportParams;
148 using blender::io::grease_pencil::IOContext;
149
150 Scene *scene = CTX_data_scene(C);
151
152 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false) ||
153 !RNA_struct_find_property(op->ptr, "directory"))
154 {
155 BKE_report(op->reports, RPT_ERROR, "No filepath given");
156 return OPERATOR_CANCELLED;
157 }
158
159 ARegion *region;
160 View3D *v3d;
161 RegionView3D *rv3d;
162 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
163 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
164 return OPERATOR_CANCELLED;
165 }
166
167 const int resolution = RNA_int_get(op->ptr, "resolution");
168 const float scale = RNA_float_get(op->ptr, "scale");
169 const bool use_scene_unit = RNA_boolean_get(op->ptr, "use_scene_unit");
170 const bool recenter_bounds = RNA_boolean_get(op->ptr, "recenter_bounds");
171
172 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
173 const ImportParams params = {scale, scene->r.cfra, resolution, use_scene_unit, recenter_bounds};
174
175 /* Loop all selected files to import them. All SVG imported shared the same import
176 * parameters, but they are created in separated grease pencil objects. */
177 const auto paths = ed::io::paths_from_operator_properties(op->ptr);
178 for (const auto &path : paths) {
179 /* Do Import. */
180 WM_cursor_wait(true);
181
182 const bool done = blender::io::grease_pencil::import_svg(io_context, params, path);
183 WM_cursor_wait(false);
184 if (!done) {
185 BKE_reportf(op->reports, RPT_WARNING, "Unable to import '%s'", path.c_str());
186 }
187 }
188
189 return OPERATOR_FINISHED;
190}
191
192static void grease_pencil_import_svg_draw(bContext * /*C*/, wmOperator *op)
193{
194 ui::Layout &layout = *op->layout;
195 layout.use_property_split_set(true);
196 layout.use_property_decorate_set(false);
197 ui::Layout &col = layout.box().column(false);
198 col.prop(op->ptr, "resolution", UI_ITEM_NONE, std::nullopt, ICON_NONE);
199 col.prop(op->ptr, "scale", UI_ITEM_NONE, std::nullopt, ICON_NONE);
200 col.prop(op->ptr, "use_scene_unit", UI_ITEM_NONE, std::nullopt, ICON_NONE);
201 col.prop(op->ptr, "recenter_bounds", UI_ITEM_NONE, std::nullopt, ICON_NONE);
202}
203
204static bool grease_pencil_import_svg_poll(bContext *C)
205{
206 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
207 return false;
208 }
209
210 return true;
211}
212
213} // namespace ed::io
214
216{
217 ot->name = "Import SVG as Grease Pencil";
218 ot->description = "Import SVG into Grease Pencil";
219 ot->idname = "WM_OT_grease_pencil_import_svg";
220
222 ot->exec = ed::io::grease_pencil_import_svg_exec;
223 ot->poll = ed::io::grease_pencil_import_svg_poll;
224 ot->ui = ed::io::grease_pencil_import_svg_draw;
225 ot->check = ed::io::grease_pencil_import_svg_check;
226
228
237
238 RNA_def_int(ot->srna,
239 "resolution",
240 10,
241 1,
242 100000,
243 "Resolution",
244 "Resolution of the generated strokes",
245 1,
246 20);
247
248 RNA_def_float(ot->srna,
249 "scale",
250 10.0f,
251 0.000001f,
252 1000000.0f,
253 "Scale",
254 "Scale of the final strokes",
255 0.001f,
256 100.0f);
257
258 RNA_def_boolean(ot->srna,
259 "use_scene_unit",
260 false,
261 "Scene Unit",
262 "Apply current scene's unit (as defined by unit scale) to imported data");
263
264 RNA_def_boolean(ot->srna,
265 "recenter_bounds",
266 true,
267 "Center on Bounds",
268 "Center the imported SVG on its bounding box");
269}
270
272
273/* -------------------------------------------------------------------- */
276
277# ifdef WITH_PUGIXML
278
279namespace ed::io {
280
281static bool grease_pencil_export_svg_check(bContext * /*C*/, wmOperator *op)
282{
283 char filepath[FILE_MAX];
284 RNA_string_get(op->ptr, "filepath", filepath);
285
286 if (!BLI_path_extension_check(filepath, ".svg")) {
287 BLI_path_extension_ensure(filepath, FILE_MAX, ".svg");
288 RNA_string_set(op->ptr, "filepath", filepath);
289 return true;
290 }
291
292 return false;
293}
294
295static wmOperatorStatus grease_pencil_export_svg_invoke(bContext *C,
296 wmOperator *op,
297 const wmEvent * /*event*/)
298{
300
302
304}
305
306static wmOperatorStatus grease_pencil_export_svg_exec(bContext *C, wmOperator *op)
307{
308 using blender::io::grease_pencil::ExportParams;
310 using blender::io::grease_pencil::IOContext;
311
312 Scene *scene = CTX_data_scene(C);
314
315 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
316 BKE_report(op->reports, RPT_ERROR, "No filepath given");
317 return OPERATOR_CANCELLED;
318 }
319
320 ARegion *region;
321 View3D *v3d;
322 RegionView3D *rv3d;
323 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
324 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
325 return OPERATOR_CANCELLED;
326 }
327
328 char filepath[FILE_MAX];
329 RNA_string_get(op->ptr, "filepath", filepath);
330
331 const bool export_stroke_materials = true;
332 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
333 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
334 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
335 RNA_enum_get(op->ptr, "selected_object_type"));
336 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode(
337 RNA_enum_get(op->ptr, "frame_mode"));
338 const bool use_clip_camera = RNA_boolean_get(op->ptr, "use_clip_camera");
339 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
340
341 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
342 const ExportParams params = {ob,
343 select_mode,
344 frame_mode,
345 export_stroke_materials,
346 export_fill_materials,
347 use_clip_camera,
348 use_uniform_width,
349 stroke_sample};
350
351 WM_cursor_wait(true);
353 io_context, params, *scene, filepath);
354 WM_cursor_wait(false);
355
356 switch (status) {
357 case ExportStatus::Ok:
358 break;
359 case ExportStatus::InvalidActiveObjectType:
360 BKE_report(op->reports, RPT_WARNING, "Active object is not a Grease Pencil object");
361 break;
362 case ExportStatus::NoFramesSelected:
363 BKE_report(op->reports, RPT_WARNING, "No frames selected in the Grease Pencil object");
364 break;
365 case ExportStatus::FileWriteError:
366 BKE_reportf(op->reports, RPT_WARNING, "Error during file write for \"%s\"", filepath);
367 break;
368 case ExportStatus::UnknownError:
370 break;
371 }
372
373 return OPERATOR_FINISHED;
374}
375
376enum class GreasePencilExportFiletype {
377 SVG = 0,
378 PDF = 1,
379};
380
386static void ui_gpencil_export_settings(ui::Layout &layout,
387 PointerRNA *ptr,
388 GreasePencilExportFiletype file_type)
389{
390 layout.use_property_split_set(true);
391 layout.use_property_decorate_set(false);
392
393 ui::Layout *box = &layout.box();
394
395 ui::Layout *row = &box->row(false);
396 row->label(IFACE_("Scene Options"), ICON_NONE);
397
398 row = &box->row(false);
399 row->prop(ptr, "selected_object_type", UI_ITEM_NONE, std::nullopt, ICON_NONE);
400
401 box = &layout.box();
402 row = &box->row(false);
403 row->label(IFACE_("Export Options"), ICON_NONE);
404
405 ui::Layout &col = box->column(false);
406 ui::Layout *sub = &col.column(false);
407 sub->prop(ptr, "frame_mode", UI_ITEM_NONE, IFACE_("Frame"), ICON_NONE);
408
409 box->use_property_split_set(true);
410
411 sub = &col.column(true);
412 sub->prop(ptr, "stroke_sample", UI_ITEM_NONE, std::nullopt, ICON_NONE);
413 sub->prop(ptr, "use_fill", UI_ITEM_NONE, std::nullopt, ICON_NONE);
414 sub->prop(ptr, "use_uniform_width", UI_ITEM_NONE, std::nullopt, ICON_NONE);
415
416 if (file_type == GreasePencilExportFiletype::SVG) {
417 col.prop(ptr, "use_clip_camera", UI_ITEM_NONE, std::nullopt, ICON_NONE);
418 }
419}
420
421static void grease_pencil_export_svg_draw(bContext * /*C*/, wmOperator *op)
422{
423 ui_gpencil_export_settings(*op->layout, op->ptr, GreasePencilExportFiletype::SVG);
424}
425
426static bool grease_pencil_export_svg_poll(bContext *C)
427{
428 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
429 return false;
430 }
431
432 return true;
433}
434
435} // namespace ed::io
436
437void WM_OT_grease_pencil_export_svg(wmOperatorType *ot)
438{
439 ot->name = "Export to SVG";
440 ot->description = "Export Grease Pencil to SVG";
441 ot->idname = "WM_OT_grease_pencil_export_svg";
442
443 ot->invoke = ed::io::grease_pencil_export_svg_invoke;
444 ot->exec = ed::io::grease_pencil_export_svg_exec;
445 ot->poll = ed::io::grease_pencil_export_svg_poll;
446 ot->ui = ed::io::grease_pencil_export_svg_draw;
447 ot->check = ed::io::grease_pencil_export_svg_check;
448
449 ot->flag = OPTYPE_PRESET;
450
454 FILE_SAVE,
458
459 ed::io::grease_pencil_export_common_props_definition(ot);
460
461 RNA_def_boolean(ot->srna,
462 "use_clip_camera",
463 false,
464 "Clip Camera",
465 "Clip drawings to camera size when exporting in camera view");
466}
467
468# endif /* WITH_PUGIXML */
469
471
472/* -------------------------------------------------------------------- */
475
476# ifdef WITH_HARU
477
478namespace ed::io {
479
480static bool grease_pencil_export_pdf_check(bContext * /*C*/, wmOperator *op)
481{
482
483 char filepath[FILE_MAX];
484 RNA_string_get(op->ptr, "filepath", filepath);
485
486 if (!BLI_path_extension_check(filepath, ".pdf")) {
487 BLI_path_extension_ensure(filepath, FILE_MAX, ".pdf");
488 RNA_string_set(op->ptr, "filepath", filepath);
489 return true;
490 }
491
492 return false;
493}
494
495static wmOperatorStatus grease_pencil_export_pdf_invoke(bContext *C,
496 wmOperator *op,
497 const wmEvent * /*event*/)
498{
500
502
504}
505
506static wmOperatorStatus grease_pencil_export_pdf_exec(bContext *C, wmOperator *op)
507{
508 using blender::io::grease_pencil::ExportParams;
509 using blender::io::grease_pencil::IOContext;
510
511 Scene *scene = CTX_data_scene(C);
513
514 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
515 BKE_report(op->reports, RPT_ERROR, "No filepath given");
516 return OPERATOR_CANCELLED;
517 }
518
519 ARegion *region;
520 View3D *v3d;
521 RegionView3D *rv3d;
522 if (!get_invoke_region(C, &region, &v3d, &rv3d)) {
523 BKE_report(op->reports, RPT_ERROR, "Unable to find valid 3D View area");
524 return OPERATOR_CANCELLED;
525 }
526
527 char filepath[FILE_MAX];
528 RNA_string_get(op->ptr, "filepath", filepath);
529
530 const bool export_stroke_materials = true;
531 const bool export_fill_materials = RNA_boolean_get(op->ptr, "use_fill");
532 const bool use_uniform_width = RNA_boolean_get(op->ptr, "use_uniform_width");
533 const ExportParams::SelectMode select_mode = ExportParams::SelectMode(
534 RNA_enum_get(op->ptr, "selected_object_type"));
535 const ExportParams::FrameMode frame_mode = ExportParams::FrameMode(
536 RNA_enum_get(op->ptr, "frame_mode"));
537 const bool use_clip_camera = false;
538 const float stroke_sample = RNA_float_get(op->ptr, "stroke_sample");
539
540 const IOContext io_context(*C, region, v3d, rv3d, op->reports);
541 const ExportParams params = {ob,
542 select_mode,
543 frame_mode,
544 export_stroke_materials,
545 export_fill_materials,
546 use_clip_camera,
547 use_uniform_width,
548 stroke_sample};
549
550 WM_cursor_wait(true);
551 const bool done = blender::io::grease_pencil::export_pdf(io_context, params, *scene, filepath);
552 WM_cursor_wait(false);
553
554 if (!done) {
555 BKE_report(op->reports, RPT_WARNING, "Unable to export PDF");
556 }
557
558 return OPERATOR_FINISHED;
559}
560
561static void grease_pencil_export_pdf_draw(bContext * /*C*/, wmOperator *op)
562{
563 ui_gpencil_export_settings(*op->layout, op->ptr, GreasePencilExportFiletype::PDF);
564}
565
566static bool grease_pencil_export_pdf_poll(bContext *C)
567{
568 if ((CTX_wm_window(C) == nullptr) || (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)) {
569 return false;
570 }
571
572 return true;
573}
574
575} // namespace ed::io
576
577void WM_OT_grease_pencil_export_pdf(wmOperatorType *ot)
578{
579 ot->name = "Export to PDF";
580 ot->description = "Export Grease Pencil to PDF";
581 ot->idname = "WM_OT_grease_pencil_export_pdf";
582
583 ot->invoke = ed::io::grease_pencil_export_pdf_invoke;
584 ot->exec = ed::io::grease_pencil_export_pdf_exec;
585 ot->poll = ed::io::grease_pencil_export_pdf_poll;
586 ot->ui = ed::io::grease_pencil_export_pdf_draw;
587 ot->check = ed::io::grease_pencil_export_pdf_check;
588
589 ot->flag = OPTYPE_PRESET;
590
594 FILE_SAVE,
598
599 using blender::io::grease_pencil::ExportParams;
600
601 ed::io::grease_pencil_export_common_props_definition(ot);
602}
603
604# endif /* WITH_HARU */
605
607
608namespace ed::io {
609
611{
612 auto fh = std::make_unique<bke::FileHandlerType>();
613 STRNCPY_UTF8(fh->idname, "IO_FH_grease_pencil_svg");
614 STRNCPY_UTF8(fh->import_operator, "WM_OT_grease_pencil_import_svg");
615 STRNCPY_UTF8(fh->label, "SVG as Grease Pencil");
616 STRNCPY_UTF8(fh->file_extensions_str, ".svg");
617 fh->poll_drop = poll_file_object_drop;
618 bke::file_handler_add(std::move(fh));
619}
620
621} // namespace ed::io
622} // namespace blender
623
624#endif /* WITH_IO_GREASE_PENCIL */
#define FILE_MAX
#define STRNCPY_UTF8(dst, src)
#define IFACE_(msgid)
#define C
Definition RandGen.cpp:29
#define UI_ITEM_NONE
#define BLI_assert_unreachable()
float3x3 scale(float3x3 mat, float2 scale)
void file_handler_add(std::unique_ptr< FileHandlerType > file_handler)
bool poll_file_object_drop(const bContext *C, bke::FileHandlerType *)
Definition io_utils.cc:62
void grease_pencil_file_handler_add()
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
Definition io_utils.cc:79
wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition io_utils.cc:30
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)
BMesh Iterators.
int RNA_enum_get(PointerRNA *ptr, const char *name)
@ RPT_WARNING
Definition BKE_report.hh:40
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
int RNA_int_get(PointerRNA *ptr, const char *name)
wmWindow * CTX_wm_window(const bContext *C)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
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)
@ CTX_MODE_OBJECT
bool BLI_path_extension_ensure(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:1330
@ WM_FILESEL_RELPATH
Definition WM_api.hh:1329
@ WM_FILESEL_SHOW_PROPS
Definition WM_api.hh:1335
@ WM_FILESEL_FILES
Definition WM_api.hh:1333
@ WM_FILESEL_FILEPATH
Definition WM_api.hh:1332
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension)
Definition filesel.cc:1515
void WM_OT_grease_pencil_import_svg(wmOperatorType *ot)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:1024
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 BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
@ FILE_SAVE
Definition WM_api.hh:1342
@ FILE_OPENFILE
Definition WM_api.hh:1341
bool BLI_path_extension_check(const char *path, const char *ext) ATTR_NONNULL(1
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
Definition screen.cc:1189
Scene * CTX_data_scene(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
@ OPTYPE_PRESET
Definition WM_types.hh:203
std::string RNA_string_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void WM_cursor_wait(bool val)
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)
Object * CTX_data_active_object(const bContext *C)
float RNA_float_get(PointerRNA *ptr, const char *name)
void WM_event_add_fileselect(bContext *C, wmOperator *op)