Skip to content

Quake MDL feature #1591

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

Merged
merged 69 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
125e920
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
0110524
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
4dc2ca1
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
aa5a84a
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
6c40623
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
4fb427f
Add importer
Youva Aug 25, 2024
333a50e
Removed hardcoded path
Youva Aug 25, 2024
34203f8
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
aa48d46
Formatting
Youva Sep 8, 2024
354f2ed
Formatting
Youva Sep 8, 2024
1d17341
Formatting
Youva Sep 8, 2024
4f6fdc5
Fixed build errors w/ strict_build
Youva Sep 24, 2024
8e43a28
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
9ea44a4
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
d2de07c
Fixed override updateTimeStep.
Youva Sep 24, 2024
345e76d
Removed some warnings
Youva Sep 24, 2024
e3c97ff
Applied style.
Youva Sep 24, 2024
c82166d
Changed push_back to emplace_back
Youva Sep 24, 2024
b0d089f
Return bool l. 432
Youva Sep 24, 2024
ccdc735
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
a528ce7
Coding style modification.
Youva Sep 24, 2024
fee56b5
Added unit test
Youva Dec 17, 2024
a7dc5c7
Changed UpdateTimeStep
Youva Dec 17, 2024
f1d046b
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
b84e316
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
891c890
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
f5dd8fa
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
48f100f
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
c3f61ae
Add importer
Youva Aug 25, 2024
965dbc7
Removed hardcoded path
Youva Aug 25, 2024
a877a23
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
c41df2c
Formatting
Youva Sep 8, 2024
c4cb73f
Formatting
Youva Sep 8, 2024
3da6434
Formatting
Youva Sep 8, 2024
b436281
Fixed build errors w/ strict_build
Youva Sep 24, 2024
a6e9fae
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
b7cf43b
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
f316c80
Fixed override updateTimeStep.
Youva Sep 24, 2024
eb77ea6
Removed some warnings
Youva Sep 24, 2024
8f631d9
Applied style.
Youva Sep 24, 2024
ee3e50b
Changed push_back to emplace_back
Youva Sep 24, 2024
1d4dbb5
Return bool l. 432
Youva Sep 24, 2024
9f4fca3
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
38f1ca9
Coding style modification.
Youva Sep 24, 2024
90ba6e0
Added unit test
Youva Dec 17, 2024
f8cf6ad
Compiler warning and indentation
Youva Dec 18, 2024
b0fb19d
Formatting
Youva Dec 18, 2024
7494741
Added coverage to f3dquakemdlimporter
Youva Dec 19, 2024
1c1f684
Coverage, added comments
Youva Dec 20, 2024
756fe76
Added asset file for coverage
Youva Dec 21, 2024
22da0e3
Changed pointer cast, formatting.
Youva Dec 21, 2024
0b4b0d2
Added constexpr variables for offset calculation
Youva Dec 21, 2024
cd35e76
Test coverage for animations
Youva Jan 4, 2025
2a97308
Coverage for animations.
Youva Jan 4, 2025
0733091
Added coverage
Youva Jan 4, 2025
4cc5547
Update TestQuakeMDL.png
Youva Jan 4, 2025
6202460
Changed animation time
Youva Jan 4, 2025
bbf659d
Added UpdateAtTimeValue
Youva Jan 5, 2025
6eb0c15
Formatting
Youva Jan 5, 2025
8b0aebb
Changed some functions in quakemdlimporter
Youva Jan 15, 2025
b9ed2ba
Formatting
Youva Jan 25, 2025
d5b3f26
Changed asset file for .mdl
Youva Feb 24, 2025
41044e9
Changed baseline for thumbnail test
Youva Feb 25, 2025
8de2266
Changed TestDefaultConfigFileQuakeMDL and TestThumbnailConfigFileQuak…
Youva Feb 25, 2025
e63c8b4
Formatting
Youva Feb 25, 2025
01f4492
Formatting
Youva Feb 26, 2025
b5c7d3a
Formatting
Youva Feb 26, 2025
14613da
Changed updatetimestep in vtkf3dquakemdlimporter
Youva Mar 19, 2025
c501d96
Update plugins/native/module/Testing/TestF3DQuakeMDLImporter.cxx
Youva Mar 24, 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
3 changes: 3 additions & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ f3d_test(NAME TestVTM DATA mb.vtm)
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 soldier.mdl ARGS --animation-index=2 --animation-time=0.1)
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 Expand Up @@ -393,6 +394,7 @@ if(NOT F3D_MACOS_BUNDLE)
f3d_test(NAME TestDefaultConfigFileSTL DATA suzanne.stl CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
f3d_test(NAME TestDefaultConfigFileTIFF DATA f3d.tif CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI) # Note: This tests config file order as camera_direction is set in different files
f3d_test(NAME TestDefaultConfigFilePLY DATA suzanneRGBA.ply CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
f3d_test(NAME TestDefaultConfigFileQuakeMDL DATA zombie.mdl CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
f3d_test(NAME TestDefaultConfigFileAndCommand DATA suzanne.stl ARGS --up=-Y --camera-direction=-1,0.5,-1 CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)
f3d_test(NAME TestDefaultConfigTranslucent DATA red_translucent_monkey.gltf CONFIG config_build LONG_TIMEOUT TONE_MAPPING UI)

Expand All @@ -401,6 +403,7 @@ if(NOT F3D_MACOS_BUNDLE)
f3d_test(NAME TestThumbnailConfigFileVTI DATA vase_4comp.vti CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
f3d_test(NAME TestThumbnailConfigFileSTL DATA suzanne.stl CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
f3d_test(NAME TestThumbnailConfigFilePLY DATA suzanneRGBA.ply CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
f3d_test(NAME TestThumbnailConfigFileQuakeMDL DATA zombie.mdl CONFIG thumbnail_build LONG_TIMEOUT TONE_MAPPING)
endif()

# color texture with opacity needs https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9467
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,12 @@
"anti-aliasing": false,
"translucency-support": false
}
},
{
"match": ".*(mdl)",
"options": {
"up": "+Z",
"animation-index": "-1"
Copy link
Member

Choose a reason for hiding this comment

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

So most animated models have multiples animations baked in and all animations should be enabled by default ?

}
}
]
6 changes: 6 additions & 0 deletions plugins/native/configs/thumbnail.d/10_native.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@
"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)
27 changes: 27 additions & 0 deletions plugins/native/module/Testing/TestF3DQuakeMDLImporter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "vtkF3DQuakeMDLImporter.h"

#include <vtkDoubleArray.h>
#include <vtkNew.h>
#include <vtkTestUtilities.h>

#include <iostream>

int TestF3DQuakeMDLImporter(int vtkNotUsed(argc), char* argv[])
{
std::string filename =
std::string(argv[1]) + "data/zombie_2.mdl"; // MDL can load two types of frames and two types of
// textures, another file was added for coverage.
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 = 0;
importer->EnableAnimation(selectedAnimationIndex);
std::string animationName = importer->GetAnimationName(0);
return numAnimations == 1 && animationName == "frame" ? EXIT_SUCCESS : EXIT_FAILURE;
}
Loading