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@nesnausk.org>2022-03-31 13:38:59 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-04-01 14:59:19 +0300
commitd120a083da1f4bbead4895209dd064d1455bc7d6 (patch)
tree7f45fcb54b7c607048a5b6dadff665a9012c82ee /source/blender/io/wavefront_obj/tests
parentb073f58a8e96ab3224c67550672a051e61a718e8 (diff)
Fix T96763: New OBJ Exporter Incorrectly saving the materials in the MTL file
Original report (T96763) only reported the issue of double-space before the texture path, but while adding test coverage I found some other issues that I fixed while at it: - Incorrectly emits two spaces between `map_Xx` keyword and the texture path, leading to some 3rd party software not finding the textures, - Emissive texture map (`map_Ke`) was not exported, - When Mapping node is used on the texture UVs, the "Location" and "Scale" values were mixed up (location written as "scale", scale written as "location). Added gtest coverage. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14519
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 7e3a9228c3b..a3512595fa7 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -486,6 +486,19 @@ TEST_F(obj_exporter_regression_test, cubes_positioned)
_export.params);
}
+/* Note: texture paths in the resulting mtl file currently are always
+ * as they are stored in the source .blend file; not relative to where
+ * the export is done. When that is properly fixed, the expected .mtl
+ * file should be updated. */
+TEST_F(obj_exporter_regression_test, cubes_with_textures)
+{
+ OBJExportParamsDefault _export;
+ compare_obj_export_to_golden("io_tests/blend_geometry/cubes_with_textures.blend",
+ "io_tests/obj/cubes_with_textures.obj",
+ "io_tests/obj/cubes_with_textures.mtl",
+ _export.params);
+}
+
TEST_F(obj_exporter_regression_test, suzanne_all_data)
{
OBJExportParamsDefault _export;