46 "Vertex colors in the file are in sRGB color space"},
51 "Vertex colors in the file are in linear color space"},
52 {0,
nullptr, 0,
nullptr,
nullptr}};
118 sub = &
col->column(
false,
IFACE_(
"Include"));
147 bool changed =
false;
162 ot->name =
"Export PLY";
163 ot->description =
"Save the scene to a PLY file";
164 ot->idname =
"WM_OT_ply_export";
166 ot->invoke = wm_ply_export_invoke;
167 ot->exec = wm_ply_export_exec;
169 ot->ui = wm_ply_export_draw;
170 ot->check = wm_ply_export_check;
194 "Value by which to enlarge or shrink the objects with respect to the world's origin",
199 ot->srna,
"apply_modifiers",
true,
"Apply Modifiers",
"Apply modifiers to exported meshes");
201 "export_selected_objects",
203 "Export Selected Objects",
204 "Export only selected objects instead of all supported objects");
210 "Export only objects from this collection (and its children)");
218 "Export Vertex Normals",
219 "Export specific vertex normals if available, export calculated normals otherwise");
222 ply_vertex_colors_mode,
224 "Export Vertex Colors",
225 "Export vertex color attributes");
229 "Export Vertex Attributes",
230 "Export custom vertex attributes");
232 "export_triangulated_mesh",
234 "Export Triangulated Mesh",
235 "All ngons with four or more vertices will be triangulated. Meshes in "
236 "the scene will not be affected. Behaves like Triangulate Modifier with "
237 "ngon-method: \"Beauty\", quad-method: \"Shortest Diagonal\", min vertices: 4");
242 "Export file in ASCII format, export as binary otherwise");
245 prop =
RNA_def_string(
ot->srna,
"filter_glob",
"*.ply", 0,
"Extension Filter",
"");
264 if (paths.is_empty()) {
268 for (
const auto &path : paths) {
304 ui_ply_import_settings(
C, op->
layout, op->
ptr);
311 ot->name =
"Import PLY";
312 ot->description =
"Import an PLY file as an object";
313 ot->idname =
"WM_OT_ply_import";
316 ot->exec = wm_ply_import_exec;
317 ot->ui = wm_ply_import_draw;
330 RNA_def_float(
ot->srna,
"global_scale", 1.0f, 1e-6f, 1e6f,
"Scale",
"", 0.001f, 1000.0f);
335 "Apply current scene's unit (as defined by unit scale) to imported data");
340 RNA_def_boolean(
ot->srna,
"merge_verts",
false,
"Merge Vertices",
"Merges vertices by distance");
343 ply_vertex_colors_mode,
346 "Import vertex color attributes");
348 ot->srna,
"import_attributes",
true,
"Vertex Attributes",
"Import custom vertex attributes");
351 prop =
RNA_def_string(
ot->srna,
"filter_glob",
"*.ply", 0,
"Extension Filter",
"");
358 auto fh = std::make_unique<blender::bke::FileHandlerType>();
359 STRNCPY(fh->idname,
"IO_FH_ply");
360 STRNCPY(fh->import_operator,
"WM_OT_ply_import");
361 STRNCPY(fh->export_operator,
"WM_OT_ply_export");
362 STRNCPY(fh->label,
"Stanford PLY");
363 STRNCPY(fh->file_extensions_str,
".ply");
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)
void BKE_report(ReportList *reports, eReportType type, const char *message)
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)
void ED_fileselect_ensure_default_filepath(bContext *C, wmOperator *op, const char *extension)
void ED_outliner_select_sync_from_object_tag(bContext *C)
void PLY_import(bContext *C, const PLYImportParams ¶ms)
void PLY_export(bContext *C, const PLYExportParams ¶ms)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void WM_OT_ply_export(wmOperatorType *ot)
void WM_OT_ply_import(wmOperatorType *ot)
void file_handler_add(std::unique_ptr< FileHandlerType > file_handler)
bool poll_file_object_drop(const bContext *C, blender::bke::FileHandlerType *)
Vector< std::string > paths_from_operator_properties(PointerRNA *ptr)
wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *)
void ply_file_handler_add()
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_string_get(PointerRNA *ptr, const char *name, char *value)
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)
const char * blen_filepath
char collection[MAX_IDPROP_NAME]
ePLYVertexColorMode vertex_colors
char file_base_for_tests[FILE_MAX]
bool export_triangulated_mesh
bool export_selected_objects
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)
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)
struct ReportList * reports
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
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)