WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-11-2011, 01:16 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
osg Sequence

Hi,

Im loading an ive file with an osg sequence that i would like to control.

Whats the best way of doing this?

I would like to be able to stop, start and set the current time of the sequence.

Thanks

TarkaDahl
Reply With Quote
  #2  
Old 08-17-2011, 09:20 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
There's currently no built-in support for this, but we will add it to a future release.

If you are familiar with C++ programming and OpenSceneGraph, you could write a Vizard extension that does this. Our SDK is freely available and contains an example for writing an extension that interacts with the underlying scene graph of a node.
Reply With Quote
  #3  
Old 08-31-2011, 06:42 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
Hi

Im having a problem with this ive been looking at the example of creating an modifier using the sdk but how do a get from the osg::Node to the osg::sequence
ive looked at the documentation here.
http://www.openscenegraph.org/docume...cs/a00654.html
and it explains functions that i need to call on the osg sequence but i cant find how to get to the osg::sequence

Sorry it that doesnt make sence. but ive not used c++ for a while and have only done the basics of OpenSceneGraph.

I will do more reading about it later but any help would be good.

Thanks

TarkaDahl
Reply With Quote
  #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
  #5  
Old 09-01-2011, 01:45 AM
TarkaDahl TarkaDahl is offline
Member
 
Join Date: Mar 2010
Posts: 59
hi farshizzo,

Thanks for that it works like a dream.

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to freeze sequence of actions dwaik Vizard 1 04-05-2010 01:26 PM
How to make character animation sequence wchoi Vizard 3 01-22-2010 08:35 AM
avatar walking over a sequence of points IGoudt Vizard 1 10-16-2009 11:22 AM
stopping a sequence durf Vizard 1 04-14-2009 01:31 PM
animation sequence pkhoosh Vizard 2 01-23-2006 08:03 AM


All times are GMT -7. The time now is 11:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC