diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2022-01-21 22:37:33 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2022-01-21 22:37:33 +0300 |
commit | 54d69a2fd1be60aaba62f92cd0db5b5ba71495aa (patch) | |
tree | d940f06273fc97878290d1bd6516d3f4b18c542b /source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | |
parent | 9d274a609ca507fbd16f8daff95129281d4a24d8 (diff) |
Fix new OBJ exporter to handle instancing.
The new OBJ exporter did not handle object instances.
The fix is to use a dependency graph iterator, asking for instances.
Unfortunately that iterator makes a temporary copy of instance objects
that does not persist past the iteration, but we need to save all the
objects and meshes to write later, so the Object has to be copied now.
This changed some unit tests. Even though the tests don't have instancing,
the iterator also picks up some Text objects as Mesh ones (which is a good
thing), resulting in two more objects in the all_objects.obj file output.
Diffstat (limited to 'source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc')
-rw-r--r-- | source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc | 4 |
1 files changed, 2 insertions, 2 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 92d478c20a1..5dac913c902 100644 --- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc +++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc @@ -60,7 +60,7 @@ TEST_F(obj_exporter_test, filter_objects_curves_as_mesh) return; } auto [objmeshes, objcurves]{filter_supported_objects(depsgraph, _export.params)}; - EXPECT_EQ(objmeshes.size(), 17); + EXPECT_EQ(objmeshes.size(), 19); EXPECT_EQ(objcurves.size(), 0); } @@ -73,7 +73,7 @@ TEST_F(obj_exporter_test, filter_objects_curves_as_nurbs) } _export.params.export_curves_as_nurbs = true; auto [objmeshes, objcurves]{filter_supported_objects(depsgraph, _export.params)}; - EXPECT_EQ(objmeshes.size(), 16); + EXPECT_EQ(objmeshes.size(), 18); EXPECT_EQ(objcurves.size(), 2); } |