Not able to blend animation with beginWeightedAnimation

Hi there,

I am trying to blend my animation but it is not working as shown in the example

I have created a GLB file with all the animation in one animation group but they are not working

Please help me with this, thank you in advance

Hi, are you sure the weighted animations are defined correctly? What is the reason for the model to simply play all animations randomly?

all the animations are in the same clip

not what I asked :slight_smile:

Notice how the original playground is showing this when you turn off all weighted animations:

Your model’s animation definition is incorrect.

how can i correct them

i believe it has something to do with the way you are exporting it, but @PatrickRyan probably has a better answer.

@Shubham, I looked into the file and what I think is happening is that you have an animation group saved into your glTF (which should be coming from the exporter from whatever DCC tool you are using). What I believe is happening is there is a conflict between the animation groups (which automatically start playing when the glTF is loaded) and assigning new animatables to the same skeleton with beginWeightedAnimation. You could try exporting your file without animation groups and I am guessing this would solve the issue.

However, I think there may be something we need to do in engine so I am going to summon @Deltakosh as he wrote most of the animation logic and @RaananW for backup as DeltaKosh is on vacation next week. From what I debugged, the animatables are being created by beginWeightedAnimation but if there was any weight assigned in the constructor, the animation would “stop” and then dispose as disposeOnEnd was set to the default true. So basically, every time the scene would start (with animation groups stopped or even disposed) would start any animatable with weight, then immediately stop and dispose of it. Setting disposeOnEnd to false prevents the animatables from being disposed, but they never start playing. The animationStarted parameter remains false, even if the animatable is given weight in the constructor.

The scene I set up with some logging and added parameters is here but you can see in the scene below that the idle animation has weight, but the animatable thinks animationStarted is false.

1 Like

So i am using blender to export all the animation in one clip, and i am taking the animations from mixamo. how can i remove the animation groups from the gltf

Actually what i am doing is i am import this model in my web app on application start and then on runtime i am importing more models which doesn’t have animation to it they have the same armature as the one that i imported before, then i am cloning the animation from the old model and retargeting to the new ones and now i want to blend the animations in new model

assigning myself, and I hope to find time this week to check that. Otherwise we’ll wait for @Deltakosh :slight_smile:

hi @RaananW got any solution for my problem

@PatrickRyan has provided you with a solution that should be a fix on your end. What I am going to check, either today or tomorrow, is the second issue, which might be something that needs to be fixed in the framework itself. Would be great if you tried the suggestion and notified us if it worked for you.