View Single Post
  #2  
Old 06-10-2013, 05:06 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
Here's an example:
Code:
import viz
import vizact

viz.go()

viz.add('piazza.osgb')

viewNode = viz.addGroup()
viewLink = viz.link(viewNode, viz.MainView)
viewNode.setPosition([0,2,0])
spinAction = vizact.spin(0,1,0,20,viz.FOREVER)

viewNode.addAction(spinAction)

def pauseAndRestart():
	if viewNode.getAction():
		viewNode.clearActions()
	else:
		viewNode.setEuler([0,0,0])
		viewNode.addAction(spinAction)

vizact.onkeydown(' ', pauseAndRestart)
Reply With Quote