Hey,
great question, unfortunately I as well don't know how to implement this, but i did make my avatar yawn so if it could be of any use to you :
def makeAvatarYawn(avatar,eyes,eyebrows,mouth,isOpenin g) :
increaseFactor = 0.1
waitTimeFactor = 0.07
maxOpenTime = 0.4
maxOpen = 3
if isOpening :
eyes = eyes + increaseFactor*0.5
eyebrows = eyebrows + increaseFactor
mouth = mouth + increaseFactor
if mouth >= maxOpen :
isOpening = False
yield viztask.waitTime(maxOpenTime)
else :
eyes = eyes - increaseFactor*0.65*0.5
eyebrows = eyebrows - increaseFactor*0.65
mouth = mouth - increaseFactor*0.65
avatar.morph(0,eyes)
avatar.morph(1,eyebrows)
avatar.morph(2,mouth)
yield viztask.waitTime(waitTimeFactor)
if mouth > 0 :
viztask.schedule(makeAvatarYawn(avatar,eyes,eyebro ws,mouth,isOpening))
viztask.schedule(makeAvatarYawn(avatar,0,0,0,True) )
|