View Single Post
  #6  
Old 07-02-2014, 04:02 AM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
Hi,
Thank you for your kind and patience reply. I really feel helpful with the knowledge what you provide

Here i included my code and problem i face,
face=avatar.face('pradeephead_black.vzf')
BLINK_MORPH_LEFT = 0
BLINK_MORPH_RIGHT = 1
ANGRY=3

#Action that will animate blink closing
close_eye_left = vizact.morph(BLINK_MORPH_LEFT,1,0.1)
close_eye_right = vizact.morph(BLINK_MORPH_RIGHT,1,0.1)
closing_eyes = vizact.parallel(close_eye_left, close_eye_right)
#Action that will animate blink opening
open_eye_right = vizact.morph(BLINK_MORPH_RIGHT,0,0.1)
open_eye_left = vizact.morph(BLINK_MORPH_LEFT,0,0.1)
opening_eyes = vizact.parallel(open_eye_left, open_eye_right)
#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, closing_eyes, opening_eyes, viz.FOREVER )
#Add blink action to avatar
face.addAction(blinkAction,0)

ANGRY=3
angry=vizact.morph(ANGRY,1,0.8)
neutral=vizact.morph(ANGRY,0,0.8)
wait=vizact.waittime(vizact.randfloat(1,5))
action=vizact.sequence(wait,angry,neutral,viz.FORE VER)
face.addAction(action)
This is my code where i need the avatar blink action for the entire session. while i can add some other morphs in-between when ever i need in my code in some functions.

Thank you,
Regards,
Pradeep Raj
Reply With Quote