Vizard 7 » Reference » Avatars » Actions that animate
7.7

Actions that Animate

There are a number of actions in the vizact module for use with avatars.  Some of these actions will take care of walking an avatar to a particular point or moving that avatar's jaw in time with a speech sound file.  You use these avatar actions just like any other action.  Vizard sets the avatar state to animation number 1 after an action completes.  To avoid this, set the avatar's idle pose to -1.  

dude = viz.addAvatar('vcc_male.cfg')  
dude.state(12) #looping idle animation
dude.idlepose(-1 ) #don't set avatar state to animation 1 when actions end
walkAction = vizact.walkTo([2,0,3])  
dude.addAction( walkAction )  # when done walking, return to looping idle
dude.addAction( vizact.animation(12) )  

The vizact.speak command plays a sound file and moves the avatar's jaw according to the file's amplitude.  When you use the speak command, you'll want to adjust the amplitude threshold above which the jaw should move, the scale of the lip-flapping, and whether or not the sound file and the lip-flapping need to be repeatedly checked for synchronization.

#Add an avatar in an idling state
male = viz.addAvatar( 'vcc_male.cfg' , pos = [0,0.3,2], euler = [180,0,0])
male.state(1)

#Create a speaking action with arguments.
speech = vizact.speak('jfk.wav', threshold = .1, scale = 0.7, sync = True)
#Add the action to the avatar
male.addAction(speech)

List of avatar actions

<vizact>.headto

<vizact>.boneSpinTo

<vizact>.morphTo

<vizact>.walkTo

<vizact>.speak

See also

In this section:

Avatar basics

Built-in animation

Bones

Avatar command table

Other sections:

Tutorial: Animating Avatar bones -- Tutorial for performing actions on objects.

Tutorial: Animating Avatars -- Tutorial for performing actions on avatars.

3D Model transform basics

Action basics

Event Reference

Example scripts:

Motions

Bones