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

Switch to single animation mixer #126

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

memelotsqui
Copy link

@memelotsqui memelotsqui commented Aug 10, 2022

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

@memelotsqui 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant