@ -115,183 +115,233 @@ const struct {
const char * expected2 ;
Containers : : String message ;
} ConvertData [ ] {
{ " one mesh " , Containers : : array < Containers : : String > ( {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh " , { InPlaceInit , {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one mesh, whole scene converter " , Containers : : array < Containers : : String > ( {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one mesh, whole scene converter " , { InPlaceInit , {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" ObjImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.gltf " , " quad.bin " ,
{ } } ,
{ " one mesh, explicit importer and converter " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, explicit importer and converter " , { InPlaceInit , {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one mesh, map " , Containers : : array < Containers : : String > ( {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, map " , { InPlaceInit , {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one mesh, options " , Containers : : array < Containers : : String > ( {
/* It's silly, but since we have option propagation tested in
AnySceneImporter / AnySceneConverter . cpp already , it ' s enough to
just verify the ( nonexistent ) options arrive there */
" -i " , " nonexistentOption=13 " , " -c " , " nonexistentConverterOption=26 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, options " , { InPlaceInit , {
/* It's silly, but since we have option propagation tested in
AnySceneImporter / AnySceneConverter . cpp already , it ' s enough
to just verify the ( nonexistent ) options arrive there */
" -i " , " nonexistentOption=13 " , " -c " , " nonexistentConverterOption=26 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Trade::AnySceneImporter::openFile(): option nonexistentOption not recognized by ObjImporter \n "
" Trade::AnySceneConverter::beginFile(): option nonexistentConverterOption not recognized by StanfordSceneConverter \n " } ,
{ " one mesh, options, explicit importer and converter " , Containers : : array < Containers : : String > ( {
/* Same here, since we have option propagation tested in
Magnum / Test / ConverterUtilitiesTest . cpp already , to verify it ' s
getting called we can just supply nonexistent options */
" -i " , " nonexistentOption=13 " , " -c " , " nonexistentConverterOption=26 " ,
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, options, explicit importer and converter " , { InPlaceInit , {
/* Same here, since we have option propagation tested in
Magnum / Test / ConverterUtilitiesTest . cpp already , to verify it ' s
getting called we can just supply nonexistent options */
" -i " , " nonexistentOption=13 " , " -c " , " nonexistentConverterOption=26 " ,
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Option nonexistentOption not recognized by ObjImporter \n "
" Option nonexistentConverterOption not recognized by StanfordSceneConverter \n " } ,
{ " two meshes + scene " , Containers : : array < Containers : : String > ( {
/* Removing the generator identifier to have the file fully roundtrip */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " ) } ) ,
{ " two meshes + scene " , { InPlaceInit , {
/* Removing the generator identifier to have the file fully roundtrip */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
/* There should be a minimal difference compared to the original */
" two-quads.gltf " , " two-quads.bin " ,
{ } } ,
{ " concatenate meshes without a scene " , Containers : : array < Containers : : String > ( {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " ) } ) ,
{ " concatenate meshes without a scene " , { InPlaceInit , {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad-duplicates.ply " , nullptr ,
{ } } ,
{ " concatenate meshes with a scene " , Containers : : array < Containers : : String > ( {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles-transformed.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " ) } ) ,
{ " concatenate meshes with a scene " , { InPlaceInit , {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles-transformed.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " )
} } ,
" GltfImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad-duplicates.ply " , nullptr ,
{ } } ,
{ " concatenate meshes with a scene but no default scene " , Containers : : array < Containers : : String > ( {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles-transformed-no-default-scene.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " ) } ) ,
{ " concatenate meshes with a scene but no default scene " , { InPlaceInit , {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles-transformed-no-default-scene.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-duplicates.ply " )
} } ,
" GltfImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad-duplicates.ply " , nullptr ,
{ } } ,
/** @todo drop --mesh once it's not needed anymore again, then add a
multi - mesh variant */
{ " one mesh, filter mesh attributes " , Containers : : array < Containers : : String > ( {
/* Only 0 gets picked from here, others ignored */
" --mesh " , " 0 " , " --only-mesh-attributes " , " 17,0,25-36 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-normals-texcoords.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, filter mesh attributes " , { InPlaceInit , {
/* Only 0 gets picked from here, others ignored */
" --mesh " , " 0 " , " --only-mesh-attributes " , " 17,0,25-36 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-normals-texcoords.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " concatenate meshes, filter mesh attributes " , Containers : : array < Containers : : String > ( {
" --concatenate-meshes " , " --only-mesh-attributes " , " 17,0,25-36 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-normals-texcoords.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " concatenate meshes, filter mesh attributes " , { InPlaceInit , {
" --concatenate-meshes " , " --only-mesh-attributes " , " 17,0,25-36 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-normals-texcoords.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one implicit mesh, remove vertex duplicates " , Containers : : array < Containers : : String > ( {
" --remove-duplicate-vertices " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, remove vertex duplicates " , { InPlaceInit , {
" --remove-duplicate-vertices " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one implicit mesh, remove duplicate vertices, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices " , " -v " , " -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, remove duplicate vertices, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices " , " -v " , " -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Mesh 0 duplicate removal: 6 -> 4 vertices \n " } ,
{ " one selected mesh, remove duplicate vertices, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --mesh " , " 1 " , " --remove-duplicate-vertices " , " -v " , " -I " , " GltfImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one selected mesh, remove duplicate vertices, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --mesh " , " 1 " , " --remove-duplicate-vertices " , " -v " ,
" -I " , " GltfImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" GltfImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
/* The second mesh in the glTF is deliberately the same as in
quad - duplicates . obj , so this produces the same file */
" quad.ply " , nullptr ,
" Duplicate removal: 6 -> 4 vertices \n " } ,
{ " two meshes + scene, remove duplicate vertices, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices " , " -v " , " -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
/* Removing the generator identifier for a smaller file */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " ) } ) ,
{ " two meshes + scene, remove duplicate vertices, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices " , " -v " , " -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
/* Removing the generator identifier for a smaller file */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
/* There should be a minimal difference compared to the original */
" two-quads.gltf " , " two-quads.bin " ,
" Mesh 0 duplicate removal: 5 -> 4 vertices \n "
" Mesh 1 duplicate removal: 6 -> 4 vertices \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding scene 0 out of 1 \n " } ,
{ " one implicit mesh, remove duplicate vertices fuzzy " , Containers : : array < Containers : : String > ( {
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates-fuzzy.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, remove duplicate vertices fuzzy " , { InPlaceInit , {
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates-fuzzy.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
{ } } ,
{ " one implicit mesh, remove duplicate vertices fuzzy, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " , " -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates-fuzzy.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, remove duplicate vertices fuzzy, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " ,
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates-fuzzy.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Mesh 0 fuzzy duplicate removal: 6 -> 4 vertices \n " } ,
{ " one selected mesh, remove duplicate vertices fuzzy, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --mesh 1 " , " --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " , " -I " , " GltfImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates-fuzzy.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one selected mesh, remove duplicate vertices fuzzy, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --mesh 1 " , " --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " ,
" -I " , " GltfImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates-fuzzy.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" GltfImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
/* The second mesh in the glTF is deliberately the same as in
quad - duplicates - fuzzy . obj , so this produces the same file */
" quad.ply " , nullptr ,
" Fuzzy duplicate removal: 6 -> 4 vertices \n " } ,
{ " two meshes + scene, remove duplicate vertices fuzzy, verbose " , Containers : : array < Containers : : String > ( {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " , " -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
/* Removing the generator identifier for a smaller file */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates-fuzzy.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " ) } ) ,
{ " two meshes + scene, remove duplicate vertices fuzzy, verbose " , { InPlaceInit , {
/* Forcing the importer and converter to avoid AnySceneImporter /
AnySceneConverter delegation messages */
" --remove-duplicate-vertices-fuzzy " , " 1.0e-1 " , " -v " ,
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
/* Removing the generator identifier for a smaller file */
" -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads-duplicates-fuzzy.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" two-quads.gltf " , " two-quads.bin " ,
" Mesh 0 fuzzy duplicate removal: 5 -> 4 vertices \n "
" Mesh 1 fuzzy duplicate removal: 6 -> 4 vertices \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding scene 0 out of 1 \n " } ,
{ " one implicit mesh, two converters " , Containers : : array < Containers : : String > ( {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters " , { InPlaceInit , {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.gltf " , " quad.bin " ,
{ } } ,
{ " one implicit mesh, two converters, explicit last " , Containers : : array < Containers : : String > ( {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " , " -C " , " GltfSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters, explicit last " , { InPlaceInit , {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " , " -C " , " GltfSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.gltf " , " quad.bin " ,
{ } } ,
{ " one implicit mesh, two converters, verbose " , Containers : : array < Containers : : String > ( {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters, verbose " , { InPlaceInit , {
/* Not removing the generator identifier in this case as we want to
test passing no options */
" -C " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.gltf " , " quad.bin " ,
/* While this looks like a no-op in the output, it converts a
@ -315,9 +365,11 @@ const struct {
" overdraw 1 -> 1 \n "
" Trade::AnySceneConverter::beginFile(): using GltfSceneConverter \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding mesh 0 out of 1 \n " } ,
{ " one implicit mesh, two converters, explicit last, verbose " , Containers : : array < Containers : : String > ( {
" -C " , " MeshOptimizerSceneConverter " , " -C " , " GltfSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters, explicit last, verbose " , { InPlaceInit , {
" -C " , " MeshOptimizerSceneConverter " , " -C " , " GltfSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.gltf " , " quad.bin " ,
/* As the importers and converters are specified explicitly, there's
@ -341,44 +393,53 @@ const struct {
" overdraw 1 -> 1 \n "
" Saving output (2/2) with GltfSceneConverter... \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding mesh 0 out of 1 \n " } ,
{ " one implicit mesh, two converters, options for the first only " , Containers : : array < Containers : : String > ( {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, two converters, options for the first only " , { InPlaceInit , {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Option nonexistentMeshOptimizerOption not recognized by MeshOptimizerSceneConverter \n " } ,
{ " one implicit mesh, two converters, explicit last, options for the first only " , Containers : : array < Containers : : String > ( {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one implicit mesh, two converters, explicit last, options for the first only " , { InPlaceInit , {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Option nonexistentMeshOptimizerOption not recognized by MeshOptimizerSceneConverter \n " } ,
{ " one implicit mesh, two converters, options for both " , Containers : : array < Containers : : String > ( {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -c " , " nonexistentAnyConverterOption=no " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters, options for both " , { InPlaceInit , {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -c " , " nonexistentAnyConverterOption=no " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Option nonexistentMeshOptimizerOption not recognized by MeshOptimizerSceneConverter \n "
" Trade::AnySceneConverter::beginFile(): option nonexistentAnyConverterOption not recognized by GltfSceneConverter \n " } ,
{ " one implicit mesh, two converters, explicit last, options for both " , Containers : : array < Containers : : String > ( {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -C " , " StanfordSceneConverter " ,
" -c " , " nonexistentStanfordConverterOption=no " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " one implicit mesh, two converters, explicit last, options for both " , { InPlaceInit , {
" -C " , " MeshOptimizerSceneConverter " ,
" -c " , " nonexistentMeshOptimizerOption=yes " ,
" -C " , " StanfordSceneConverter " ,
" -c " , " nonexistentStanfordConverterOption=no " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Option nonexistentMeshOptimizerOption not recognized by MeshOptimizerSceneConverter \n "
" Option nonexistentStanfordConverterOption not recognized by StanfordSceneConverter \n " } ,
{ " one mesh, remove duplicate vertices, two converters, verbose " , Containers : : array < Containers : : String > ( {
" --remove-duplicate-vertices " ,
" -C " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " ) } ) ,
{ " one mesh, remove duplicate vertices, two converters, verbose " , { InPlaceInit , {
" --remove-duplicate-vertices " ,
" -C " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-duplicates.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , { } , nullptr ,
" quad.ply " , nullptr ,
" Trade::AnySceneImporter::openFile(): using ObjImporter \n "
@ -403,11 +464,13 @@ const struct {
" overdraw 1 -> 1 \n "
" Trade::AnySceneConverter::beginFile(): using StanfordSceneConverter \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding mesh 0 out of 1 \n " } ,
{ " implicit custom-processed mesh with a name and custom attributes " , Containers : : array < Containers : : String > ( {
/* Removing the generator identifier to have the file closer to the
original */
" --remove-duplicate-vertices " , " -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-name-custom-attributes-duplicates.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-name-custom-attributes.gltf " ) } ) ,
{ " implicit custom-processed mesh with a name and custom attributes " , { InPlaceInit , {
/* Removing the generator identifier to have the file closer to the
original */
" --remove-duplicate-vertices " , " -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-name-custom-attributes-duplicates.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-name-custom-attributes.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
/* The output should be mostly the same, except that there's now only 4
vertices instead of 6. The code that adds meshes manually instead of
@ -415,11 +478,13 @@ const struct {
mesh names and custom attributes as well . */
" quad-name-custom-attributes.gltf " , " quad-name-custom-attributes.bin " ,
{ } } ,
{ " selected custom-processed mesh with a name and custom attributes " , Containers : : array < Containers : : String > ( {
/* Removing the generator identifier to have the file closer to the
original */
" --mesh " , " 0 " , " --remove-duplicate-vertices " , " -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-name-custom-attributes-duplicates.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-name-custom-attributes.gltf " ) } ) ,
{ " selected custom-processed mesh with a name and custom attributes " , { InPlaceInit , {
/* Removing the generator identifier to have the file closer to the
original */
" --mesh " , " 0 " , " --remove-duplicate-vertices " , " -c " , " generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-name-custom-attributes-duplicates.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad-name-custom-attributes.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " , { } , nullptr ,
/* The output should be mostly the same, except that there's now only 4
vertices instead of 6. The code that adds meshes manually instead of
@ -427,9 +492,11 @@ const struct {
mesh names and custom attributes as well . */
" quad-name-custom-attributes.gltf " , " quad-name-custom-attributes.bin " ,
{ } } ,
{ " mesh converter " , Containers : : array < Containers : : String > ( {
" -M " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " mesh converter " , { InPlaceInit , {
" -M " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " ,
{ } , " MeshOptimizerSceneConverter " ,
/* Converts a triangle strip to indexed triangles, which verifies that
@ -437,11 +504,13 @@ const struct {
further and not discarded */
" quad.gltf " , " quad.bin " ,
{ } } ,
{ " mesh converter, two meshes, verbose " , Containers : : array < Containers : : String > ( {
/* Removing the generator identifier for a smaller file */
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " , " -c " , " generator= " ,
" -M " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " ) } ) ,
{ " mesh converter, two meshes, verbose " , { InPlaceInit , {
/* Removing the generator identifier for a smaller file */
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " , " -c " , " generator= " ,
" -M " , " MeshOptimizerSceneConverter " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-quads.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/two-quads.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " ,
{ } , " MeshOptimizerSceneConverter " ,
" two-quads.gltf " , " two-quads.bin " ,
@ -474,13 +543,15 @@ const struct {
" 65536 -> 65536 covered pixels \n "
" overdraw 1 -> 1 \n "
" Trade::AbstractSceneConverter::addImporterContents(): adding scene 0 out of 1 \n " } ,
{ " two mesh converters, two options, one mesh, verbose " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -M " , " MeshOptimizerSceneConverter " ,
" -m " , " nonexistentFirstOption=yes " ,
" -M " , " MeshOptimizerSceneConverter " ,
" -m " , " nonexistentSecondOption=yes " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " ) } ) ,
{ " two mesh converters, two options, one mesh, verbose " , { InPlaceInit , {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -M " , " MeshOptimizerSceneConverter " ,
" -m " , " nonexistentFirstOption=yes " ,
" -M " , " MeshOptimizerSceneConverter " ,
" -m " , " nonexistentSecondOption=yes " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/quad-strip.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/quad.gltf " )
} } ,
" GltfImporter " , nullptr , " GltfSceneConverter " ,
{ } , " MeshOptimizerSceneConverter " ,
" quad.gltf " , " quad.bin " ,
@ -514,23 +585,27 @@ const struct {
" 65536 -> 65536 shaded pixels \n "
" 65536 -> 65536 covered pixels \n "
" overdraw 1 -> 1 \n " } ,
{ " 2D image converter, two images " , Containers : : array < Containers : : String > ( {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling the
images to avoid having too many files */
" -c " , " bundleImages,generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " ) } ) ,
{ " 2D image converter, two images " , { InPlaceInit , {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling
the images to avoid having too many files */
" -c " , " bundleImages,generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " )
} } ,
" GltfImporter " , " PngImporter " , " GltfSceneConverter " ,
{ " StbResizeImageConverter " , " PngImageConverter " } , nullptr ,
" images-2d-1x1.gltf " , " images-2d-1x1.bin " ,
{ } } ,
{ " 2D image converter, two images, verbose " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling the
images to avoid having too many files */
" -c " , " bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " ) } ) ,
{ " 2D image converter, two images, verbose " , { InPlaceInit , {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling
the images to avoid having too many files */
" -c " , " bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " )
} } ,
" GltfImporter " , " PngImporter " , " GltfSceneConverter " ,
{ " StbResizeImageConverter " , " PngImageConverter " } , nullptr ,
" images-2d-1x1.gltf " , " images-2d-1x1.bin " ,
@ -538,14 +613,16 @@ const struct {
" Processing 2D image 0 with StbResizeImageConverter... \n "
" Trade::AnyImageImporter::openFile(): using PngImporter \n "
" Processing 2D image 1 with StbResizeImageConverter... \n " } ,
{ " two 2D image converters, two images, verbose " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 2 2 \" " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling the
images to avoid having too many files */
" -c " , " bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " ) } ) ,
{ " two 2D image converters, two images, verbose " , { InPlaceInit , {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 2 2 \" " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling
the images to avoid having too many files */
" -c " , " bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-2d-1x1.gltf " )
} } ,
" GltfImporter " , " PngImporter " , " GltfSceneConverter " ,
{ " StbResizeImageConverter " , " PngImageConverter " } , nullptr ,
" images-2d-1x1.gltf " , " images-2d-1x1.bin " ,
@ -555,25 +632,29 @@ const struct {
" Trade::AnyImageImporter::openFile(): using PngImporter \n "
" Processing 2D image 1 (1/2) with StbResizeImageConverter... \n "
" Processing 2D image 1 (2/2) with StbResizeImageConverter... \n " } ,
{ " 3D image converter, two images " , Containers : : array < Containers : : String > ( {
" -i " , " experimentalKhrTextureKtx " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling the
images to avoid having too many files */
" -c " , " experimentalKhrTextureKtx,imageConverter=KtxImageConverter,bundleImages,generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-3d-1x1x1.gltf " ) } ) ,
{ " 3D image converter, two images " , { InPlaceInit , {
" -i " , " experimentalKhrTextureKtx " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling
the images to avoid having too many files */
" -c " , " experimentalKhrTextureKtx,imageConverter=KtxImageConverter,bundleImages,generator= " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-3d-1x1x1.gltf " )
} } ,
" GltfImporter " , " PngImporter " , " GltfSceneConverter " ,
{ " StbResizeImageConverter " , " KtxImageConverter " } , nullptr ,
" images-3d-1x1x1.gltf " , " images-3d-1x1x1.bin " ,
{ } } ,
{ " 3D image converter, two images, verbose " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -i " , " experimentalKhrTextureKtx " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling the
images to avoid having too many files */
" -c " , " experimentalKhrTextureKtx,imageConverter=KtxImageConverter,bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-3d-1x1x1.gltf " ) } ) ,
{ " 3D image converter, two images, verbose " , { InPlaceInit , {
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -i " , " experimentalKhrTextureKtx " ,
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
/* Removing the generator identifier for a smaller file, bundling
the images to avoid having too many files */
" -c " , " experimentalKhrTextureKtx,imageConverter=KtxImageConverter,bundleImages,generator= " , " -v " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/images-3d-1x1x1.gltf " )
} } ,
" GltfImporter " , " PngImporter " , " GltfSceneConverter " ,
{ " StbResizeImageConverter " , " KtxImageConverter " } , nullptr ,
" images-3d-1x1x1.gltf " , " images-3d-1x1x1.bin " ,
@ -594,181 +675,268 @@ const struct {
const char * requiresImageConverter ;
Containers : : String message ;
} ErrorData [ ] {
{ " missing output argument " , Containers : : array < Containers : : String > ( {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) } ) ,
{ " missing output argument " , { InPlaceInit , {
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " )
} } ,
nullptr , nullptr , nullptr , nullptr ,
/* The output should be optional only for --info, required otherwise.
No need to test anything else as that ' s handled by Utility : : Arguments
already . Testing just a prefix of the message . */
" Missing command-line argument output \n Usage: \n " } ,
{ " --mesh and --concatenate-meshes " , Containers : : array < Containers : : String > ( {
" --mesh " , " 0 " , " --concatenate-meshes " , " a " , " b " } ) ,
{ " --mesh and --concatenate-meshes " , { InPlaceInit , {
" --mesh " , " 0 " , " --concatenate-meshes " , " a " , " b "
} } ,
nullptr , nullptr , nullptr , nullptr ,
" The --mesh and --concatenate-meshes options are mutually exclusive \n " } ,
{ " --mesh-level but no --mesh " , Containers : : array < Containers : : String > ( {
" --mesh-level " , " 0 " , " a " , " b " } ) ,
{ " --mesh-level but no --mesh " , { InPlaceInit , {
" --mesh-level " , " 0 " , " a " , " b "
} } ,
nullptr , nullptr , nullptr , nullptr ,
" The --mesh-level option can only be used with --mesh \n " } ,
{ " --only-mesh-attributes but no --mesh " , Containers : : array < Containers : : String > ( {
" --only-mesh-attributes " , " 0 " , " a " , " b " } ) ,
{ " --only-mesh-attributes but no --mesh " , { InPlaceInit , {
" --only-mesh-attributes " , " 0 " , " a " , " b "
} } ,
nullptr , nullptr , nullptr , nullptr ,
" The --only-mesh-attributes option can only be used with --mesh or --concatenate-meshes \n " } ,
{ " can't load importer plugin " , Containers : : array < Containers : : String > ( {
/* Override also the plugin directory for consistent output */
" --plugin-dir " , " nonexistent " , " -I " , " NonexistentImporter " , " whatever.obj " , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't load importer plugin " , { InPlaceInit , {
/* Override also the plugin directory for consistent output */
" --plugin-dir " , " nonexistent " , " -I " , " NonexistentImporter " , " whatever.obj " ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
nullptr , nullptr , nullptr , nullptr ,
" PluginManager::Manager::load(): plugin NonexistentImporter is not static and was not found in nonexistent/importers \n "
" Available importer plugins: " } ,
{ " can't open a file " , Containers : : array < Containers : : String > ( {
" noexistent.ffs " , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't open a file " , { InPlaceInit , {
" noexistent.ffs " ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" AnySceneImporter " , nullptr , nullptr , nullptr ,
" Trade::AnySceneImporter::openFile(): cannot determine the format of noexistent.ffs \n "
" Cannot open file noexistent.ffs \n " } ,
{ " can't map a file " , Containers : : array < Containers : : String > ( {
" noexistent.ffs " , " --map " , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't map a file " , { InPlaceInit , {
" noexistent.ffs " , " --map " ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" AnySceneImporter " , nullptr , nullptr , nullptr ,
" Utility::Path::mapRead(): can't open noexistent.ffs: error 2 (No such file or directory) \n "
" Cannot memory-map file noexistent.ffs \n " } ,
{ " no meshes found for concatenation " , Containers : : array < Containers : : String > ( {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " no meshes found for concatenation " , { InPlaceInit , {
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" GltfImporter " , nullptr , nullptr , nullptr ,
Utility : : format ( " No meshes found in {} \n " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) ) } ,
{ " can't import a single mesh " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " --mesh " , " 0 " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't import a single mesh " , { InPlaceInit , {
" -I " , " ObjImporter " , " --mesh " , " 0 " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
" Trade::ObjImporter::mesh(): wrong index count for point \n "
" Cannot import the mesh \n " } ,
{ " can't import a mesh for concatenation " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " --concatenate-meshes " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't import a mesh for concatenation " , { InPlaceInit , {
" -I " , " ObjImporter " , " --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
" Trade::ObjImporter::mesh(): wrong index count for point \n "
" Cannot import mesh 0 \n " } ,
{ " can't import a scene for concatenation " , Containers : : array < Containers : : String > ( {
/** @todo change to an OBJ once ObjImporter imports materials (and thus
scenes ) */
" --concatenate-meshes " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-scene.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't import a scene for concatenation " , { InPlaceInit , {
/** @todo change to an OBJ once ObjImporter imports materials (and
thus scenes ) */
" --concatenate-meshes " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-scene.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" GltfImporter " , nullptr , nullptr , nullptr ,
" Trade::GltfImporter::scene(): mesh index 1 in node 0 out of range for 1 meshes \n "
" Cannot import scene 0 for mesh concatenation \n " } ,
{ " can't import a mesh for per-mesh processing " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " --remove-duplicate-vertices " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't import a mesh for per-mesh processing " , { InPlaceInit , {
" -I " , " ObjImporter " , " --remove-duplicate-vertices " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
" Trade::ObjImporter::mesh(): wrong index count for point \n "
" Cannot import mesh 0 \n " } ,
{ " invalid mesh attribute filter " , Containers : : array < Containers : : String > ( {
/** @todo drop --mesh once it's not needed anymore again */
" -I " , " ObjImporter " , " --mesh " , " 0 " , " --only-mesh-attributes " , " LOLNEIN " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " invalid mesh attribute filter " , { InPlaceInit , {
/** @todo drop --mesh once it's not needed anymore again */
" -I " , " ObjImporter " , " --mesh " , " 0 " , " --only-mesh-attributes " , " LOLNEIN " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
" Utility::parseNumberSequence(): unrecognized character L in LOLNEIN \n " } ,
{ " can't load converter plugin " , Containers : : array < Containers : : String > ( {
" -C " , " NonexistentSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't load converter plugin " , { InPlaceInit , {
" -C " , " NonexistentSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
Utility : : format ( " PluginManager::Manager::load(): plugin NonexistentSceneConverter is not static and was not found in {} \n "
" Available converter plugins: " , /* Just a prefix */
MAGNUM_PLUGINS_SCENECONVERTER_INSTALL_DIR ) } ,
{ " file coversion begin failed " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.fbx " ) } ) ,
{ " file coversion begin failed " , { InPlaceInit , {
" -I " , " ObjImporter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.fbx " )
} } ,
" ObjImporter " , nullptr , " AnySceneConverter " , nullptr ,
Utility : : format ( " Trade::AnySceneConverter::beginFile(): cannot determine the format of {0} \n "
" Cannot begin conversion of file {0} \n " , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.fbx " ) ) } ,
{ " file coversion end failed " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " file coversion end failed " , { InPlaceInit , {
" -I " , " GltfImporter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" GltfImporter " , nullptr , " StanfordSceneConverter " , nullptr ,
Utility : : format ( " Trade::AbstractSceneConverter::endFile(): the converter requires exactly one mesh, got 0 \n "
" Cannot end conversion of file {0} \n " , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) ) } ,
/** @todo importer conversion begin failed, once there's a plugin for which
begin ( ) can fail */
{ " importer coversion end failed " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -C " , " MeshOptimizerSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " importer coversion end failed " , { InPlaceInit , {
" -I " , " GltfImporter " ,
" -C " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/empty.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" GltfImporter " , nullptr , " MeshOptimizerSceneConverter " , nullptr ,
" Trade::AbstractSceneConverter::end(): the converter requires exactly one mesh, got 0 \n "
" Cannot end importer conversion \n " } ,
{ " can't add importer contents " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't add importer contents " , { InPlaceInit , {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-mesh.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , nullptr ,
" Trade::ObjImporter::mesh(): wrong index count for point \n "
" Cannot add importer contents \n " } ,
{ " can't add processed meshes " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " , " --remove-duplicate-vertices " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't add processed meshes " , { InPlaceInit , {
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
" --remove-duplicate-vertices " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/two-triangles.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , nullptr ,
" Trade::AbstractSceneConverter::add(): the converter requires exactly one mesh, got 2 \n "
" Cannot add mesh 1 \n " } ,
{ " plugin doesn't support importer conversion " , Containers : : array < Containers : : String > ( {
/* Pass the same plugin twice, which means the first instance should
get used for a mesh - to - mesh conversion */
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " , " -C " , " StanfordSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " plugin doesn't support importer conversion " , { InPlaceInit , {
/* Pass the same plugin twice, which means the first instance
should get used for a mesh - to - mesh conversion */
" -I " , " ObjImporter " , " -C " , " StanfordSceneConverter " ,
" -C " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , nullptr ,
" StanfordSceneConverter doesn't support importer conversion, only ConvertMeshToData \n " } ,
{ " can't load mesh converter plugin " , Containers : : array < Containers : : String > ( {
" -M " , " NonexistentSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't load mesh converter plugin " , { InPlaceInit , {
" -M " , " NonexistentSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , nullptr , nullptr ,
Utility : : format ( " PluginManager::Manager::load(): plugin NonexistentSceneConverter is not static and was not found in {} \n "
" Available mesh converter plugins: " , /* Just a prefix */
MAGNUM_PLUGINS_SCENECONVERTER_INSTALL_DIR ) } ,
{ " plugin doesn't support mesh conversion " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " -M " , " StanfordSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " plugin doesn't support mesh conversion " , { InPlaceInit , {
" -I " , " ObjImporter " , " -M " , " StanfordSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , " StanfordSceneConverter " , nullptr ,
" StanfordSceneConverter doesn't support mesh conversion, only ConvertMeshToData \n " } ,
{ " can't process a mesh " , Containers : : array < Containers : : String > ( {
" -I " , " ObjImporter " , " -M " , " MeshOptimizerSceneConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " ) } ) ,
{ " can't process a mesh " , { InPlaceInit , {
" -I " , " ObjImporter " , " -M " , " MeshOptimizerSceneConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/point.obj " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.ply " )
} } ,
" ObjImporter " , nullptr , " MeshOptimizerSceneConverter " , nullptr ,
" Trade::MeshOptimizerSceneConverter::convert(): expected a triangle mesh, got MeshPrimitive::Points \n "
" Cannot process mesh 0 with MeshOptimizerSceneConverter \n " } ,
{ " can't import a 2D image for per-image processing " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -P " , " NonexistentImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-image-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't import a 2D image for per-image processing " , { InPlaceInit , {
" -I " , " GltfImporter " , " -P " , " NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-image-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " PngImporter " , nullptr , nullptr ,
Utility : : format ( " \n " /* Just a suffix */
" Trade::AbstractImporter::openFile(): cannot open file {} \n "
" Cannot import 2D image 0 \n " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/nonexistent.png " ) ) } ,
{ " can't import a 3D image for per-image processing " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " , " -P " , " NonexistentImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-image-3d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't import a 3D image for per-image processing " , { InPlaceInit , {
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " ,
" -P " , " NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/broken-image-3d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " KtxImporter " , nullptr , nullptr ,
Utility : : format ( " \n " /* Just a suffix */
" Trade::AbstractImporter::openFile(): cannot open file {} \n "
" Cannot import 3D image 0 \n " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/nonexistent.ktx2 " ) ) } ,
{ " can't load image converter plugin " , Containers : : array < Containers : : String > ( {
" -P " , " NonexistentImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't load image converter plugin " , { InPlaceInit , {
" -P " , " NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " PngImporter " , nullptr , nullptr ,
Utility : : format ( " PluginManager::Manager::load(): plugin NonexistentImageConverter is not static and was not found in {} \n "
" Available image converter plugins: " , /* Just a prefix */
MAGNUM_PLUGINS_IMAGECONVERTER_INSTALL_DIR ) } ,
{ " plugin doesn't support image conversion " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -P " , " PngImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " plugin doesn't support image conversion " , { InPlaceInit , {
" -I " , " GltfImporter " , " -P " , " PngImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " PngImporter " , nullptr , " PngImageConverter " ,
" PngImageConverter doesn't support 2D image conversion, only Convert2DToData \n " } ,
{ " plugin doesn't support compressed image conversion " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -P " , " StbResizeImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/image-dds.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " plugin doesn't support compressed image conversion " , { InPlaceInit , {
" -I " , " GltfImporter " , " -P " , " StbResizeImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/image-dds.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " DdsImporter " , nullptr , " StbResizeImageConverter " ,
/** @todo add an ability to pass options to AnyImageImporter to
suppress this */
" Trade::DdsImporter::openData(): block-compressed image is assumed to be encoded with Y down and Z forward, imported data will have wrong orientation. Enable assumeYUpZBackward to suppress this warning. \n "
" StbResizeImageConverter doesn't support compressed 2D image conversion, only Convert2D|Convert3D \n " } ,
{ " can't process a 2D image " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -P " , " StbResizeImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't process a 2D image " , { InPlaceInit , {
" -I " , " GltfImporter " , " -P " , " StbResizeImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " PngImporter " , nullptr , " StbResizeImageConverter " ,
" Trade::StbResizeImageConverter::convert(): output size was not specified \n "
" Cannot process 2D image 0 with StbResizeImageConverter \n " } ,
{ " can't process a 3D image " , Containers : : array < Containers : : String > ( {
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " , " -P " , " StbResizeImageConverter " , Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't process a 3D image " , { InPlaceInit , {
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " ,
" -P " , " StbResizeImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" GltfImporter " , " KtxImporter " , nullptr , " StbResizeImageConverter " ,
" Trade::StbResizeImageConverter::convert(): output size was not specified \n "
" Cannot process 3D image 0 with StbResizeImageConverter \n " } ,
{ " can't add processed 2D images " , Containers : : array < Containers : : String > ( {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -c " , " imageConverter=NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't add processed 2D images " , { InPlaceInit , {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
" -I " , " GltfImporter " , " -C " , " GltfSceneConverter " ,
" -c " , " imageConverter=NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-2d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" ObjImporter " , " PngImporter " , " GltfSceneConverter " , " StbResizeImageConverter " ,
" \n " /* Just a suffix */
" Trade::GltfSceneConverter::add(): can't load NonexistentImageConverter for image conversion \n "
" Cannot add 2D image 0 \n " } ,
{ " can't add processed 3D images " , Containers : : array < Containers : : String > ( {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " ,
" -C " , " GltfSceneConverter " ,
" -c " , " experimentalKhrTextureKtx,imageConverter=NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) , Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " ) } ) ,
{ " can't add processed 3D images " , { InPlaceInit , {
" -P " , " StbResizeImageConverter " , " -p " , " size= \" 1 1 \" " ,
" -I " , " GltfImporter " , " -i " , " experimentalKhrTextureKtx " ,
" -C " , " GltfSceneConverter " ,
" -c " , " experimentalKhrTextureKtx,imageConverter=NonexistentImageConverter " ,
Utility : : Path : : join ( SCENETOOLS_TEST_DIR , " SceneConverterTestFiles/images-3d.gltf " ) ,
Utility : : Path : : join ( SCENETOOLS_TEST_OUTPUT_DIR , " SceneConverterTestFiles/whatever.gltf " )
} } ,
" ObjImporter " , " PngImporter " , " GltfSceneConverter " , " StbResizeImageConverter " ,
" \n " /* Just a suffix */
" Trade::GltfSceneConverter::add(): can't load NonexistentImageConverter for image conversion \n "