Skip to content
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

Quake MDL feature #1591

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dd41598
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
22e8941
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
55309ab
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
34c719a
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
b01355e
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
3180bd6
Add importer
Youva Aug 25, 2024
ec7995a
Removed hardcoded path
Youva Aug 25, 2024
32ae40b
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
3301f24
Formatting
Youva Sep 8, 2024
83e8e68
Formatting
Youva Sep 8, 2024
f5e38b7
Formatting
Youva Sep 8, 2024
aa19fd0
Fixed build errors w/ strict_build
Youva Sep 24, 2024
45b8dce
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
9012a55
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
985211f
Fixed override updateTimeStep.
Youva Sep 24, 2024
a5d5cf3
Removed some warnings
Youva Sep 24, 2024
4e61407
Applied style.
Youva Sep 24, 2024
afc778e
Changed push_back to emplace_back
Youva Sep 24, 2024
9cc1cf9
Return bool l. 432
Youva Sep 24, 2024
17a22dd
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
3bca4a6
Coding style modification.
Youva Sep 24, 2024
c67fa76
Added unit test
Youva Dec 17, 2024
b4a5532
Changed UpdateTimeStep
Youva Dec 17, 2024
85ec4f2
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
19607a5
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
417e857
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
417aa5b
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
c7ec807
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
54ea9d3
Add importer
Youva Aug 25, 2024
dbf44ed
Removed hardcoded path
Youva Aug 25, 2024
4d1813d
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
48a6e7e
Formatting
Youva Sep 8, 2024
778c0d4
Formatting
Youva Sep 8, 2024
ae15baf
Formatting
Youva Sep 8, 2024
4af2189
Fixed build errors w/ strict_build
Youva Sep 24, 2024
f049d80
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
c8ce50a
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
932e2ba
Fixed override updateTimeStep.
Youva Sep 24, 2024
f4c1865
Removed some warnings
Youva Sep 24, 2024
b203e95
Applied style.
Youva Sep 24, 2024
ac074e8
Changed push_back to emplace_back
Youva Sep 24, 2024
cff7f92
Return bool l. 432
Youva Sep 24, 2024
8a4744c
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
e9e9b06
Coding style modification.
Youva Sep 24, 2024
ee4b66c
Added unit test
Youva Dec 17, 2024
84b57f9
Compiler warning and indentation
Youva Dec 18, 2024
2f40a6f
Formatting
Youva Dec 18, 2024
36a374a
Added coverage to f3dquakemdlimporter
Youva Dec 19, 2024
dda2a6a
Coverage, added comments
Youva Dec 20, 2024
bb76163
Added asset file for coverage
Youva Dec 21, 2024
1eaca5b
Changed pointer cast, formatting.
Youva Dec 21, 2024
3855830
Added constexpr variables for offset calculation
Youva Dec 21, 2024
3b6d59a
Added license
Youva Dec 21, 2024
60c64d9
Test coverage for animations
Youva Jan 4, 2025
f26d21a
Coverage for animations.
Youva Jan 4, 2025
32bff66
Added coverage
Youva Jan 4, 2025
e935a12
Update TestQuakeMDL.png
Youva Jan 4, 2025
07cbe8c
Changed animation time
Youva Jan 4, 2025
825a55a
Added UpdateAtTimeValue
Youva Jan 5, 2025
1e3f44a
Formatting
Youva Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ f3d_test(NAME TestVTM DATA mb.vtm UI)
f3d_test(NAME TestVTK DATA cow.vtk)
f3d_test(NAME TestNRRD DATA beach.nrrd ARGS -s)
f3d_test(NAME TestSPLAT DATA small.splat ARGS -osy --up=-Y --point-sprites-size=1)
f3d_test(NAME TestQuakeMDL DATA glaunch.mdl ARGS --animation-index=1 --animation-autoplay=true --animation-time=0.1)
Youva marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add DefaultConfig and ThumbnailConfig tests (see other tests named like this)

f3d_test(NAME TestGridX DATA suzanne.ply ARGS -g --up=+X)
f3d_test(NAME TestGridY DATA suzanne.ply ARGS -g --up=+Y)
f3d_test(NAME TestGridZ DATA suzanne.ply ARGS -g --up=+Z)
Expand Down
9 changes: 8 additions & 1 deletion plugins/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ f3d_plugin_declare_reader(
FORMAT_DESCRIPTION "VTK XML MultiBlock"
)


f3d_plugin_declare_reader(
NAME Splat
SCORE 90
Expand All @@ -186,6 +185,14 @@ f3d_plugin_declare_reader(
FORMAT_DESCRIPTION "3D Gaussian splats"
)

f3d_plugin_declare_reader(
NAME QuakeMDL
EXTENSIONS mdl
MIMETYPES application/vnd.mdl
Youva marked this conversation as resolved.
Show resolved Hide resolved
Youva marked this conversation as resolved.
Show resolved Hide resolved
VTK_IMPORTER vtkF3DQuakeMDLImporter
FORMAT_DESCRIPTION "Quake 1 MDL model"
)

f3d_plugin_build(
NAME native
VERSION 1.0
Expand Down
7 changes: 7 additions & 0 deletions plugins/native/configs/config.d/10_native.json
Youva marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,12 @@
"anti-aliasing": false,
"translucency-support": false
}
},
{
"match": ".*(mdl)",
"options":
{
"up": "+Z"
}
}
]
7 changes: 7 additions & 0 deletions plugins/native/configs/thumbnail.d/10_native.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,12 @@
"anti-aliasing": false,
"translucency-support": false
}
},
{
"match": ".*(mdl)",
"options":
{
"up": "+Z"
}
}
]
4 changes: 4 additions & 0 deletions plugins/native/f3d-3d-formats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@
<comment>3D Gaussians Splat File Format</comment>
<glob pattern="*.splat"/>
</mime-type>
<mime-type type="application/vnd.mdl">
<comment>Quake 1 MDL File Format</comment>
<glob pattern="*.mdl"/>
</mime-type>
</mime-info>
1 change: 1 addition & 0 deletions plugins/native/module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(classes
vtkF3DSplatReader
vtkF3DQuakeMDLImporter
)

set(_no_install "")
Expand Down
10 changes: 10 additions & 0 deletions plugins/native/module/Testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(vtkextNative_list
TestF3DQuakeMDLImporter.cxx
)

vtk_add_test_cxx(vtkextNativeTests tests
NO_DATA NO_VALID NO_OUTPUT
${vtkextNative_list}
${F3D_SOURCE_DIR}/testing/ ${CMAKE_BINARY_DIR}/Testing/Temporary/)

vtk_test_cxx_executable(vtkextNativeTests tests)
26 changes: 26 additions & 0 deletions plugins/native/module/Testing/TestF3DQuakeMDLImporter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "vtkF3DQuakeMDLImporter.h"

#include <vtkDoubleArray.h>
Youva marked this conversation as resolved.
Show resolved Hide resolved
#include <vtkNew.h>
#include <vtkTestUtilities.h>

#include <iostream>

int TestF3DQuakeMDLImporter(int vtkNotUsed(argc), char* argv[])
{
std::string filename =
std::string(argv[1]) + "data/glaunch_2.mdl"; // File was modified to add coverage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what did you modify ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified it with a hex editor for coverage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but to reach which part of the importer code ? :)

vtkNew<vtkF3DQuakeMDLImporter> importer;
importer->SetFileName(filename);
importer->Update();
importer->Print(cout);
vtkIdType numAnimations = importer->GetNumberOfAnimations();
for (int i = 0; i < numAnimations; i++)
{
importer->DisableAnimation(i);
}
vtkIdType selectedAnimationIndex = 1;
importer->EnableAnimation(selectedAnimationIndex);
std::string animationName = importer->GetAnimationName(2);
return numAnimations == 2 && animationName == "" ? EXIT_SUCCESS : EXIT_FAILURE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it expected that the animation has an empty name ?

}
Loading
Loading