Animation blending is a power way of synthesizing various behaviors for a character from a small set of example animations.
For example, if we have a walking animation and a running animation, we can average the two animations together to form another animation that has the character jogging.
SmartBody system already comes with several different sets of animation data that can be used as animation blend. To make it easier to integrate with different character, these animation data are organized into behavior sets which represent different actions such as locomotion, jumping, and etc. Although it is possible for a user to define his own animation blend using custom data, this tutorial is focused on how to make use of existing behavior sets in SmartBody. Setting up an animation blend and behavior is a complicated task that requires some programming efforts. Thus it is only recommended for advanced users.
To apply a behavior set on a character, we can use the following scripts :
scene.addAssetPath("script", "behaviorsets") # add search path for behavior set # locomotion scene.run('BehaviorSetMaleMocapLocomotion.py') setupBehaviorSet() retargetBehaviorSet('ChrBrad', 'ChrBrad.sk')
The first is to add a script search path for the behavior setup scripts. Then we simply run the setup script for 'MaleMocapLocomotion' behavior and call its corresponding Python procedure to setup and retarget the behavior set on the character. The whole process of retargeting is automatic, and the user only needs to provide the character name and his corresponding skeleton.
Once the locomotion behavior is set up, we can play with this behavior via Blend Viewer by selecting Window->Blend Viewer from menu. Once you open the Blend Viewer, it should look like the image on the left. First, make sure we select Run Time Editor tab. Then select mocapLocomotion from the list, and press Run button, as shown on the right image.
You should see a 3D control in the Blend Viewer. This is the 3D parameter control for the locomotion. You can drag the bar on X-axis to adjust the character's moving speed and Y-axis to adjust the turning speed. During adjustment, you will see the character starts walking around. You can play with these parameter values to have the character walk in different speed and navigate the environments.
Another behavior set we can add is Jumping. It can be added in a similar way like locomotion by using the corresponding setup script for jump behavior.
# jump scene.run('BehaviorSetJumping.py') setupBehaviorSet() retargetBehaviorSet('ChrBrad', 'ChrBrad.sk')
Once the jump behavior is set up, select 'Jump' in the Blend Viewer and run it. Similar to controlling the locomotion, the jumping can be adjusted by setting the parameters in different axis. Here X-axis is jumping distance, Y-axis is jumping height, and Z-axis is jumping direction. We can apply different parameters to have the character jump around in the environment.
Attachments:














