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 67 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
eab32ff
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
5cbf999
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
ccc8bdb
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
53145f7
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
81299cf
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
7037bd6
Add importer
Youva Aug 25, 2024
661ea9c
Removed hardcoded path
Youva Aug 25, 2024
8d14eca
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
3356577
Formatting
Youva Sep 8, 2024
a8719c8
Formatting
Youva Sep 8, 2024
ccc3325
Formatting
Youva Sep 8, 2024
cf5f77e
Fixed build errors w/ strict_build
Youva Sep 24, 2024
59e51a4
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
0c69f22
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
60c5729
Fixed override updateTimeStep.
Youva Sep 24, 2024
2cd0da5
Removed some warnings
Youva Sep 24, 2024
9b58ad3
Applied style.
Youva Sep 24, 2024
369b290
Changed push_back to emplace_back
Youva Sep 24, 2024
812df50
Return bool l. 432
Youva Sep 24, 2024
3b730a9
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
5bf4c14
Coding style modification.
Youva Sep 24, 2024
d716829
Added unit test
Youva Dec 17, 2024
52c2779
Changed UpdateTimeStep
Youva Dec 17, 2024
1b9e52a
Adding preliminary Quake1 MDL plugin.
malespiaut May 27, 2024
09262d4
Fixing some vector types error in vtkQuakeMDLReader.
malespiaut May 27, 2024
067d638
Fixing some formatting error (whitespaces) in vtkQuakeMDLReader.
malespiaut May 27, 2024
99b613f
Fixing typo in vtkQuakeMDLReader.
malespiaut May 27, 2024
b14dbc5
Cleaning out unnecessary code.
malespiaut Jun 2, 2024
9dae267
Add importer
Youva Aug 25, 2024
e5f9f50
Removed hardcoded path
Youva Aug 25, 2024
ae5c136
Fixed crash due to memory allocation on normals and interpolated fram…
Youva Sep 2, 2024
df6ec1b
Formatting
Youva Sep 8, 2024
85fc6d3
Formatting
Youva Sep 8, 2024
d70d78c
Formatting
Youva Sep 8, 2024
3b3ba5d
Fixed build errors w/ strict_build
Youva Sep 24, 2024
8bd72b5
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
9ae39fe
Update vtkQuakeMDLImporter.cxx
Youva Sep 24, 2024
62dc0d3
Fixed override updateTimeStep.
Youva Sep 24, 2024
c9d0cec
Removed some warnings
Youva Sep 24, 2024
1915572
Applied style.
Youva Sep 24, 2024
98a0870
Changed push_back to emplace_back
Youva Sep 24, 2024
d24665e
Return bool l. 432
Youva Sep 24, 2024
c12920e
Fix unusedStructMember and containerOutOfBounds
Youva Sep 24, 2024
7f2d79d
Coding style modification.
Youva Sep 24, 2024
5cd40bc
Added unit test
Youva Dec 17, 2024
d918979
Compiler warning and indentation
Youva Dec 18, 2024
2bef09f
Formatting
Youva Dec 18, 2024
79953f9
Added coverage to f3dquakemdlimporter
Youva Dec 19, 2024
387d907
Coverage, added comments
Youva Dec 20, 2024
4cb6286
Added asset file for coverage
Youva Dec 21, 2024
742908a
Changed pointer cast, formatting.
Youva Dec 21, 2024
80d5116
Added constexpr variables for offset calculation
Youva Dec 21, 2024
4a1ffc3
Test coverage for animations
Youva Jan 4, 2025
62b1e79
Coverage for animations.
Youva Jan 4, 2025
d5e6fd8
Added coverage
Youva Jan 4, 2025
27f82fd
Update TestQuakeMDL.png
Youva Jan 4, 2025
559f230
Changed animation time
Youva Jan 4, 2025
6593b20
Added UpdateAtTimeValue
Youva Jan 5, 2025
f651dbf
Formatting
Youva Jan 5, 2025
379edd8
Changed some functions in quakemdlimporter
Youva Jan 15, 2025
1258b22
Formatting
Youva Jan 25, 2025
0057fa9
Changed asset file for .mdl
Youva Feb 24, 2025
41e9a6a
Changed baseline for thumbnail test
Youva Feb 25, 2025
467a64a
Changed TestDefaultConfigFileQuakeMDL and TestThumbnailConfigFileQuak…
Youva Feb 25, 2025
2755118
Formatting
Youva Feb 25, 2025
9d3f454
Formatting
Youva Feb 26, 2025
4bee8b4
Formatting
Youva Feb 26, 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
@@ -155,6 +155,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 zombie.mdl ARGS --animation-index=0 --animation-autoplay=true --animation-time=0.1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
f3d_test(NAME TestQuakeMDL DATA zombie.mdl ARGS --animation-index=0 --animation-autoplay=true --animation-time=0.1)
f3d_test(NAME TestQuakeMDL DATA zombie.mdl ARGS --animation-index=0 --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)
@@ -375,6 +376,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)

@@ -383,6 +385,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
9 changes: 8 additions & 1 deletion plugins/native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -176,7 +176,6 @@ f3d_plugin_declare_reader(
FORMAT_DESCRIPTION "VTK XML MultiBlock"
)


f3d_plugin_declare_reader(
NAME Splat
SCORE 90
@@ -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
7 changes: 7 additions & 0 deletions plugins/native/configs/config.d/10_native.json
Original file line number Diff line number Diff line change
@@ -61,5 +61,12 @@
"anti-aliasing": false,
"translucency-support": false
}
},
{
"match": ".*(mdl)",
"options": {
"up": "+Z",
"animation-index": "-1"
Copy link
Contributor

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 ?

}
}
]
7 changes: 7 additions & 0 deletions plugins/native/configs/thumbnail.d/10_native.json
Original file line number Diff line number Diff line change
@@ -44,5 +44,12 @@
"anti-aliasing": false,
"translucency-support": false
}
},
{
"match": ".*(mdl)",
"options": {
"up": "+Z",
"animation-index": "-1"
Copy link
Contributor

Choose a reason for hiding this comment

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

that doesnt make much sense for thumbnail to have a animation related option tbh

}
}
]
4 changes: 4 additions & 0 deletions plugins/native/f3d-3d-formats.xml
Original file line number Diff line number Diff line change
@@ -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 "")
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"; // 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.

ideally clarify what codepath it covers ?

error ? specific feature ?

vtkNew<vtkF3DQuakeMDLImporter> importer;
std::cout << filename;
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed

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
Oops, something went wrong.