Support (combining) multi-track (glTF) animations #16653
+1,037
−626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this is twofold:
The advanced benefit is that it closes #12663, letting modders combine multiple animation tracks (e.g. in
player_api, no separate "walk + dig" animation would be needed: the two animations can simply be combined). This is very useful if the cartesian products of possible combinations would otherwise get large.The other is more of a convenience that it lets you address named animations as found in glTF files. This makes it easier to just take such files off-the-shelf, no need to bake everything into a single track and be careful with picking the right frame numbers.
To do
This PR is Ready for Review.
I would love to have some feedback by mod / game devs on the API design.
There are two limitations: I did not bother with extending this feature to local animations or support for the
model[]formspec element. Both can come later, though I'm not sure whether there's much point in supporting the former at all. There is also a non-negligible chance that we'll be able to make SSCSM APIs that obsolete both features happen.(Minor TODO: Get permission to use the test model or replace it)
How to test
.x,.b3d, and.gltf/.glbmodels (e.g. those in devtest);model[]formspec elementgltf:multi_trackentity: Punch to toggle one animation, right-click to toggle the other.