utBlenderImportExport.cpp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2021, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. #include "AbstractImportExportBase.h"
  35. #include "UnitTestPCH.h"
  36. #include <assimp/postprocess.h>
  37. #include <assimp/Importer.hpp>
  38. using namespace Assimp;
  39. class utBlenderImporterExporter : public AbstractImportExportBase {
  40. public:
  41. virtual bool importerTest() {
  42. Assimp::Importer importer;
  43. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/box.blend", aiProcess_ValidateDataStructure);
  44. return nullptr != scene;
  45. }
  46. };
  47. TEST_F(utBlenderImporterExporter, importBlenFromFileTest) {
  48. EXPECT_TRUE(importerTest());
  49. }
  50. TEST(utBlenderImporter, import4cubes) {
  51. Assimp::Importer importer;
  52. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure);
  53. // FIXME: this is probably not right, loading this should succeed
  54. ASSERT_EQ(nullptr, scene);
  55. }
  56. TEST(utBlenderImporter, import269_regress1) {
  57. Assimp::Importer importer;
  58. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/blender_269_regress1.blend", aiProcess_ValidateDataStructure);
  59. ASSERT_NE(nullptr, scene);
  60. }
  61. TEST(utBlenderImporter, importBlenderDefault248) {
  62. Assimp::Importer importer;
  63. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure);
  64. // FIXME: this is probably not right, loading this should succeed
  65. ASSERT_EQ(nullptr, scene);
  66. }
  67. TEST(utBlenderImporter, importBlenderDefault250) {
  68. Assimp::Importer importer;
  69. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure);
  70. // FIXME: this is probably not right, loading this should succeed
  71. ASSERT_EQ(nullptr, scene);
  72. }
  73. TEST(utBlenderImporter, importBlenderDefault250Compressed) {
  74. Assimp::Importer importer;
  75. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure);
  76. // FIXME: this is probably not right, loading this should succeed
  77. ASSERT_EQ(nullptr, scene);
  78. }
  79. TEST(utBlenderImporter, importBlenderDefault262) {
  80. Assimp::Importer importer;
  81. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_262.blend", aiProcess_ValidateDataStructure);
  82. // FIXME: this is probably not right, loading this should succeed
  83. ASSERT_EQ(nullptr, scene);
  84. }
  85. TEST(utBlenderImporter, importBlenderDefault269) {
  86. Assimp::Importer importer;
  87. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_269.blend", aiProcess_ValidateDataStructure);
  88. ASSERT_NE(nullptr, scene);
  89. }
  90. TEST(utBlenderImporter, importBlenderDefault271) {
  91. Assimp::Importer importer;
  92. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_271.blend", aiProcess_ValidateDataStructure);
  93. ASSERT_NE(nullptr, scene);
  94. }
  95. TEST(utBlenderImporter, importCubeHierarchy_248) {
  96. Assimp::Importer importer;
  97. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure);
  98. // FIXME: this is probably not right, loading this should succeed
  99. ASSERT_EQ(nullptr, scene);
  100. }
  101. TEST(utBlenderImporter, importHuman) {
  102. Assimp::Importer importer;
  103. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure);
  104. // FIXME: this is probably not right, loading this should succeed
  105. ASSERT_EQ(nullptr, scene);
  106. }
  107. TEST(utBlenderImporter, importMirroredCube_252) {
  108. Assimp::Importer importer;
  109. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure);
  110. // FIXME: this is probably not right, loading this should succeed
  111. ASSERT_EQ(nullptr, scene);
  112. }
  113. TEST(utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248) {
  114. Assimp::Importer importer;
  115. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure);
  116. // FIXME: this is probably not right, loading this should succeed
  117. ASSERT_EQ(nullptr, scene);
  118. }
  119. TEST(utBlenderImporter, importSmoothVsSolidCube_248) {
  120. Assimp::Importer importer;
  121. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure);
  122. // FIXME: this is probably not right, loading this should succeed
  123. ASSERT_EQ(nullptr, scene);
  124. }
  125. TEST(utBlenderImporter, importSuzanne_248) {
  126. Assimp::Importer importer;
  127. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure);
  128. // FIXME: this is probably not right, loading this should succeed
  129. ASSERT_EQ(nullptr, scene);
  130. }
  131. TEST(utBlenderImporter, importSuzanneSubdiv_252) {
  132. Assimp::Importer importer;
  133. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure);
  134. // FIXME: this is probably not right, loading this should succeed
  135. ASSERT_EQ(nullptr, scene);
  136. }
  137. TEST(utBlenderImporter, importTexturedCube_ImageGlob_248) {
  138. Assimp::Importer importer;
  139. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure);
  140. // FIXME: this is probably not right, loading this should succeed
  141. ASSERT_EQ(nullptr, scene);
  142. }
  143. TEST(utBlenderImporter, importTexturedPlane_ImageUv_248) {
  144. Assimp::Importer importer;
  145. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure);
  146. // FIXME: this is probably not right, loading this should succeed
  147. ASSERT_EQ(nullptr, scene);
  148. }
  149. TEST(utBlenderImporter, importTexturedPlane_ImageUvPacked_248) {
  150. Assimp::Importer importer;
  151. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure);
  152. // FIXME: this is probably not right, loading this should succeed
  153. ASSERT_EQ(nullptr, scene);
  154. }
  155. TEST(utBlenderImporter, importTorusLightsCams_250_compressed) {
  156. Assimp::Importer importer;
  157. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure);
  158. // FIXME: this is probably not right, loading this should succeed
  159. ASSERT_EQ(nullptr, scene);
  160. }
  161. TEST(utBlenderImporter, import_yxa_1) {
  162. Assimp::Importer importer;
  163. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure);
  164. // FIXME: this is probably not right, loading this should succeed
  165. ASSERT_EQ(nullptr, scene);
  166. }
  167. TEST(utBlenderImporter, importBob) {
  168. Assimp::Importer importer;
  169. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure);
  170. // FIXME: this is probably not right, loading this should succeed
  171. ASSERT_EQ(nullptr, scene);
  172. }
  173. TEST(utBlenderImporter, importFleurOptonl) {
  174. Assimp::Importer importer;
  175. const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/fleurOptonl.blend", aiProcess_ValidateDataStructure);
  176. ASSERT_NE(nullptr, scene);
  177. }