View Single Post
Old 09-06-2007, 11:00 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The avatars that comes with Vizard don't contain any blinking animations or morph targets. If you created your own avatar using 3dsmax then you could add a blink morph to the avatar and control this within your script. Here is some sample code that shows how to make an avatar blink using a morph target:
avatar = viz.add('avatar.cfg')

#Blink morph ID of avatar

#Action that will animate blink closing
close_eye = vizact.morph(BLINK_MORPH,1,0.1)

#Action that will animate blink opening
open_eye = vizact.morph(BLINK_MORPH,0,0.1)

#Action that will wait 1-5 seconds
wait_blink = vizact.waittime(vizact.randfloat(1,5))

#Action that will blink indefinitely
blinkAction = vizact.sequence( wait_blink, close_eye, open_eye, viz.FOREVER )

#Add blink action to avatar
Reply With Quote