Play Two Armature Animations Simultaneously?

Hi,

I have been using the blend animation to great effect - transitioning from walking to talking is super useful. However, there are instances where I’d like to have two or more animations playing simultaneously without blending 50/50. The reason this is a problem is if the character is speaking and walking, the animations will dilute each other; the gait of the stride will be reduced by 50% and the talking looks more like a mumble.

Anyone have any suggestions?

Cheers,
Tim

Hi,

While the current animation system in Armory is good for some basic animations, it is not flexible/ extendable to other features, like the one you want. The feature that you want is something called “bone masking”, where animations play only on certain bones and will not affect the other bones. This means the waling and talking will be played as two independent animations and will act on their respective bones. Unfortunately such feature is not available in the current release version of Armory.

However, I have developed a completely new type of animation system for armory which gives much more features, including the bone masking, blend spaces, root motion and so on. I am hoping it will be eventually be merged in the main version of armory. It is available on GitHub, and if you are willing to try/ use it, I can help you with that.

Here is an example animation made with this new animation system:

1 Like

Hi Quantum,

Thanks for getting back to me. Yes, it sounds like bone masking is what I need. Foot IK and root motion would also be nice features to have. I don’t have a programming background, but keen to give it a go if you’re still willing to share it.

I also saw you mentioned that a similar thing can be achieved just by not adding key frames to bones that aren’t necessary for the secondary animation , eg leg key frames for talking animations. I couldn’t get this to work when I tried playing two animations though.
image
Let me know if there’s a proper way to do this.

Cheers,
Tim

Hi,

This is the install instruction for the new animation system:

  1. Make a back up of the ArmorySDK folder.

  2. Replace ArmorySDK\armory with this: GitHub - QuantumCoderQC/armory at Anim_3.6

  3. replace ArmorySDK\iron with this: GitHub - QuantumCoderQC/iron at Anim

The files on GitHub can be downloaded as a zip using this:

Note that your current animation system might not work in this new version. I have had to completely refactor the old animation system. So you would have to build the animation system again using nodes. But it should be a bit more straightforward this time.

The simplest example would look something like this:
image

The issue here is that the current animation system does not allow for two animations to be played on the armature a the same time. So it is not possible.

Hi Quantum,
Thanks for this. Installed it and can see a lot of new animation nodes including foot IK, animation tree and blend actions (with bone groups) - looks awesome! It does seem to be incompatible with some of my old setup. I will see what I can get working this weekend and let you know if I have any issues. I assume there’s no official documentation for the new nodes at this point?
Cheers,
Tim

1 Like

Hi,

Good to see that the installation went okay.

Nope. There are no official documentations yet for these nodes. Although, one think I would suggest is to not use the Play Animation From node. This is just kept for some legacy support. Instead use the Play Animation Tree Node. And to switch between actions, you may use the Switch Action nodes.

Hi Quantum,
Thanks, I’ve been able to layer two animations one on top of the other. The thing that blows my mind is that it appears animations need to be stashed in the NLA editor to work. It will actually play the actions in sequence too, but you cannot do this without the ‘play animation tree’ for each action in the NLA editor.

I’m trying to make an animated cartoon episode, so having support for the NLA editor is very advantageous. I’m not sure if what I’ve said is 100% correct, but that’s what I’ve concluded from playing around with it.

Btw, what does Action ID do?

Thanks,
Tim
image

Hi,

Yes, Blender needs to export animations to Armory. It is better done by stashing actions in the NLA editor.

The way the animation nodes are designed, you only need one play animation tree node per armature object. And since you have just one armature, you need just one.

The input to the animation tree node can have a combination of animations. For example, in your case, a simple example would be like so:

Some elaboration of what is actually happening:

  • The Switch Action node switches between the two actions (Idle and Walk)with smooth blending. The transition/ blending time is the Time parameter. Here it is 1 second.

  • Action 1/ 2 are the inputs that control when the switching should occur. So when W is pressed or released, the action is switched from one to the other. Since all the bones must be in either Idle or Walk state, we choose the bone mask of -1. -1 here means no bone masking.

  • The output of this action must now be blended with the Talk animation. Since the Talk animation must be layered on top of the Idle/Walk, the node comes after the Switch Action node. I assume that the Talk action always runs. So I kept the factor 1.0 and the Bone Group at 1. This means the Talk animation overrides all the actions of the bones that belong to bone group 1. These bone groups can be set in Blender here in the Layers tab:
    image

  • As for what the Action ID’s are, they are a unique ID given to each action. This enables us to control the actions from outside the action tree itself. For example, in the above case, I have used the Restart Action node to restart an action with the ID Talk when Space is pressed.

  • For more control, you could also connect a Float tree variable node to the Factor socket in the Blend Action node and control the blending at runtime.

Hope this gives some understanding of how the new animation nodes can be used :slightly_smiling_face:

1 Like

Hi,
Thanks, that is a very clear explanation of the new nodes. I’ve managed to get my character to talk and idle before walking, but not sure the best way to time the talking blend. I was wondering if there is a way to get the blend animation to happen after a timer for example - like the way the actions are triggered for the ‘switch action’ node. See below:


Other than that, everything seems to work great! Is the animation system expected to be incorporated into the official release at some point?

Cheers,
Tim

Hi,

Nice to know it works!

You could use the switch action node for the talk action too. Just replace the Blend Action node with the Switch Action node and use the appropriate bone group. Then you can turn the talk animation on or off at any trigger.

Also, you could control the talk action using the action ID outside the animation tree. Maybe you would need to restart it, like in the image I have sent before. I am not sure as it depends on how you like to have your animation system.

1 Like

Hi Quantum,

Thanks, that works fine too. Below is my final setup:
image
The character walks, idles, then walks again. The final switch action node kicks in for the talking, but only for bones related to head and mouth movement. See gif below:
ActionSample
Appreciate all the help! I hope these nodes make it into a new release.
Regards,
Tim