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:
authorHoward Trickey <howard.trickey@gmail.com>2022-01-30 21:57:45 +0300
committerHoward Trickey <howard.trickey@gmail.com>2022-01-30 21:57:45 +0300
commitb315678feafa0372365e38394fc1a37812debfa2 (patch)
tree551da64c3e5d120c6a4e06b5f5664faa6e7bb52a
parent4fcc6514352c05f79f2c5dd35b38818b713d027d (diff)
parent07514def194a78fbb70931d5fbd002248e8f3c34 (diff)
Merge branch 'blender-v3.1-release'
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc2
-rw-r--r--source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc12
2 files changed, 13 insertions, 1 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 c1b12ddd217..14e50d726c0 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
@@ -358,7 +358,7 @@ void OBJMesh::store_normal_coords_and_indices(Vector<float3> &r_normal_coords)
*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 = is_ith_poly_smooth(poly_index);
+ bool need_per_loop_normals = lnors != nullptr || (mpoly.flag & ME_SMOOTH);
if (need_per_loop_normals) {
for (int loop_of_poly = 0; loop_of_poly < mpoly.totloop; ++loop_of_poly) {
float3 loop_normal;
diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 89e1de49511..1e2d509ef29 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -402,6 +402,18 @@ TEST_F(obj_exporter_regression_test, cube_all_data_triangulated)
_export.params);
}
+TEST_F(obj_exporter_regression_test, cube_normal_edit)
+{
+ OBJExportParamsDefault _export;
+ _export.params.forward_axis = OBJ_AXIS_Y_FORWARD;
+ _export.params.up_axis = OBJ_AXIS_Z_UP;
+ _export.params.export_materials = false;
+ compare_obj_export_to_golden("io_tests/blend_geometry/cube_normal_edit.blend",
+ "io_tests/obj/cube_normal_edit.obj",
+ "",
+ _export.params);
+}
+
TEST_F(obj_exporter_regression_test, suzanne_all_data)
{
OBJExportParamsDefault _export;