Thread: ControlPoint
View Single Post
  #1  
Old 04-17-2014, 09:19 AM
fabioped fabioped is offline
Member
 
Join Date: Feb 2013
Posts: 21
Wink ControlPoint

Hi!

I'm using controlpoints a lot, and i'm having a bit of trouble with:

- How to know if an animationpath has ended? how to wait for it?
- Why isn't scale in controlpoints working in Vizard5?

Here's the sample code from the documentation:
Code:
import viz, vizact, viztask
viz.go()

viz.add("piazza.osgb")
model = viz.add('milk.osgb',pos=(0,1.5,4), scale=(0.01, 0.01, 0.01, ))
path = viz.addAnimationPath()

#Add control points to the path, along with their time stamp.
path.addControlPoint(0,pos=(2,1,5),euler=(90,0,0),scale=(2,2,2))
path.addControlPoint(3,pos=(-2,1,6),euler=(0,90,0),scale=(.5,.5,.5))

#Loop the path in a swinging fashion (point A to point B to point A, etc.).
path.setLoopMode(viz.SWING)

#Add a model.
ball = viz.addChild('beachball.osgb')

#Link the model to a path.
link = viz.link(path,model)

#Play the path.
path.play()
Thanks!!
Reply With Quote