-
-
Notifications
You must be signed in to change notification settings - Fork 288
Cli reader options #1860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Cli reader options #1860
Changes from all commits
917db39
a039ed0
c85a20c
45ba1a9
5b00fcb
be829e3
e916daf
17c2dda
8e69e60
bc26894
fc68b05
d260c55
c93e954
63c0456
9a5bca2
4bb1ce4
2db35e2
dbaf7ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1159,6 +1159,16 @@ if(F3D_PLUGIN_BUILD_ALEMBIC AND F3D_PLUGIN_BUILD_ASSIMP) | |
f3d_test(NAME TestReadersListMultiplePlugins ARGS --list-readers --load-plugins=assimp,alembic NO_BASELINE REGEXP_FAIL "Plugin failed to load") | ||
endif() | ||
|
||
if(F3D_PLUGIN_BUILD_EXODUS) | ||
f3d_test(NAME TestForceReaderExodusFail DATA BoxAnimated.gltf ARGS --load-plugins=exodus --force-reader=ExodusII NO_BASELINE REGEXP "is not a file of a supported file format|failed to load scene") | ||
f3d_test(NAME TestForceReaderExodusPass DATA disk_out_ref.ex2 ARGS --load-plugins=exodus --force-reader=ExodusII NO_BASELINE REGEXP_FAIL "is not a file of a supported file format|failed to load scene") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to put these test behind a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but these tests should not rely on exodus plugin being present tbh, you can just test using native provided importer, like obj and stl, eg;
|
||
endif() | ||
|
||
if(F3D_PLUGIN_BUILD_DRACO) | ||
f3d_test(NAME TestForceReaderGLTFDraco DATA BoxAnimated.gltf ARGS --load-plugins=draco --force-reader=GLTFDraco NO_BASELINE REGEXP_FAIL "is not a file of a supported file format|failed to load scene") | ||
f3d_test(NAME TestForceReaderGLTF DATA BoxAnimated.gltf ARGS --load-plugins=draco --force-reader=GLTF NO_BASELINE REGEXP_FAIL "is not a file of a supported file format|failed to load scene") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont get what these two tests are testing here. I think you want a test like this:
Basically, testing that you can force the usage of the GLTF importer instead of the GLTFDraco importer even when the draco importer is loaded. The test then check that the file is not loaded at all because it needs GLTFDraco to be able to load. |
||
endif() | ||
|
||
# Test bindings-list display | ||
f3d_test(NAME TestBindingsList ARGS --list-bindings REGEXP "Any.5 Toggle Orthographic Projection") | ||
|
||
|
0xfedcafe marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
"orthographic": { | ||
"type": "bool" | ||
} | ||
}, | ||
"force_reader": { | ||
"type": "string" | ||
} | ||
}, | ||
"render": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ | |
#include "interactor_impl.h" | ||
#include "log.h" | ||
#include "options.h" | ||
#include "scene.h" | ||
#include "window_impl.h" | ||
|
||
#include "factory.h" | ||
#include "vtkF3DGenericImporter.h" | ||
#include "vtkF3DMemoryMesh.h" | ||
#include "vtkF3DMetaImporter.h" | ||
|
||
#include <optional> | ||
#include <vtkCallbackCommand.h> | ||
#include <vtkProgressBarRepresentation.h> | ||
#include <vtkProgressBarWidget.h> | ||
|
@@ -240,7 +242,8 @@ scene& scene_impl::add(const std::vector<fs::path>& filePaths) | |
} | ||
|
||
// Recover the importer for the provided file path | ||
f3d::reader* reader = f3d::factory::instance()->getReader(filePath.string()); | ||
f3d::reader* reader = f3d::factory::instance()->getReader( | ||
filePath.string(), this->Internals->Options.scene.force_reader); | ||
if (reader) | ||
{ | ||
log::debug( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe improve this log to dinstinguish between: "Found a reader for .." "Forcing BLABLA reader for" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and maybe the exception below should also be improved, to dinstinguish when a reader was not found vs when the forced reader did not exists at all. |
||
|
@@ -322,7 +325,8 @@ scene& scene_impl::clear() | |
//---------------------------------------------------------------------------- | ||
bool scene_impl::supports(const fs::path& filePath) | ||
{ | ||
return f3d::factory::instance()->getReader(filePath.string()) != nullptr; | ||
return f3d::factory::instance()->getReader( | ||
filePath.string(), this->Internals->Options.scene.force_reader) != nullptr; | ||
} | ||
|
||
//---------------------------------------------------------------------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.