pull/5345/merge
Alexandre Avenel 2024-07-12 22:15:52 -07:00 committed by GitHub
commit 0a550b4dd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

Binary file not shown.

View File

@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/postprocess.h>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/SpatialSort.h>
using namespace Assimp;
@ -221,3 +222,25 @@ TEST(utBlenderImporter, importFleurOptonl) {
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/fleurOptonl.blend", aiProcess_ValidateDataStructure);
ASSERT_NE(nullptr, scene);
}
/// This test contains a default cube with subdivision surface modifier and a default cube with subdivision surface applied.
/// Vertices should be identical.
TEST_F(utBlenderImporterExporter, importBlendWithSubdivisionSurface) {
Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/subdivision_test_277.blend", aiProcess_ValidateDataStructure);
EXPECT_NE(nullptr, scene);
EXPECT_EQ(scene->mNumMeshes, 2u);
EXPECT_EQ(scene->mMeshes[0]->mNumVertices, scene->mMeshes[1]->mNumVertices);
SpatialSort spatialSortVertices0;
spatialSortVertices0.Fill(scene->mMeshes[0]->mVertices, scene->mMeshes[0]->mNumVertices, sizeof(aiVector3D), true);
for (unsigned int i = 0; i < scene->mMeshes[1]->mNumVertices; ++i)
{
auto positionMesh1 = scene->mMeshes[1]->mVertices[i];
std::vector<unsigned int> spatialSortResult;
spatialSortVertices0.FindPositions(positionMesh1, 1.0e-6f, spatialSortResult);
EXPECT_TRUE(scene->mMeshes[0]->mVertices[spatialSortResult[0]].Equal(positionMesh1));
}
}