Quote:
Originally Posted by Jeff
I tested this code with the vcc_female avatar included with Vizard and it alternates between two animations. Does that work for you?
|
Hi,
Thank you for your reply! I tested the codes below:
Code:
def ani_change():
female1 = viz.add('vcc_female.cfg')
female1.setPosition(1,0,10)
female1.setEuler(90,8,0)
bloNo = 10
Code = [0,1,0,1,0,1,0,1,0,1]
for block in range(bloNo):
female1.visible(viz.ON)
if Code[block] == 0:
female1.execute(2,0,0,freeze = True)
female1.setAnimationSpeed(2,0)
elif Code[block] == 1:
female1.execute(11,0,0, freeze = False)
yield viztask.waitTime(3)
for j in range(10):
female1.blend(11,1-float(j/10))
female1.blend(2,float(j/10))
yield viztask.waitTime(float(j/2))
yield viztask.waitTime(0.5)
female1.state(2)
female1.visible(viz.OFF)
yield viztask.waitTime(5)
viztask.schedule(ani_change())
So what I expect in this case is that the female avatar stops then run for a while then stop again, which means she should switch between running and stop for five times. However, in this case she just runs then stops.
So how can I amend the codes to achieve my goal?