Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc')
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
index 93aba14aa0b..f43dbf39a7f 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
@@ -89,8 +89,13 @@ std::pair<Mesh *, bool> OBJMesh::triangulate_mesh_eval()
if (export_mesh_eval_->totpoly <= 0) {
return {export_mesh_eval_, false};
}
- const struct BMeshCreateParams bm_create_params = {0u};
- const struct BMeshFromMeshParams bm_convert_params = {1u, 0, 0, 0};
+ const BMeshCreateParams bm_create_params = {0u};
+ BMeshFromMeshParams bm_convert_params{};
+ bm_convert_params.calc_face_normal = true;
+ bm_convert_params.calc_vert_normal = true;
+ bm_convert_params.add_key_index = false;
+ bm_convert_params.use_shapekey = false;
+
/* Lower threshold where triangulation of a polygon starts, i.e. a quadrilateral will be
* triangulated here. */
const int triangulate_min_verts = 4;
@@ -378,8 +383,8 @@ void OBJMesh::store_normal_coords_and_indices(Vector<float3> &r_normal_coords)
normal_to_index.reserve(export_mesh_eval_->totpoly);
loop_to_normal_index_.resize(export_mesh_eval_->totloop);
loop_to_normal_index_.fill(-1);
- const float(
- *lnors)[3] = (const float(*)[3])(CustomData_get_layer(&export_mesh_eval_->ldata, CD_NORMAL));
+ const float(*lnors)[3] = (const float(*)[3])(
+ CustomData_get_layer(&export_mesh_eval_->ldata, CD_NORMAL));
for (int poly_index = 0; poly_index < export_mesh_eval_->totpoly; ++poly_index) {
const MPoly &mpoly = export_mesh_eval_->mpoly[poly_index];
bool need_per_loop_normals = lnors != nullptr || (mpoly.flag & ME_SMOOTH);