![]() |
|
#1
|
|||
|
|||
|
Vizard tech tip: Blinking Avatars
Vizard's vcc avatars come with morph targets for blinking, eyebrow raising, and talking. Check out the following snippet of code to get your avatars to blink.
Code:
import viz
viz.go()
female = viz.add('vcc_female.cfg', pos = [0,.3,1], euler = [180,0,0])
female.state(1)
#Blink morph ID of avatar
BLINK_MORPH = 0
#Action that will animate blink closing
close_eye = vizact.morph(BLINK_MORPH,1,.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 )
female.addAction(blinkAction)
Code:
EYEBROW_MORPH = 1 Code:
female.addAction(blinkAction, pool = 1) |
|
#2
|
|||
|
|||
|
Thanks very much.
One oddity...the manual does not mention that morph has a 3rd argument. What does this third argument mean? |
|
#3
|
|||
|
|||
|
Here is what the manual page for <node3d:face>.morph says....
<node3d:face>.morph Set the percentage of a morph <node3d:face>.morph( num percent ) ...see the first number is num, the second is percent and their is no third argument specified. I'm finding that when I delete your 3rd argument, I get an error. |
|
#4
|
|||
|
|||
|
Ah, I've answered my own question....
The third argument appears to be a speed related argument. 0.1 is a fast blink. 0.9 gives us a very slow blink. (I determined this by trying the code verbatim above....I first tried it on my own code and I am not getting good results). |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 11:13 AM |
| problem with exporting avatars and using them in Vizard | VDong | Vizard | 2 | 02-23-2009 01:25 AM |
| Vizard tech tip: Text to Speech | Jeff | Vizard | 1 | 01-15-2009 09:39 PM |
| animating built-in vizard male and female avatars | vAlexia | Vizard | 2 | 09-19-2006 01:06 PM |
| changing the color of Shirt of Vizard Avatars | Amit | Vizard | 2 | 09-02-2005 08:00 AM |