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:
authorAras Pranckevicius <aras_p>2022-03-20 15:59:16 +0300
committerHoward Trickey <howard.trickey@gmail.com>2022-03-20 15:59:16 +0300
commitb9123b806fc4d17d684c0cc7057c0d3c7136d067 (patch)
tree44179fc1a116f7198fdfbc1e5e8c036be4a52420 /source/blender/io/wavefront_obj/tests
parent5bfdaaa80082be12af9850a2af294823005abb72 (diff)
Fix T96470 new obj exporter writing material groups
This is patch D14349 from Aras Pranckevicius. The logic in the code was _completely different_ from the documentation and what the python exporter in 3.0 did. The new code assumed that "export material groups" meant "append material name to the object name", and was only ever kicking in when the "export object groups" option was also checked. But the proper behavior (as in 3.0 exporter & the online docs), is to emit g objectname_materialname before each usemtl line. Which is something entirely else.
Diffstat (limited to 'source/blender/io/wavefront_obj/tests')
-rw-r--r--source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc13
1 files changed, 13 insertions, 0 deletions
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 e96a7d28561..b8fecfb25f3 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -511,4 +511,17 @@ TEST_F(obj_exporter_regression_test, all_objects)
_export.params);
}
+TEST_F(obj_exporter_regression_test, all_objects_mat_groups)
+{
+ OBJExportParamsDefault _export;
+ _export.params.forward_axis = OBJ_AXIS_Y_FORWARD;
+ _export.params.up_axis = OBJ_AXIS_Z_UP;
+ _export.params.export_smooth_groups = true;
+ _export.params.export_material_groups = true;
+ compare_obj_export_to_golden("io_tests/blend_scene/all_objects.blend",
+ "io_tests/obj/all_objects_mat_groups.obj",
+ "io_tests/obj/all_objects_mat_groups.mtl",
+ _export.params);
+}
+
} // namespace blender::io::obj