-
Notifications
You must be signed in to change notification settings - Fork 19
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
Switch to single animation mixer #126
Open
memelotsqui
wants to merge
15
commits into
main
Choose a base branch
from
WIP-single-AnimationMixer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memelotsqui
changed the title
[WIP] - suggestion: single animation mixer
Switch to single animation mixer
Aug 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
1- Right now, using animation Mixers from Totum import is not possible, theyre not exposed, and theyre only meant to be used to play an idle animation when importing a glb file, only if it includes an animation called 'idle', if not, it plays all the animations the object has.
2- This might work for some cases were the animation clips were separated to create an idle animation, but in others it comes with a wierd looking combined animation (silsword), and often not desired (other example would be the combination of walk animation + idle animation + run animation), it would be nice to be able to decide which animation comes first.
2022-08-09.20-11-48.mp4
3- Now the problem is that multiple mixers are being created because theyre based on the 3d Object that animates first from the hierarchy, and that leads to some complex thinking when trying to animate, so just exposing all the mixers from Totum would not be a good solution either.
4- I tried to see how its being solved in other cases were animations are called, and noticed animation mixers from Totum were not being used at all:
pet.js = its creating a custom mixer, but Totum is actually making sure it doesnt create double animation mixers.
silsword = its setting the animations to false, and its actually being animated by the character
chest = its creating its own animation mixer.
5- After some research and testings, I noticed it is possible to create a single animation mixer using the Root of the scene of the glb file, this helps alot because we're no longer having mulitple mixers, and now we are actually able to "Mix" animations. So far while testing, there has been no wierd animation by setting the imported glb scene as the mixer's root, everyhting seems to be working fine. (But might as well need some more testings in this section)
2022-08-09.20-30-48.mp4
6- To keep consistency in the way it's working right now with multiple mixers, im doing a similar procedure but with only one mixer, and that is: validate if there is idle animation and play it, if not play all animations (but this time with only one mixer), this will help to avoid any undesired changes of the way apps are currently working
7- And Finally to get the most out if it, I tried making an API call in totum that lets you play animations by name/array, duration of transition and looping, this will help us alot in the future to just make the api call and decide which animations we want to play (maybe an idle combined with running, maybe just walk). This will reduce code complexity and size.
8- This is a Work in progress,I wanted to code down all the ideas and test them out to see if this worked and it seems it does, but I believe it still needs alot of testing and approval to see if its the path we're looking for :), here is a test of a few lines of how this call can be used (I used the animations from silsword, I think theyre great)
2022-08-09.20-23-11.mp4