Vizard 8 » Command Index » Vizard modules » viztask » <viztask>.waitAnimationEnd
8.0

<viztask>.waitAnimationEnd

Wait for an avatar animation to end

<viztask>.waitAnimationEnd(  
node  
animation  
)  
node
The avatar that is executing the animation.
animation
The animation number to wait for.

Remarks

This command will create a Condition object that will wait for the specified animation to finish executing on an avatar. This command does not execute the animation, the user must manually do that.

Return Value

viztask.Condition object

Example

import viztask

male = viz.add('vcc_male.cfg')

def MyTask():

    while True:

        yield viztask.waitKeyDown(' ')

        #Execute animation with no delay out
        male.execute(7,delay_out=0.0)

        #Wait for animation to complete
        yield viztask.waitAnimationEnd(male,7)

        #Set animation state with no delay
        male.state(8,delay=0.0)

        #Restore standing pose after 1 second
        yield viztask.waitTime(1)
        male.state(1)

viztask.schedule( MyTask() )