Best way to use additive animations effectively

@Panuchka, your question seems generic to the creation process, but since you are posting on the Babylon forum, I assume you want to use this on a character in Babylon. Typically, what you are talking about is layering animation clips. If you can imagine a layer stack of animation clips where clips at a higher level override the values of all clips below them, this is what you need to create.

So if you want to have a walk animation that you can play a hand wave animation during, and then go back to the walk animation, you need to have animation key data on only the arm. This means it doesn’t really matter what pose you animate your wave on, but you need to have no key data on any other bone in the skeleton. Even a single key at a T-pose would be enough to override any data on a lower layer.

You could potentially use our animation blending feature to accomplish this, but you need to remove any animation data on any bone unaffected by the wave so that you don’t blend your walk into a waving T-pose. We are currently working on some features around animation blending, but it won’t be available for a while. However, know that we are looking at how to make these systems easier to make and manage.

2 Likes

Thank you for the reply!

Still a bit curious how this works… Yes I am creating this game using Babylon, and my new character model does have a walk/run/idle animations with an eye iris movement as a test animation. I use Mixamo to provide me with the main animations, then I created another one for the eye movement. The problem is that I had to manually reset the pose of the other bones to make the model t-pose, and I don’t know if this is the way.

I can send you the glb file if you would like to check it out real quick or so :smiley:

Seems to work pretty ok though, but I wonder why the t-pose resetting is not effecting the idle animation
prettygood

I would say that the pose of the character does not matter for animating only a portion of the skeleton - the eyes in this example. The big take away is that you don’t want to have any other animation data on the skeleton. This means if you blend the two animations and set the weight of the blend to the eyes, you will retain the original body animation from your first clip and then replace the eyes animation with the second clip. The reason is that you are playing both animations simultaneously, but the clip with the most weight in the blend will replace the animation of the other. So if there is no animation data to replace the first clip, the animation from the first clip will be visible on those bones.

1 Like

I tried to create two extra additive animations to test if I can easily pull them off:

  • One extra animation for eyes, where they smirk a bit (one frame pose)
  • One animation to wave hand at

I can’t get them to work properly as additive animations… The wave animation is bugging out even though it looks pretty nice in babylon sandbox. And same problem with the smirk eye animation, I tried to get it to play but it doesn’t work at all… I created a playground to illustrate this problem:

Could you take a look and suggest some improvements?

@Panuchka, can you share your character glb or blend file with me? I need to look at it to understand what’s going on both on the code side and on the input side. Thanks!

1 Like

You should be able to get the glb here: https://dl.dropboxusercontent.com/s/x3fv1jbpqc4lg7x/character-1-test.glb?dl=1

I’ll pm you the blend file!

1 Like

@Panuchka, I see what’s going on here and it has to do with the export to glb. I made one change to your scene where I changed the wave animation from an additive blend to a linear interpolation and it shows us what is happening. I see in your .blend file that you only have keys on the arm for waving but that is not what is exported. In the export process, additional keys are being added for bones that have no keys on them in authoring, resulting in a mess if you try to blend the animations. I am not primarily a Blender user, but maybe @PirateJC or @JCPalmer may know a workaround for this.

But this also may be a limitation of the glTF specification. [It states how keyframes should be stored] (glTF™ 2.0 Specification), but I don’t see any information pointing to a necessity to have keyframes on every bone in the hierarchy. Maybe @bghgary can weight in about that.

2 Likes

Thank you so much for looking into it!

Really looking forward the input from others on this! I/You can always invite people to the private conversation where I shared the .blend file.

My plan for this model is the following:

  • Have a character model with changeable clothing.
  • Have one rig that is the “truth”.
  • I can easily retarget mixamo animations to the rig (using autorig pro for the rig and retarget, works really well).
  • I can easily make own (mostly additive) animations (this is a problem now!)
  • I can easily make facial poses for emotion animation (this is a problem now!)

I’m really lost on how to do the last two points properly now, since it is funny that in Blender everything looks fine and dandy, and the export seems to have a mind of it’s own…

One thing that is confusing is how the NLA (non linear animation) tracks are defined in the glb/gltf export. Since isolating the tracks does matter to the end result. In this youtube video, it is shown that the animation tracks are like photoshop layers basically, each effecting other one.

Also found this thread in Blender forums when I was banging my head to the wall, but not sure if it is related.

Maybe it helps to uncheck “always sampled animation” when exporting gltf in blender, so deform bones without keyframes stays empty.

1 Like

Not sure if this is the correct solution, unless I start making horror games :smiley:
horrorterror
This image is taken from the sandbox viewer

1 Like

If you are going to uncheck sample animations, I’m guessing you will have to prevent overlapping animation actions in the non-linear animator. Since you had group animations by NLA track enabled, you were getting discreet animations before with sampling enabled. You might try just sliding the animation clips in the NLA so there is no overlap. The animation groups should still separate the animations and not sampling the animations could prevent baking keyframe data on bones that should not have any.

My main question at this point would be does grouping by NLA track only write animations for frames that have data or does the timeline always start at the first frame meaning you will have blank data in each one. I’m guessing that it will only export the animation data, but I am not sure. If you do end up with extra data, you can always edit the start and end frames in the targeted animations in each group.

1 Like

I just play an one-time animation (i.e. weapon reload, rifle fire) over my continous animation (like pose, walk, run, idle), but would be open for suggestions, because i did not find another solution and this might be not the best way. Dunno why it works, but I neither set isAdditive-flag or use MakeAnimationAdditive-function.

1 Like

Tried to do this but it didn’t seem to have any effect on the result. I guess it is the same than not putting a checkmark on these:
image

Which are “Do channels contribute to result”…

Yeah, I try to utilize these to make some “emote” functions in my game, such as waving. These emotes, if possible, should be available on top of regular animations, such as run or idle.

Tried to redo the arm wave animation since last time I used partially Mixamo wave animation and tried to cut parts of it away to make it more additive.
problem
So I basically moved one ik bone here…

problem23
And the final result in game is this…

Also tried to do the same with Mixamo wave and same result when I try to apply the additive animations…
problem235

Really clueless on what to do at this point…

This is due to the fact that we have two animation modes in Babylon for blending between clips. One is linear interpolation and the other is additive. What you want is an animation override when playing multiple clips where we are replacing the keyframe date on the base animation with animation from another clip instead of playing a mix of the two.

We know this method is missing and we need to make an update to the animation blending modes for this to work and are actively working on some animation features that should remedy this issue.

1 Like

Ok understood! I will work on some other stuff in the meantime then :slight_smile: Do you have any estimate on when the feature would land? I am more than eager to test if there is a need :grin:

1 Like

This is part of a large feature we are working on for 6.0. The entire feature won’t be ready until later in the production cycle, but additions to animation blending will likely come in earlier. I don’t have a window for you as we release things when they are ready, but know that this type of expansion for the animation systems will be higher on the priority list to push out.

3 Likes

hey @PatrickRyan ,

is there a place we can look at the planned animation system for the v6 ? thanks!

(by look, I mean, just read the spec)

@feuerstein, we don’t have any plans pushed publicly yet. We are in the early stages of prototyping this work before we fully define what will ship in 6.0. Unfortunately, I don’t have a clear answer for what that will be at this point.

1 Like

Waiting for the moment my character can finally wave their hand proper way :wink:

1 Like