Blender V4.3
io_obj.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#ifdef WITH_IO_WAVEFRONT_OBJ
10
11# include "DNA_space_types.h"
12
13# include "BKE_context.hh"
14# include "BKE_file_handler.hh"
15# include "BKE_main.hh"
16# include "BKE_report.hh"
17
18# include "BLI_path_utils.hh"
19# include "BLI_string.h"
20# include "BLI_utildefines.h"
21
22# include "BLT_translation.hh"
23
24# include "ED_fileselect.hh"
25# include "ED_outliner.hh"
26
27# include "MEM_guardedalloc.h"
28
29# include "RNA_access.hh"
30# include "RNA_define.hh"
31
32# include "UI_interface.hh"
33# include "UI_resources.hh"
34
35# include "WM_api.hh"
36# include "WM_types.hh"
37
38# include "DEG_depsgraph.hh"
39
40# include "IO_orientation.hh"
41# include "IO_path_util_types.hh"
42# include "IO_wavefront_obj.hh"
43
44# include "io_obj.hh"
45# include "io_utils.hh"
46
47static const EnumPropertyItem io_obj_export_evaluation_mode[] = {
48 {DAG_EVAL_RENDER, "DAG_EVAL_RENDER", 0, "Render", "Export objects as they appear in render"},
50 "DAG_EVAL_VIEWPORT",
51 0,
52 "Viewport",
53 "Export objects as they appear in the viewport"},
54 {0, nullptr, 0, nullptr, nullptr}};
55
56static const EnumPropertyItem io_obj_path_mode[] = {
57 {PATH_REFERENCE_AUTO, "AUTO", 0, "Auto", "Use relative paths with subdirectories only"},
58 {PATH_REFERENCE_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Always write absolute paths"},
59 {PATH_REFERENCE_RELATIVE, "RELATIVE", 0, "Relative", "Write relative paths where possible"},
60 {PATH_REFERENCE_MATCH, "MATCH", 0, "Match", "Match absolute/relative setting with input path"},
61 {PATH_REFERENCE_STRIP, "STRIP", 0, "Strip", "Write filename only"},
62 {PATH_REFERENCE_COPY, "COPY", 0, "Copy", "Copy the file to the destination path"},
63 {0, nullptr, 0, nullptr, nullptr}};
64
65static int wm_obj_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
66{
68
71}
72
73static int wm_obj_export_exec(bContext *C, wmOperator *op)
74{
75 if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
76 BKE_report(op->reports, RPT_ERROR, "No filepath given");
77 return OPERATOR_CANCELLED;
78 }
79 OBJExportParams export_params{};
80 export_params.file_base_for_tests[0] = '\0';
81 RNA_string_get(op->ptr, "filepath", export_params.filepath);
82 export_params.blen_filepath = CTX_data_main(C)->filepath;
83 export_params.export_animation = RNA_boolean_get(op->ptr, "export_animation");
84 export_params.start_frame = RNA_int_get(op->ptr, "start_frame");
85 export_params.end_frame = RNA_int_get(op->ptr, "end_frame");
86
87 export_params.forward_axis = eIOAxis(RNA_enum_get(op->ptr, "forward_axis"));
88 export_params.up_axis = eIOAxis(RNA_enum_get(op->ptr, "up_axis"));
89 export_params.global_scale = RNA_float_get(op->ptr, "global_scale");
90 export_params.apply_modifiers = RNA_boolean_get(op->ptr, "apply_modifiers");
91 export_params.export_eval_mode = eEvaluationMode(RNA_enum_get(op->ptr, "export_eval_mode"));
92
93 export_params.export_selected_objects = RNA_boolean_get(op->ptr, "export_selected_objects");
94 export_params.export_uv = RNA_boolean_get(op->ptr, "export_uv");
95 export_params.export_normals = RNA_boolean_get(op->ptr, "export_normals");
96 export_params.export_colors = RNA_boolean_get(op->ptr, "export_colors");
97 export_params.export_materials = RNA_boolean_get(op->ptr, "export_materials");
98 export_params.path_mode = ePathReferenceMode(RNA_enum_get(op->ptr, "path_mode"));
99 export_params.export_triangulated_mesh = RNA_boolean_get(op->ptr, "export_triangulated_mesh");
100 export_params.export_curves_as_nurbs = RNA_boolean_get(op->ptr, "export_curves_as_nurbs");
101 export_params.export_pbr_extensions = RNA_boolean_get(op->ptr, "export_pbr_extensions");
102
103 export_params.export_object_groups = RNA_boolean_get(op->ptr, "export_object_groups");
104 export_params.export_material_groups = RNA_boolean_get(op->ptr, "export_material_groups");
105 export_params.export_vertex_groups = RNA_boolean_get(op->ptr, "export_vertex_groups");
106 export_params.export_smooth_groups = RNA_boolean_get(op->ptr, "export_smooth_groups");
107 export_params.smooth_groups_bitflags = RNA_boolean_get(op->ptr, "smooth_group_bitflags");
108
109 export_params.reports = op->reports;
110
111 RNA_string_get(op->ptr, "collection", export_params.collection);
112
113 OBJ_export(C, &export_params);
115}
116
117static void ui_obj_export_settings(const bContext *C, uiLayout *layout, PointerRNA *ptr)
118{
119 const bool export_animation = RNA_boolean_get(ptr, "export_animation");
120 const bool export_smooth_groups = RNA_boolean_get(ptr, "export_smooth_groups");
121 const bool export_materials = RNA_boolean_get(ptr, "export_materials");
122
123 uiLayoutSetPropSep(layout, true);
124 uiLayoutSetPropDecorate(layout, false);
125
126 /* Object General options. */
127 if (uiLayout *panel = uiLayoutPanel(C, layout, "OBJ_export_general", false, IFACE_("General"))) {
128 uiLayout *col = uiLayoutColumn(panel, false);
129
130 if (CTX_wm_space_file(C)) {
131 uiLayout *sub = uiLayoutColumnWithHeading(col, false, IFACE_("Include"));
132 uiItemR(
133 sub, ptr, "export_selected_objects", UI_ITEM_NONE, IFACE_("Selection Only"), ICON_NONE);
134 }
135
136 uiItemR(col, ptr, "global_scale", UI_ITEM_NONE, nullptr, ICON_NONE);
137 uiItemR(col, ptr, "forward_axis", UI_ITEM_NONE, IFACE_("Forward Axis"), ICON_NONE);
138 uiItemR(col, ptr, "up_axis", UI_ITEM_NONE, IFACE_("Up Axis"), ICON_NONE);
139 }
140
141 /* Geometry options. */
142 if (uiLayout *panel = uiLayoutPanel(C, layout, "OBJ_export_geometry", false, IFACE_("Geometry")))
143 {
144 uiLayout *col = uiLayoutColumn(panel, false);
145 uiItemR(col, ptr, "export_uv", UI_ITEM_NONE, IFACE_("UV Coordinates"), ICON_NONE);
146 uiItemR(col, ptr, "export_normals", UI_ITEM_NONE, IFACE_("Normals"), ICON_NONE);
147 uiItemR(col, ptr, "export_colors", UI_ITEM_NONE, IFACE_("Colors"), ICON_NONE);
148 uiItemR(
149 col, ptr, "export_curves_as_nurbs", UI_ITEM_NONE, IFACE_("Curves as NURBS"), ICON_NONE);
150
151 uiItemR(col,
152 ptr,
153 "export_triangulated_mesh",
155 IFACE_("Triangulated Mesh"),
156 ICON_NONE);
157 uiItemR(col, ptr, "apply_modifiers", UI_ITEM_NONE, IFACE_("Apply Modifiers"), ICON_NONE);
158 uiItemR(col, ptr, "export_eval_mode", UI_ITEM_NONE, IFACE_("Properties"), ICON_NONE);
159 }
160
161 /* Grouping options. */
162 if (uiLayout *panel = uiLayoutPanel(C, layout, "OBJ_export_grouping", false, IFACE_("Grouping")))
163 {
164 uiLayout *col = uiLayoutColumn(panel, false);
165 uiItemR(col, ptr, "export_object_groups", UI_ITEM_NONE, IFACE_("Object Groups"), ICON_NONE);
166 uiItemR(
167 col, ptr, "export_material_groups", UI_ITEM_NONE, IFACE_("Material Groups"), ICON_NONE);
168 uiItemR(col, ptr, "export_vertex_groups", UI_ITEM_NONE, IFACE_("Vertex Groups"), ICON_NONE);
169 uiItemR(col, ptr, "export_smooth_groups", UI_ITEM_NONE, IFACE_("Smooth Groups"), ICON_NONE);
170 col = uiLayoutColumn(col, false);
171 uiLayoutSetEnabled(col, export_smooth_groups);
172 uiItemR(col,
173 ptr,
174 "smooth_group_bitflags",
176 IFACE_("Smooth Group Bitflags"),
177 ICON_NONE);
178 }
179
180 /* Material options. */
181 PanelLayout panel = uiLayoutPanel(C, layout, "OBJ_export_materials", false);
182 uiLayoutSetPropSep(panel.header, false);
183 uiItemR(panel.header, ptr, "export_materials", UI_ITEM_NONE, "", ICON_NONE);
184 uiItemL(panel.header, IFACE_("Materials"), ICON_NONE);
185 if (panel.body) {
186 uiLayout *col = uiLayoutColumn(panel.body, false);
187 uiLayoutSetEnabled(col, export_materials);
188
189 uiItemR(col, ptr, "export_pbr_extensions", UI_ITEM_NONE, IFACE_("PBR Extensions"), ICON_NONE);
190 uiItemR(col, ptr, "path_mode", UI_ITEM_NONE, IFACE_("Path Mode"), ICON_NONE);
191 }
192
193 /* Animation options. */
194 panel = uiLayoutPanel(C, layout, "OBJ_export_animation", true);
195 uiLayoutSetPropSep(panel.header, false);
196 uiItemR(panel.header, ptr, "export_animation", UI_ITEM_NONE, "", ICON_NONE);
197 uiItemL(panel.header, IFACE_("Animation"), ICON_NONE);
198 if (panel.body) {
199 uiLayout *col = uiLayoutColumn(panel.body, false);
200 uiLayoutSetEnabled(col, export_animation);
201
202 uiItemR(col, ptr, "start_frame", UI_ITEM_NONE, IFACE_("Frame Start"), ICON_NONE);
203 uiItemR(col, ptr, "end_frame", UI_ITEM_NONE, IFACE_("End"), ICON_NONE);
204 }
205}
206
207static void wm_obj_export_draw(bContext *C, wmOperator *op)
208{
209 ui_obj_export_settings(C, op->layout, op->ptr);
210}
211
215static bool wm_obj_export_check(bContext *C, wmOperator *op)
216{
217 char filepath[FILE_MAX];
218 Scene *scene = CTX_data_scene(C);
219 bool changed = false;
220 RNA_string_get(op->ptr, "filepath", filepath);
221
222 if (!BLI_path_extension_check(filepath, ".obj")) {
223 BLI_path_extension_ensure(filepath, FILE_MAX, ".obj");
224 RNA_string_set(op->ptr, "filepath", filepath);
225 changed = true;
226 }
227
228 {
229 int start = RNA_int_get(op->ptr, "start_frame");
230 int end = RNA_int_get(op->ptr, "end_frame");
231 /* Set the defaults. */
232 if (start == INT_MIN) {
233 start = scene->r.sfra;
234 changed = true;
235 }
236 if (end == INT_MAX) {
237 end = scene->r.efra;
238 changed = true;
239 }
240 /* Fix user errors. */
241 if (end < start) {
242 end = start;
243 changed = true;
244 }
245 RNA_int_set(op->ptr, "start_frame", start);
246 RNA_int_set(op->ptr, "end_frame", end);
247 }
248 return changed;
249}
250
252{
253 PropertyRNA *prop;
254
255 ot->name = "Export Wavefront OBJ";
256 ot->description = "Save the scene to a Wavefront OBJ file";
257 ot->idname = "WM_OT_obj_export";
258
259 ot->invoke = wm_obj_export_invoke;
260 ot->exec = wm_obj_export_exec;
262 ot->ui = wm_obj_export_draw;
263 ot->check = wm_obj_export_check;
264
266
270 FILE_SAVE,
274
275 /* Animation options. */
277 "export_animation",
278 false,
279 "Export Animation",
280 "Export multiple frames instead of the current frame only");
282 "start_frame",
283 INT_MIN, /* wm_obj_export_check uses this to set scene->r.sfra. */
284 INT_MIN,
285 INT_MAX,
286 "Start Frame",
287 "The first frame to be exported",
288 INT_MIN,
289 INT_MAX);
291 "end_frame",
292 INT_MAX, /* wm_obj_export_check uses this to set scene->r.efra. */
293 INT_MIN,
294 INT_MAX,
295 "End Frame",
296 "The last frame to be exported",
297 INT_MIN,
298 INT_MAX);
299 /* Object transform options. */
300 prop = RNA_def_enum(
301 ot->srna, "forward_axis", io_transform_axis, IO_AXIS_NEGATIVE_Z, "Forward Axis", "");
303 prop = RNA_def_enum(ot->srna, "up_axis", io_transform_axis, IO_AXIS_Y, "Up Axis", "");
306 ot->srna,
307 "global_scale",
308 1.0f,
309 0.0001f,
310 10000.0f,
311 "Scale",
312 "Value by which to enlarge or shrink the objects with respect to the world's origin",
313 0.0001f,
314 10000.0f);
315 /* File Writer options. */
317 ot->srna, "apply_modifiers", true, "Apply Modifiers", "Apply modifiers to exported meshes");
319 "export_eval_mode",
320 io_obj_export_evaluation_mode,
322 "Object Properties",
323 "Determines properties like object visibility, modifiers etc., where they differ "
324 "for Render and Viewport");
326 "export_selected_objects",
327 false,
328 "Export Selected Objects",
329 "Export only selected objects instead of all supported objects");
330 RNA_def_boolean(ot->srna, "export_uv", true, "Export UVs", "");
332 "export_normals",
333 true,
334 "Export Normals",
335 "Export per-face normals if the face is flat-shaded, per-face-per-loop "
336 "normals if smooth-shaded");
337 RNA_def_boolean(ot->srna, "export_colors", false, "Export Colors", "Export per-vertex colors");
339 "export_materials",
340 true,
341 "Export Materials",
342 "Export MTL library. There must be a Principled-BSDF node for image textures to "
343 "be exported to the MTL file");
345 "export_pbr_extensions",
346 false,
347 "Export Materials with PBR Extensions",
348 "Export MTL library using PBR extensions (roughness, metallic, sheen, "
349 "coat, anisotropy, transmission)");
351 "path_mode",
352 io_obj_path_mode,
354 "Path Mode",
355 "Method used to reference paths");
357 "export_triangulated_mesh",
358 false,
359 "Export Triangulated Mesh",
360 "All ngons with four or more vertices will be triangulated. Meshes in "
361 "the scene will not be affected. Behaves like Triangulate Modifier with "
362 "ngon-method: \"Beauty\", quad-method: \"Shortest Diagonal\", min vertices: 4");
364 "export_curves_as_nurbs",
365 false,
366 "Export Curves as NURBS",
367 "Export curves in parametric form instead of exporting as mesh");
368
370 "export_object_groups",
371 false,
372 "Export Object Groups",
373 "Append mesh name to object name, separated by a '_'");
375 "export_material_groups",
376 false,
377 "Export Material Groups",
378 "Generate an OBJ group for each part of a geometry using a different material");
380 ot->srna,
381 "export_vertex_groups",
382 false,
383 "Export Vertex Groups",
384 "Export the name of the vertex group of a face. It is approximated "
385 "by choosing the vertex group with the most members among the vertices of a face");
387 ot->srna,
388 "export_smooth_groups",
389 false,
390 "Export Smooth Groups",
391 "Every smooth-shaded face is assigned group \"1\" and every flat-shaded face \"off\"");
393 ot->srna, "smooth_group_bitflags", false, "Generate Bitflags for Smooth Groups", "");
394
395 /* Only show `.obj` or `.mtl` files by default. */
396 prop = RNA_def_string(ot->srna, "filter_glob", "*.obj;*.mtl", 0, "Extension Filter", "");
398
399 prop = RNA_def_string(ot->srna, "collection", nullptr, MAX_IDPROP_NAME, "Collection", nullptr);
401}
402
403static int wm_obj_import_exec(bContext *C, wmOperator *op)
404{
405 OBJImportParams import_params{};
406 import_params.global_scale = RNA_float_get(op->ptr, "global_scale");
407 import_params.clamp_size = RNA_float_get(op->ptr, "clamp_size");
408 import_params.forward_axis = eIOAxis(RNA_enum_get(op->ptr, "forward_axis"));
409 import_params.up_axis = eIOAxis(RNA_enum_get(op->ptr, "up_axis"));
410 import_params.use_split_objects = RNA_boolean_get(op->ptr, "use_split_objects");
411 import_params.use_split_groups = RNA_boolean_get(op->ptr, "use_split_groups");
412 import_params.import_vertex_groups = RNA_boolean_get(op->ptr, "import_vertex_groups");
413 import_params.validate_meshes = RNA_boolean_get(op->ptr, "validate_meshes");
414 char separator[2] = {};
415 RNA_string_get(op->ptr, "collection_separator", separator);
416 import_params.collection_separator = separator[0];
417 import_params.relative_paths = ((U.flag & USER_RELPATHS) != 0);
418 import_params.clear_selection = true;
419
420 import_params.reports = op->reports;
421
423
424 if (paths.is_empty()) {
425 BKE_report(op->reports, RPT_ERROR, "No filepath given");
426 return OPERATOR_CANCELLED;
427 }
428 for (const auto &path : paths) {
429 STRNCPY(import_params.filepath, path.c_str());
430 OBJ_import(C, &import_params);
431 /* Only first import clears selection. */
432 import_params.clear_selection = false;
433 };
434
435 Scene *scene = CTX_data_scene(C);
440
441 return OPERATOR_FINISHED;
442}
443
444static void ui_obj_import_settings(const bContext *C, uiLayout *layout, PointerRNA *ptr)
445{
446 uiLayoutSetPropSep(layout, true);
447 uiLayoutSetPropDecorate(layout, false);
448
449 if (uiLayout *panel = uiLayoutPanel(C, layout, "OBJ_import_general", false, IFACE_("General"))) {
450 uiLayout *col = uiLayoutColumn(panel, false);
451 uiItemR(col, ptr, "global_scale", UI_ITEM_NONE, nullptr, ICON_NONE);
452 uiItemR(col, ptr, "clamp_size", UI_ITEM_NONE, nullptr, ICON_NONE);
453 uiItemR(col, ptr, "forward_axis", UI_ITEM_NONE, IFACE_("Forward Axis"), ICON_NONE);
454 uiItemR(col, ptr, "up_axis", UI_ITEM_NONE, IFACE_("Up Axis"), ICON_NONE);
455 }
456
457 if (uiLayout *panel = uiLayoutPanel(C, layout, "OBJ_import_options", false, IFACE_("Options"))) {
458 uiLayout *col = uiLayoutColumn(panel, false);
459 uiItemR(col, ptr, "use_split_objects", UI_ITEM_NONE, nullptr, ICON_NONE);
460 uiItemR(col, ptr, "use_split_groups", UI_ITEM_NONE, nullptr, ICON_NONE);
461 uiItemR(col, ptr, "import_vertex_groups", UI_ITEM_NONE, nullptr, ICON_NONE);
462 uiItemR(col, ptr, "validate_meshes", UI_ITEM_NONE, nullptr, ICON_NONE);
463 uiItemR(col, ptr, "collection_separator", UI_ITEM_NONE, nullptr, ICON_NONE);
464 }
465}
466
467static void wm_obj_import_draw(bContext *C, wmOperator *op)
468{
469 ui_obj_import_settings(C, op->layout, op->ptr);
470}
471
473{
474 PropertyRNA *prop;
475
476 ot->name = "Import Wavefront OBJ";
477 ot->description = "Load a Wavefront OBJ scene";
478 ot->idname = "WM_OT_obj_import";
480
482 ot->exec = wm_obj_import_exec;
484 ot->ui = wm_obj_import_draw;
485
494
496 ot->srna,
497 "global_scale",
498 1.0f,
499 0.0001f,
500 10000.0f,
501 "Scale",
502 "Value by which to enlarge or shrink the objects with respect to the world's origin",
503 0.0001f,
504 10000.0f);
506 ot->srna,
507 "clamp_size",
508 0.0f,
509 0.0f,
510 1000.0f,
511 "Clamp Bounding Box",
512 "Resize the objects to keep bounding box under this value. Value 0 disables clamping",
513 0.0f,
514 1000.0f);
515 prop = RNA_def_enum(
516 ot->srna, "forward_axis", io_transform_axis, IO_AXIS_NEGATIVE_Z, "Forward Axis", "");
518 prop = RNA_def_enum(ot->srna, "up_axis", io_transform_axis, IO_AXIS_Y, "Up Axis", "");
521 "use_split_objects",
522 true,
523 "Split By Object",
524 "Import each OBJ 'o' as a separate object");
526 "use_split_groups",
527 false,
528 "Split By Group",
529 "Import each OBJ 'g' as a separate object");
531 "import_vertex_groups",
532 false,
533 "Vertex Groups",
534 "Import OBJ groups as vertex groups");
536 ot->srna,
537 "validate_meshes",
538 true,
539 "Validate Meshes",
540 "Ensure the data is valid "
541 "(when disabled, data may be imported which causes crashes displaying or editing)");
542
544 "collection_separator",
545 nullptr,
546 2,
547 "Path Separator",
548 "Character used to separate objects name into hierarchical structure");
549
550 /* Only show `.obj` or `.mtl` files by default. */
551 prop = RNA_def_string(ot->srna, "filter_glob", "*.obj;*.mtl", 0, "Extension Filter", "");
553}
554
555namespace blender::ed::io {
557{
558 auto fh = std::make_unique<blender::bke::FileHandlerType>();
559 STRNCPY(fh->idname, "IO_FH_obj");
560 STRNCPY(fh->import_operator, "WM_OT_obj_import");
561 STRNCPY(fh->export_operator, "WM_OT_obj_export");
562 STRNCPY(fh->label, "Wavefront OBJ");
563 STRNCPY(fh->file_extensions_str, ".obj");
564 fh->poll_drop = poll_file_object_drop;
565 bke::file_handler_add(std::move(fh));
566}
567} // namespace blender::ed::io
568
569#endif /* WITH_IO_WAVEFRONT_OBJ */
SpaceFile * CTX_wm_space_file(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
bool BKE_reports_contain(ReportList *reports, eReportType level)
Definition report.cc:342
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
#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)
eEvaluationMode
@ DAG_EVAL_RENDER
@ DAG_EVAL_VIEWPORT
#define MAX_IDPROP_NAME
Definition DNA_ID.h:185
@ FILE_SORT_DEFAULT
@ FILE_BLENDER
@ FILE_TYPE_FOLDER
@ FILE_DEFAULTDISPLAY
@ USER_RELPATHS
@ OPERATOR_RUNNING_MODAL
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension)
Definition filesel.cc:1466
void ED_outliner_select_sync_from_object_tag(bContext *C)
eIOAxis
@ IO_AXIS_Y
@ IO_AXIS_NEGATIVE_Z
ePathReferenceMode
@ PATH_REFERENCE_AUTO
@ PATH_REFERENCE_RELATIVE
@ PATH_REFERENCE_COPY
@ PATH_REFERENCE_MATCH
@ PATH_REFERENCE_ABSOLUTE
@ PATH_REFERENCE_STRIP
void OBJ_import(bContext *C, const OBJImportParams *import_params)
void OBJ_export(bContext *C, const OBJExportParams *export_params)
Read Guarded memory(de)allocation.
@ PROP_HIDDEN
Definition RNA_types.hh:239
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
void uiItemL(uiLayout *layout, const char *name, int icon)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
#define UI_ITEM_NONE
PanelLayout uiLayoutPanel(const bContext *C, uiLayout *layout, const char *idname, bool default_closed)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
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_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
@ OPTYPE_PRESET
Definition WM_types.hh:175
@ OPTYPE_UNDO
Definition WM_types.hh:162
#define ND_OB_ACTIVE
Definition WM_types.hh:407
#define ND_OB_SELECT
Definition WM_types.hh:409
#define NC_SCENE
Definition WM_types.hh:345
#define ND_LAYER_CONTENT
Definition WM_types.hh:420
unsigned int U
Definition btGjkEpa3.h:78
uint col
void WM_OT_obj_import(wmOperatorType *ot)
void WM_OT_obj_export(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
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
Definition io_utils.cc:74
void obj_file_handler_add()
int filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition io_utils.cc:25
const EnumPropertyItem io_transform_axis[]
void io_ui_forward_axis_update(Main *, Scene *, PointerRNA *ptr)
void io_ui_up_axis_update(Main *, Scene *, PointerRNA *ptr)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
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_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
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)
void RNA_def_property_update_runtime(PropertyRNA *prop, RNAPropertyUpdateFunc func)
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)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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)
char filepath[1024]
Definition BKE_main.hh:136
char file_base_for_tests[FILE_MAX]
uiLayout * header
uiLayout * body
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
StructRNA * srna
Definition WM_types.hh:1080
struct ReportList * reports
struct uiLayout * layout
struct PointerRNA * ptr
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
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)
bool WM_operator_winactive(bContext *C)