View Single Post
  #2  
Old 01-11-2016, 06:11 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Take a look at the viztask documentation in the reference and tutorial sections of the Vizard Help. You can wait for the walk action to finish before changing the avatar's visibility:

Code:
import viz 
import vizact
import viztask
 
viz.setMultiSample(4)                     
viz.go() 
viz.MainWindow.fov(70) 
viz.MainView.setPosition(0,3,-5.9) 

male = viz.addAvatar('vcc_male.cfg') 
x=[-0.65, -0.1, -0.65, -0.1, -0.66] #x-stores the position of all points in xdirection here i have given only little data 
y=[5.86, 5.89, 5.77, 5.79, 5.68]#lly for y 
walkspeed=[1.39,1.38,1.5,0.8,0.6] 

def walkAvatars(): 
	yield viztask.waitKeyDown('m')
	for i in range(len(x)): 
		walk=vizact.walkTo([x[i],0,y[i]],walkSpeed=walkspeed[i])
		yield viztask.runAction(male,walk)
		if i==3: 
			male.visible(viz.OFF) 

viztask.schedule( walkAvatars() )
Reply With Quote