Make some blender fields warn if missing instead of error

pull/4679/head
Turo Lamminen 2022-08-09 12:41:46 +03:00
parent d2dc0401c3
commit 1c59de42fc
2 changed files with 20 additions and 37 deletions

View File

@ -839,9 +839,9 @@ void Structure::Convert<CustomDataLayer>(
ReadField<ErrorPolicy_Fail>(dest.flag, "flag", db); ReadField<ErrorPolicy_Fail>(dest.flag, "flag", db);
ReadField<ErrorPolicy_Fail>(dest.active, "active", db); ReadField<ErrorPolicy_Fail>(dest.active, "active", db);
ReadField<ErrorPolicy_Fail>(dest.active_rnd, "active_rnd", db); ReadField<ErrorPolicy_Fail>(dest.active_rnd, "active_rnd", db);
ReadField<ErrorPolicy_Fail>(dest.active_clone, "active_clone", db); ReadField<ErrorPolicy_Warn>(dest.active_clone, "active_clone", db);
ReadField<ErrorPolicy_Fail>(dest.active_mask, "active_mask", db); ReadField<ErrorPolicy_Warn>(dest.active_mask, "active_mask", db);
ReadField<ErrorPolicy_Fail>(dest.uid, "uid", db); ReadField<ErrorPolicy_Warn>(dest.uid, "uid", db);
ReadFieldArray<ErrorPolicy_Warn>(dest.name, "name", db); ReadFieldArray<ErrorPolicy_Warn>(dest.name, "name", db);
ReadCustomDataPtr<ErrorPolicy_Fail>(dest.data, dest.type, "*data", db); ReadCustomDataPtr<ErrorPolicy_Fail>(dest.data, dest.type, "*data", db);

View File

@ -64,8 +64,7 @@ TEST_F(utBlenderImporterExporter, importBlenFromFileTest) {
TEST(utBlenderImporter, import4cubes) { TEST(utBlenderImporter, import4cubes) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/4Cubes4Mats_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, import269_regress1) { TEST(utBlenderImporter, import269_regress1) {
@ -77,22 +76,19 @@ TEST(utBlenderImporter, import269_regress1) {
TEST(utBlenderImporter, importBlenderDefault248) { TEST(utBlenderImporter, importBlenderDefault248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importBlenderDefault250) { TEST(utBlenderImporter, importBlenderDefault250) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importBlenderDefault250Compressed) { TEST(utBlenderImporter, importBlenderDefault250Compressed) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/BlenderDefault_250_Compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importBlenderDefault262) { TEST(utBlenderImporter, importBlenderDefault262) {
@ -123,92 +119,79 @@ TEST(utBlenderImporter, importBlenderDefault293) {
TEST(utBlenderImporter, importCubeHierarchy_248) { TEST(utBlenderImporter, importCubeHierarchy_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/CubeHierarchy_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importHuman) { TEST(utBlenderImporter, importHuman) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/HUMAN.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importMirroredCube_252) { TEST(utBlenderImporter, importMirroredCube_252) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/MirroredCube_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248) { TEST(utBlenderImporter, importNoisyTexturedCube_VoronoiGlob_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/NoisyTexturedCube_VoronoiGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importSmoothVsSolidCube_248) { TEST(utBlenderImporter, importSmoothVsSolidCube_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SmoothVsSolidCube_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importSuzanne_248) { TEST(utBlenderImporter, importSuzanne_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/Suzanne_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importSuzanneSubdiv_252) { TEST(utBlenderImporter, importSuzanneSubdiv_252) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/SuzanneSubdiv_252.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importTexturedCube_ImageGlob_248) { TEST(utBlenderImporter, importTexturedCube_ImageGlob_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedCube_ImageGlob_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importTexturedPlane_ImageUv_248) { TEST(utBlenderImporter, importTexturedPlane_ImageUv_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUv_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importTexturedPlane_ImageUvPacked_248) { TEST(utBlenderImporter, importTexturedPlane_ImageUvPacked_248) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TexturedPlane_ImageUvPacked_248.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importTorusLightsCams_250_compressed) { TEST(utBlenderImporter, importTorusLightsCams_250_compressed) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/TorusLightsCams_250_compressed.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, import_yxa_1) { TEST(utBlenderImporter, import_yxa_1) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/BLEND/yxa_1.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importBob) { TEST(utBlenderImporter, importBob) {
Assimp::Importer importer; Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_NONBSD_DIR "/BLEND/Bob.blend", aiProcess_ValidateDataStructure);
// FIXME: this is probably not right, loading this should succeed ASSERT_NE(nullptr, scene);
ASSERT_EQ(nullptr, scene);
} }
TEST(utBlenderImporter, importFleurOptonl) { TEST(utBlenderImporter, importFleurOptonl) {