Getting duplicated armatures when exporting character with animation layers (Nodding and Walking)

I have been trying to export this character with NLA strips from blender with two animations, one for walking (from mixamo) and nodding (only head bone’s rotation is animated) in order to then blend these two in Babylon so we have nodding animation playing while walking.
One of the issues is there seem to be duplicate skeletons in playground: T-pose on top of Walking.
And they dont get blended using this code very well with the current setup
Blend file, gltf and screenshots

In short about the model setup in blender:
1- imported walking mixamo animation
2- created control rig using mixamo addon
3- added NLA strip for walking
4- duplicated armature and deleted everything except head bone and animated nodding
5- applied nod animation to the main character’s control rig and added another NLA strip

Thank you!

Alternative link to reference files

Hi Mikhail,

Welcome to Babylon! I’m no expert, but I’m not sure I understand your process for creating this model. Why did you duplicate the armature? In the (limited) rigged animation I’ve done in Blender, I’ve always applied my animations to the same armature, then just make sure they’re all selected when I export. That way they’ll all end up in the file applying to the same skeleton, and I can enable/disable the animations programmatically. Can you try re-creating your nodding animation on the original armature (not duplicating anything and not deleting any bones), then exporting with only one skeleton? If the way they’re being exported makes Babylon think there are multiple skeletons, I would expect that would negatively impact Babylon’s ability to blend between the animations, so hopefully resolving that will help get things back on track.

1 Like

Hi @syntheticmagus ,
Thank you for taking a look. As to duplicating armatures, I only duplicated it for animating the head to then apply it to the main character’s armature (something I saw online but I usually dont do that).
With these new files I didnt duplicate it and just animated the head controller but still having the same issue in the playgroung with T-pose overlaping another armature.

Hi @syntheticmagus
I fixed the duplicated bones (by exporting deform bones only) but the blending between these two animations still not working, as you can see walking animation doesnt loop when Nodding is playing even though it should. May be it is due to the fact that Nodding animation is shorter or we need to use specific blending settings? It has currently blending and additive turned on.

Thank you!

I think the export is still not doing exactly what I would expect. If you look at your model in the Babylon Sandbox, that allows you to easily inspect the model’s different attributes and isolate animations by name. From what I see there, the “Nodding” animation still has a walking motion baked into it. I don’t think that’s what you were going for; you were trying to have the walking motion and the nodding motion be completely separate so that they could be mixed together, right? If so, there’s probably still something that needs to be modified, either in the export process or in the animation itself, to make those animations fully separate so that Babylon can mix them properly.

1 Like

I can preview them separately in Sandbox only when I spread tracks apart (probably because when it overlaps since there is only head bone animated other bones get animation from the layer below). So there is T-pose with only head moving for Nod animation.

But it only works when Nodding Animation strip is at the front in NLA editor. Swapping Nod and Walk makes the rest of the bones in the nodding animation the first frame of the walk animation

Also I am not sure blending is the right term or additive for what I am trying to achieve playing both these animations at the same time on the avatar. I have both turned on in the code.

Does this seem correct now? I see in sandbox as well as PG that the animations are not overlapping

Works fine for me if I plug this into the existing additive animations example:

But I don’t really understand why it doesn’t work if I try to set up additive animation in the same way in the existing scene:

1 Like

Okay, looks the order in which you set animations to play and set their weights matters. So this works:

1 Like

Thank you so much Valentine!

:ninja: Thanks Val! :hugs: