-
-
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
Conversation
You are modifying libf3d public API! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1860 +/- ##
==========================================
+ Coverage 95.75% 95.89% +0.14%
==========================================
Files 123 127 +4
Lines 10612 11062 +450
==========================================
+ Hits 10161 10608 +447
- Misses 451 454 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do you need any help or review to move forward @0xfedcafe ? |
Just that upper question about an optional and I’ll push hopefully the final commit for this task with the test |
Hi @0xfedcafe How is it going ? Do you need any help ? |
Hi @0xfedcafe Please do not hesitate to reach out if you need any guidance :) |
Hi @0xfedcafe ! Do you need a review or help with CI ? |
yes, i think a hint would be very helpful. i can't find why in some tests where the necessary plugins are loaded and the reader is not nullptr it still fails with "unsupported file format" |
fixes by mwestphal Co-authored-by: Mathieu Westphal <[email protected]>
There a small conflict to fix with master, let me know if you need help with that |
Hi @0xfedcafe Do you need help moving forward ? |
Hi @0xfedcafe Do you need help moving forward ? |
Hey, yes, I would like to know whether I'm allowed to simply do a disjunction of the parts of error messages in failing test in my test as a regexp or that would be a bad solution? Because I'm unsure why it fails on different platforms with different error messages and I had no access to Linux/Windows so I couldn't test that. |
I'm confused a bit by your question, lets discuss on discord ? :) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
you need to put these test behind a if(VTK_VERSION VERSION_GREATER_EQUAL 9.3.20240707)
because before that VTK did not provide feedback if a importer worked or not.
@@ -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") |
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.
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 TestForceReaderExodusFail DATA BoxAnimated.gltf ARGS --load-plugins=exodus --force-reader=ExodusII NO_BASELINE REGEXP "failed to load scene") |
|
||
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 comment
The 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:
f3d_test(NAME TestForceReaderGLTFDracoIntoGLTF DATA Box_draco.gltf ARGS --load-plugins=draco --force-reader=GLTF NO_BASELINE REGEXP "failed to load scene")
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.
@@ -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 comment
The 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;
f3d_test(NAME TestForceReaderFail DATA suzanne.stl ARGS --force-reader=OBJ NO_BASELINE REGEXP "failed to load scene")
f3d_test(NAME TestForceReaderPass DATA suzanne.stl ARGS --force-reader=STL NO_BASELINE REGEXP "some log that you need to add")
f3d_test(NAME TestForceReaderInvalid DATA suzanne.stl ARGS --force-reader=INVALID NO_BASELINE REGEXP "some log that you need to add")
@@ -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 comment
The 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 comment
The 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.
Added a CLI reader option #1735