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

Quake MDL feature #1591

wants to merge 60 commits into from

Conversation

Youva
Copy link

@Youva Youva commented Aug 25, 2024

Adds class vtkQuakeMDLImporter that reads .MDL files.

The class :

  • Reads vertices and triangle data from the format to display a model.
  • Reads a texture and texture coordinates from the format to display onto the model.
  • Reads animations, stored as an array of vertices in the file, and saves them as a vector of polydata.
  • Groups animations and displays them.
  • Adds light sources to the scene.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 99.24242% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.76%. Comparing base (91310bd) to head (1e3f44a).

Files with missing lines Patch % Lines
plugins/native/module/vtkF3DQuakeMDLImporter.cxx 99.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1591      +/-   ##
==========================================
+ Coverage   95.69%   95.76%   +0.06%     
==========================================
  Files         125      127       +2     
  Lines        9926    10190     +264     
==========================================
+ Hits         9499     9758     +259     
- Misses        427      432       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

style.diff Outdated Show resolved Hide resolved
Copy link
Contributor

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

changes needed

Copy link
Member

@Meakk Meakk left a comment

Choose a reason for hiding this comment

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

Nice work @Youva !!
There is still some clean-up to do, especially memory leaks to fix, but they will appear in the CI when you will add a test.
90% of the job is done, and there's the annoying, yet important, finalization left :)

plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.cxx Outdated Show resolved Hide resolved
plugins/native/module/vtkQuakeMDLImporter.h Outdated Show resolved Hide resolved
@mwestphal
Copy link
Contributor

@Youva any news on this ?

1 similar comment
@mwestphal
Copy link
Contributor

@Youva any news on this ?

@mwestphal
Copy link
Contributor

Hi @Youva ! Looks like you are back. First you may want to rebase on the latest master :)

Copy link

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: python, java, webassembly.

@mwestphal
Copy link
Contributor

Looks like your merge did not go as expected. I'd strongly suggest using rebase instead of merge. Let me know if I can help (on discord or here).

@Youva Youva force-pushed the quake-mdl-feature branch from 70ec237 to 988186a Compare December 18, 2024 22:51
@mwestphal
Copy link
Contributor

Hi @Youva

Please resolve discussions you have adressed and let us know if this is ready for review.

@Youva Youva force-pushed the quake-mdl-feature branch from 2f4b791 to 60c64d9 Compare January 4, 2025 20:28
@mwestphal
Copy link
Contributor

Hi @Youva , please let us know if this is ready for review :)

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 ? :)

@@ -27,6 +27,7 @@
- duck.fbx: assimp test models: BSD-3-Clause
- Duck0.bin: Copyright 2006 Sony Computer Entertainment Inc.: SCEA Shared Source License
- duck_invalid.gltf: Copyright 2006 Sony Computer Entertainment Inc.: SCEA Shared Source License
- glaunch*.mdl : Preach: CC-BY-NC 4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

No feedback from Preach yet Im afraid, ill ask again

@@ -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)
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)

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 ?

std::pair<int, float> pair = std::make_pair(this->AnimationIds[i].first,
(this->AnimationIds[i].second + this->AnimationIds[i + 1].second) / 2);
// Increments i to avoid infinite loop
this->AnimationIds.insert(this->AnimationIds.begin() + i++, pair);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add more comments on that logic ? its not super clear to me

/**
* Update actors at the given time value.
*/
void UpdateTimeStep(double timeValue) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think this method is needed ?

* Get the number of available cameras.
* Not implemented, multiple cameras are not specified.
*/
vtkIdType GetNumberOfCameras() override;
Copy link
Contributor

Choose a reason for hiding this comment

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

YOu can remove this method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants