Thread: osg Sequence
View Single Post
  #4  
Old 08-31-2011, 09:11 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Support for controlling osg::Sequence nodes is in the latest version of Vizard (4.02). Here is some sample code:

Code:
import viz
viz.go()

model = viz.add('sequence.ive',pos=(0,1.5,4))

osg = viz.add('SceneGraphTools.dle')
sequence = osg.Sequence(model)

import vizact
vizact.onkeydown(' ',sequence.setMode,vizact.choice([sequence.PAUSE,sequence.RESUME]))
vizact.onkeydown('r',sequence.setMode,sequence.START)
vizact.onkeydown('1',sequence.setFrame,50)
And here is the help print out of the sequence control class:
Code:
class Sequence(object)
 |  Methods defined here:
 |  
 |  __init__(self, node, name='')
 |  
 |  getBegin(self)
 |      Get the begin frame
 |  
 |  getClearOnStop(self)
 |      Get whether to show no children after stopping
 |  
 |  getEnd(self)
 |      Get the end frame
 |  
 |  getFrame(self)
 |      Get the current frame
 |  
 |  getFrameCount(self)
 |      Get the number fo frames
 |  
 |  getFrameTime(self, frame)
 |      Get the time for the specified frame
 |  
 |  getLoopMode(self)
 |      Get the sequence loop mode
 |  
 |  getMode(self)
 |      Get the sequence mode
 |  
 |  getNumRepeats(self)
 |      Get the number of repeat times
 |  
 |  getSpeed(self)
 |      Get the sequence speed
 |  
 |  getSync(self)
 |      Get whether to sync frames with frame time
 |  
 |  iterFrameTimes(self)
 |      Returns iterator that yields frame time values
 |  
 |  setBegin(self, begin)
 |      Set the begin frame
 |  
 |  setClearOnStop(self, clearOnStop)
 |      Set whether to show no children after stopping
 |  
 |  setEnd(self, end)
 |      Set the end frame
 |  
 |  setFrame(self, frame)
 |      Set the current frame
 |  
 |  setLoopMode(self, mode)
 |      Set the sequence loop mode
 |  
 |  setMode(self, mode)
 |      Set the sequence mode
 |  
 |  setNumRepeats(self, repeats)
 |      Set the number of times to repeat
 |  
 |  setSpeed(self, speed)
 |      Set the sequence speed
 |  
 |  setSync(self, sync)
 |      Set whether to sync frames with frame time
Reply With Quote