diff options
author | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:14:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:41:13 +0300 |
commit | 9465b109af0b70244a36f9e68493e316d9f8b56f (patch) | |
tree | c4d933bf09f8313071556063156538ec3356b24c /source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc | |
parent | 026d21a225521670c6b5083da9da61227da69e65 (diff) | |
parent | ca1642cd0c5cdf634fe2022c955d93983de95934 (diff) |
Merge branch 'master' into refactor-mesh-position-genericrefactor-mesh-position-generic
Diffstat (limited to 'source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc')
-rw-r--r-- | source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc index 5c81cf7abca..5289a8c750a 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc @@ -7,8 +7,9 @@ #include <algorithm> #include <cstdio> +#include "BKE_attribute.hh" #include "BKE_blender_version.h" -#include "BKE_geometry_set.hh" +#include "BKE_mesh.h" #include "BLI_color.hh" #include "BLI_enumerable_thread_specific.hh" @@ -416,15 +417,12 @@ void OBJWriter::write_edges_indices(FormatHandler &fh, const OBJMesh &obj_mesh_data) const { /* NOTE: ensure_mesh_edges should be called before. */ - const int tot_edges = obj_mesh_data.tot_edges(); - for (int edge_index = 0; edge_index < tot_edges; edge_index++) { - const std::optional<std::array<int, 2>> vertex_indices = - obj_mesh_data.calc_loose_edge_vert_indices(edge_index); - if (!vertex_indices) { - continue; + const Span<MEdge> edges = obj_mesh_data.get_mesh()->edges(); + for (const int i : edges.index_range()) { + const MEdge &edge = edges[i]; + if (edge.flag & ME_LOOSEEDGE) { + fh.write_obj_edge(edge.v1 + offsets.vertex_offset + 1, edge.v2 + offsets.vertex_offset + 1); } - fh.write_obj_edge((*vertex_indices)[0] + offsets.vertex_offset + 1, - (*vertex_indices)[1] + offsets.vertex_offset + 1); } } |