View Single Post
  #6  
Old 08-26-2005, 02:47 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

If your code is inside a director function and you call waittime, then it will wait for the specified amount of seconds. The following sample demonstrates this. Run the script and press spacebar to start the director function.
Code:
import viz
viz.go()

male = viz.add('male.cfg')
male.translate(0,0,5)

def PerformAction():
	male.act(2)
	viz.waittime(male.getduration(2))
	print 'Action finished'

def onkeydown(key):
	if key == ' ':
		viz.director(PerformAction)

viz.callback(viz.KEYDOWN_EVENT,onkeydown)
Reply With Quote