WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 37 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-25-2007, 09:41 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The blink name must be a string, and you must apply the action to the face object. Here is a sample script:
Code:
import viz
viz.go()

face = viz.add('biohead_all_morph.vzf')
avatar = viz.add('female.cfg', pos=(0,0,1), euler=(180,0,0))
avatar.setFace(face)

#Blink morph ID of avatar
BLINK_MORPHL = 'blinkL'
BLINK_MORPHR = 'blinkR'

#Action that will animate blink closing
close_eyeL = vizact.morph(BLINK_MORPHL,1,0.1)
close_eyeR = vizact.morph(BLINK_MORPHR,1,0.1)

#Action that will animate blink opening
open_eyeL = vizact.morph(BLINK_MORPHL,0,0.1)
open_eyeR = vizact.morph(BLINK_MORPHR,0,0.1)

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

#Action to close/open both eyes
close_eyes = vizact.parallel(close_eyeL,close_eyeR)
open_eyes = vizact.parallel(open_eyeL,open_eyeR)

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

#Add blink action to face
face.addAction(blinkAction)
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC