Blending Motions

Basics

Golaem Crowd allows to easily blend several motions together.

There are two ways blending can happen:

Motion / Locomotion Behaviors in Parrallel
(can be in the same
Parrallel Operator, or in different containers embedded in a parallel operator)

Sequence between two Motion / Locomotion Behaviors

(see the Animation Transitions for an accurate transition)

Blending Modes

Interpolated Blend Mode

The Interpolated Blend Mode performs blending as classically used in animation, e.g. it consists in performing an interpolation between several animations:

Interpolated Animations Input/Configuration
Main Blend Pass Output Animation

A-Stance
Interpolated Blend Mode

Waving T-Animation
Interpolated Blend Mode

Average Waving Animation
 

All behaviors in Interpolated Blend Mode are blended during the Main Blend Pass (see details below)

Additive Blend Modes

The purpose of additive blend is to easily create animation diversity on-the-fly on top of the main animation. It consists in adding all the orientations of a given animation to the animation produced by the Main Blend Pass: for each character bone, the orientation contained in the additive animation is added to the orientation contained in the reference animation. The Additive Blend Mode (Posture & Variations) then accumulates all the orientations:

Main Blend Pass Output Animation
Additive Animations Input/Configuration Additive Blend Pass Output Animation

A-Stance
 

Waving T-Animation
Additive Blend Mode – Posture & Variations

Waving V-Animation
 

Accumulating orientations can lead to unexpected animation postures whereas sometimes, only the orientations variations are interesting and should be added to the animation produced by main blend pass. When using the Additive Blend Mode (Variations Only), only the orientations variations of the animation (relative to the animation average frame) are added:

Main Blend Pass Output Animation
Additive Animations Input/Configuration Additive Blend Pass Output Animation

A-Stance
 

Waving T-Animation
Additive Blend Mode – Variations Only

Waving A-Animation
 

Mixing Different Blend Modes

At each frame, the animations used on a character through Motion Behaviors are applied according to a 2-pass algorithm:

  1. Main blend pass. First the current frame of all the animations setup in "interpolated" blend mode are interpolated and blended together, resulting in an "average" mix of those animations (classic animation blending), that can be controlled  more accurately using priorities and weights. Concretely, the orientation of each character bone is the result of a weighted interpolation between the orientations of this bone in each input animation (e.g. the resulting bone orientation is kind-of an average of all the animations bone orientations).
     
  2. Additive blend pass. The current frame of each animation setup in "additive" blend mode is then added, according to the additive blend ratios configuration. Concretely, the orientation of a character bone in each input animation is added to the character bone orientation (e.g. the resulting orientation is a sum of all the animations bone orientations).
Input Animations Set
Main Blend Pass Main Blend Pass Output Additive Blend Pass Additive Blend Pass Output
Interpolated Animation

 


 

 


Interpolated animations
blended together

 

 

 

 

 

 


 

 

Additive Animation added to
Main Blend Pass Output Animation

Interpolated Animation
Additive Animation

Notice that a Locomotion Behavior is considered as an interpolated Motion Behavior, e.g. the animation produced by the locomotion algorithm will be treated in the main blend pass.

Examples

Interpolated Blend Mode

The purpose of the Interpolated Blend Mode is to easily create transitions different between motions. Of course these transitions could be designed manually by animators, but this is time consuming and would only allow transitions at some given points in time which makes creating diversity in behaviors complicated. Being able to automatically compute a transition from one motion to another at any time is what enable to start motions with random offsets, or trigger them at any time.

Although automatic transitions seems like magic, the Interpolated Blend Mode will not create motions for you. If you need to create a transition from a sit character to a standing one, providing only a sit and a stand motion will lead to a poor result. However the Interpolated Blend Mode will enable you to easily transition from your sit motion to a stand up motion with bothering about when you do this transition.

For instance, consider the following animations:


Sit animation

Sit to Stand victory animation

The Interpolated Blend Mode will enable to blend these animations together at any point in time, based for example on an external event (goal!!! or mexican wave).


Output of Interpolated Blend Mode
(for a sequence of these two motions, 

sit animation being stopped after 12 frames)

NB: for the blend to happen correctly and the root of your character effectively moving up, all conditions for a correct ground adaptation must be met.

Additive Blend Mode (Variations Only)

The purpose of the Additive Blend Mode (Variations Only) is to easily introduce diversity on crowds. For instance, instead of having all characters playing the same animation, they could each play this animation with a slight variation: this variation can be setup using an additive animation with different configurations (random start percent, random speed ratio, random animation ratio …). This mode aims at just adding variations to the animation resulting from the main blend pass, not to change the nature of this animation. As only variations in the animation are taken into account, animations of any kind can be used in this mode, as long as it only contains small variations (in particular on pelvis and legs). Best candidates for Additive Blend Mode (Variations Only) are animations such as breathing, standing and swing/sway animations, for instance:


A weapon-up stand animation

If applied in Additive Blend Mode (Variations Only), this kind of animation preserves the nature of the animation produced by the main blend pass, introducing some diversity in the resulting motion:


Output of main blend pass
 

Output of additive blend pass after playing
weapon-up stand animation in additive blend mode

Additive Blend Mode (Posture And Variations)

One of the main purposes of the Additive Blend Mode (Posture & Variations) is to easily animate separate body parts if using a set of animations properly prepared. For instance, a set of main animations (such as standing, walking ..) can be setup without animation on the hands or the face, and then another set of animations containing only animations on the hands or the face can be designed separately: the Additive Blend Mode (Posture & Variations) can then be used to control when to play animations on the hands or the face, independently from the other main animations controlling the rest of the body.

Notice that this design by animation layers can also be achieved using the standard Interpolated Blend Mode, but as it requires to properly configure body mask attributes and priorities/weights on each MotionBehavior, this can be a very complex and painful task when using a substantial count of animations.

Also notice that when preparing animations, a specific set of animations that only contains breathe/sway variations can also be designed: when played in Additive Blend Mode (Posture & Variations), they will then result in the same way that if used in Additive Blend Mode (Variations Only).

For instance, if considering the following animations:

 

Stand animation
(on full body except hands)

Breathe animation
(only on spine, arms and head)

Clench Fists animation
(only on hands)

Playing the Stand posture in Interpolated Blend Mode with both Breathe and Clench Fists animations in Additive Blend Mode (Posture & Variations) will then result in a kind of Stand Nervous animation (without needing to configure body masks):


A stand nervous animation

If now considering several characters, Breathe and Clench Fists animations can be configured with some randomness (in attributes such as Speed Ratio, Start Percent or Additive Blend Ratio, and also directly in Behavior Graph with random delays) to obtain a different and unique animation for each character:


Several characters each playing a stand nervous animation

Fine-Tuning Blending

Timing

Parrallel Behaviors

When blending Motion/ Locomotion behaviors in a parallel node, blending will happen if/when several behaviors are active at the same time. 

Of course, when blending happens, motions are blended together relatively to the weights and priority attributes (see below).
A fade-in / fade-out also happens for each behaviors, depending on their starting/stopping durations.

If we consider the three behaviors from the Parrallel Operator above, the following graph shows how they influence the result of blending depending on their triggers and start/stop durations.

Sequence Behaviors

Blending can also happens during the transition between two Motion / Locomotion Behaviors in sequence.

In this case, the blending duration will be ( Motion 1 stop duration + Motion 2 start duration) / 2

When dealing with with motions or locomotion in sequence, it's advised to use the Animation Transitions if one wants to fine tune the transitions.

Behavior Time Triggers & Blending

As you can see from the above cases, a Motion / Locomotion Behavior still is still active during the stopping duration after the stop trigger is activated.

It means that if you want to play a motion exactly once, setting a Behavior Time Trigger to 100% and keeping the default stopping duration (0.4s) will not work. It will actually play the motion 100% + 0.4s.

If the Motion Behavior is not set to loop, the last posture will be played for 0.4s.
However if the Motion Behavior is set to loop, it will loop back to the beginning of your motion and play it for 0.4s. It could cause a discontinuity in your animation if the motion has not been created to loop.

There are three solutions:

  • disabling Loop on the Motion / Locomotion Behavior. The last posture will still be played, but depending on your use case it may not be a problem.
  • setting the stopping duration to 0. The Motion / Locomotion Behavior will stop at once (but as no blending will happen the transition can be harsh)
  • setting the Behavior Time trigger to 100% -0.4s (depending on the stop duration) in order to activate the stop trigger while a part of the motion is still available to be played during blending

Priorities, Weights & Ratios

Interpolated Mode: Priorities and Weights

Priorities and weights can be configured to handle animation concurrency and control accurately the interpolated blend. For instance, considering the following configuration for the 2 interpolated animations in the previous example:

Priorities/Weights Configuration Main Blend Pass Output Animation
A-Stance priority is higher than Waving T-Animation priority
A-Stance
A-Stance priority is equal to Waving T-Animation priority
A-Stance weight is 0.75
Waving T-Animation weight is 0.25

75% of A-Stance
25% of Waving T-Animation
A-Stance priority is equal to Waving T-Animation priority
A-Stance weight is equal to Waving T-Animation weight

50% of A-Stance
50% of Waving T-Animation
A-Stance priority is equal to Waving T-Animation priority
A-Stance weight is 0.25
Waving T-Animation weight is 0.75

25% of A-Stance
75% of Waving T-Animation
A-Stance priority is lower than Waving T-Animation priority
Waving T-Animation

Additive Blend Mode: Ratios

Additive blend ratios can be used to accurately control the amount of animation added. For instance, considering the following configuration for the additive animation in the previous example setup in Additive Blend Mode (Posture & Variations):

Main Blend Pass Output Animation
Additive Animations Input/Configuration Additive Blend Pass Output Animation

A-Stance

Waving T-Animation
Additive Blend Ratio is 0.0

A-Stance

Waving T-Animation
Additive Blend Ratio is 0.5

A-Stance
Added 50% of Waving T-Animation

Waving T-Animation
Additive Blend Ratio is 1.0

A-Stance
Added 100% of Waving T-Animation

Waving T-Animation
Additive Blend Ratio is 1.5

A-Stance
Added 150% of Waving T-Animation

Warning:

For each body part, the amount of animation added is in fact the value of the Additive Blend Ratio divided by the number of additive animations currently in use on this body part (e.g. the number of MotionBehaviors configured in additive blend mode, using this body part and currently running), as shown below:

Main Blend Pass Output Animation
Additive Animations Input/Configuration Additive Blend Pass Output Animation

A-Stance

Left Waving Animation
Additive Blend Ratio is 1.0

A-Stance
Added 100% of Left Waving Animation

Right Waving Animation
Additive Blend Ratio is 1.0

A-Stance
Added 100% of Right Waving Animation

Left Waving Animation
Additive Blend Ratio is 1.0

Right Waving Animation
Additive Blend Ratio is 0.0

A-Stance
Added 50% of Left Waving Animation

Left Waving Animation
Additive Blend Ratio is 0.0

Right Waving Animation
Additive Blend Ratio is 1.0

A-Stance
Added 50% of Right Waving Animation

Left Waving Animation
Additive Blend Ratio is 1.0

Right Waving Animation
Additive Blend Ratio is 1.0

A-Stance
Added 50% of Left Waving Animation
Added 50% of Right Waving Animation

Left Waving Animation
Additive Blend Ratio is 2.0

Right Waving Animation
Additive Blend Ratio is 2.0

A-Stance
Added 100% of Left Waving Animation
Added 100% of Right Waving Animation

Left Waving Animation
Additive Blend Ratio is 1.0
Body Mask set on Left Arm only

Right Waving Animation
Additive Blend Ratio is 1.0
Body Mask set on Right Arm only

A-Stance
Added 100% of Left Waving Animation
Added 100% of Right Waving Animation