#1
|
|||
|
|||
STOP_EVENT format
This code works in Viz2:
def FinishedMoving(object,type): if type == viz.MOVE: i = 1 viz.callback(viz.STOP_EVENT,FinishedMoving) but Viz 3 gives this error: TypeError: FinishedMoving() takes exactly 2 arguments (1 given) What modification is required to make it work in Viz3? |
#2
|
|||
|
|||
Many of the events in have been changed to provide Data object as arguments which have various atributes about the event. To see what atributes an object in python has call
print dir(object)
__________________
Paul Elliott WorldViz LLC |
#3
|
|||
|
|||
The stop event has these attributes:
action instance object pool I think you want to compare the "action" atribute to vizact.VizMove. Try printing the varioius atributes to see what you should compair to.
__________________
Paul Elliott WorldViz LLC |
#4
|
|||
|
|||
For others who might have this question, the Viz3 way to find out if
an object has stopped moving (goto or spinto) is: Code:
import viz viz.go() ground = viz.add('tut_ground.wrl') ground.addAction(vizact.spinto(0,1,0,90,90)) def FinishedMoving(e): if e.object == ground: print 'done' viz.callback(viz.ACTION_END_EVENT,FinishedMoving) |
|
|