-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add Cycle through animations in glTF files #1155
Conversation
From: @kathleenhang :
Perfect
What is FILE_TYPE here ?
Ok
Ok
That depends. There is two ways to open a gltf file. through the vtkGLTFReader and through the vtkGLTFImporter. In any case, this should not matter to you in the context of this implementation. You should work using the vtkImporter API directly. The fact that it is coming from a reader or an importer should not matter. |
Originally, "FILE_TYPE" was in reference to any file type which supports animations. For example:
However, thanks to your feedback, I learned that it is entirely unnecessary to differentiate! |
I'm working on some code. So far what I have is:
I don't understand how to render the next animation onto the screen. Therefore, I believe I need to reload the file with the updated animation index? I would assume a new function would have to be created within @mwestphal Help appreciated! |
Indeed, adding a logic to enable and load a specific animation in animationManager is needed. TBH I dont think you need a |
Thanks @mwestphal ! However, I am still a bit confused, and I will appreciate tips on loading. How can I load a specific animation in animationManager after its animation index has been updated? I would assume that I would have to reinitialize the animationManager in order for it to read in the updated options. I could |
You need to put the animation index selection into its own method and call it whenever needed, in Initialize and when pressing the key. You can then just call LoadAtTime. |
@mwestphal Thanks, that was helpful! It's working now. However, there is an issue with the animation cycling. Once the final animation of the file has been reached, animation cycling begins to break. Pressing "W" repeatedly shows the final animation, instead of the desired behavior of looping back to show the first animation again. The indices are all within bounds, so I believe there is an issue with properly managing and resetting animation states. Also, I see Help appreciated ! |
Just use the option |
I've done a quick review pass. It's definitely not an easy one, good luck for the correction and thanks for your persistence! |
Okay, it looks like the animation cycling feature has been successfully implemented. I'm planning to add some tests to cover the edge cases. Let me know what you think. |
Great! I will review. In any case, you do need to add tests and also put that PR out of draft status so that CI is run. |
Also please "resolve" discussions that you have adressed. |
And also rebase on the last master :) |
I tried to answer your questions, if anything is unclear, do not hesitate to ask on discord: https://discord.f3d.app :) |
|
Let me check that, but it may be the responsability of the importers, hence unrelated to this change.
Just looping through once should be enough.
Indeed
Already covered
Already covered
I think already covered ?
Already covered
You need to look at interaction test, let me know if you need a pointers |
By the way, please rebase on master and Undraft your PR :) |
CI is not clean, you have styles and a segfaults to fix :) |
@mwestphal I'm not sure how to fix the segfaults. I am guessing it is an issue with cycling out of index range? I tried to fix it with the last commit. |
All the requested changes have been added ! |
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.
recover baselines from CI for the last failing tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1155 +/- ##
==========================================
+ Coverage 96.44% 96.62% +0.17%
==========================================
Files 146 147 +1
Lines 8746 8907 +161
==========================================
+ Hits 8435 8606 +171
+ Misses 311 301 -10 ☔ View full report in Codecov by Sentry. |
@mwestphal Just in time for the release ! |
Closes #902