Hi.
I have few questions related to animationGroup.
Curently I’m working on a demo with a character which should have morphtargets, and when I searched for samples or doc I saw that we don;t have too many examples related
to this, and I want to change this,… with little help. So
If uncomment line 13,14,15 it’ll stop on finish. Or it is a bug or i understood wrong.
Is there a way to reverse animation, like on beginAnimation function where if I put speedRatio -1 the the animation reverse (If i remember corect). Here doesn’t work.
If I understood well, on export, morphtargets are exported as animationGroup, and in scene I have to play with animationGroup if I want to simulate somehow morphs. Do I understood well?
If answer of question above is yes, then how I can do this?
In the same playground I tried something, line 52,53, but I’m not sure that this is ok. I think this is not working as expected.
Hey @Deltakosh, thanks for tips.
I’m trying to summarize. And maybe at the end we’ll add this info to doc.
Please corect me if I’m wrong.
AnimationGroup for gltf/glb files
The only import function which has ‘directly’ acces to animationGroup from your gltf/glb file is importMesh, where the 4th param is animationGroup. For all other functions like Load, Apend, or if we are using taskManager, we can acces it only with scene.animationGroup, or, with scene.getAnimationGroupByName
By default animationGroup is playing. So when we import a model its animations is already playing. We can avoid this using
We can reverse an animation from animationGroup with speedRatio -1, but we need to specify from and to frames (I tried without , because of this it didn’t work)
Morptargets are exported as animationGroup, so if we want to play with morph influence in our scene, we have to play with animationGroup to simulate interaction with morph. https://www.babylonjs-playground.com/#DS22WT#7
How to add events to animationGroup. Is required to add the even to each animatable from group, but do the action from event only one time, not for all animatable. https://www.babylonjs-playground.com/#DS22WT#8
One more question
6. I saw files which has skeleton and animationGroup too. (I’m talking only about gltf/glb files)
Are there situations when we can use animations from skeleton instead of animationGroup? Or for these extensions animationGroup is like a ‘must’, and it is not recomanded to use skeleton?
I’m not totally sure I understand the question, but if you mean morph targets are animated by animations which are grouped in animation groups, then yes. Each part can also be manipulated individually.
It remains the 5th question, related to this.
I want to manipulate them somehow, as example here I can use a slider and play with morph influence, but
with animationGroup how to do this?
I tried with animation weight but seems is not working very well.
This is the best way to add events to animationGroup? https://www.babylonjs-playground.com/#DS22WT#8
Or there is a better way?
I’m asking because this looks a little bit too complicate, and ‘heavy’ if I have more than 400 animatable in the animationGroup. Thanks