Open topic with navigation
<vizact>.onPathEvent
Registers a function to handle animation path events
<vizact>.onPathEvent( |
|
path |
name |
func |
*args |
) |
|
path
Animation path object
name
Name of animation path event
func
The function to call when the path event is triggered
*args
Arguments to pass to the function
Remarks
When the specified event name is triggered on the animation path, the given function will be called.
Return Value
A
vizact.EventFunction object with the following methods:
<event>.setEnabled(val) | Enable/Disable the event function. The associated function will not be called while the event function is disabled. viz.TOGGLE can be used to toggle the state. Event functions are initially enabled. |
<event>.getEnabled() | Get the enabled state of the event function. |
<event>.remove() | Permanently unregister the event function. |
Example
# Create event when end of path is reached
path.addEventAtEnd('end')
# Register callback when end is reached
def onEndReached():
print('end reached')
vizact.onPathEvent(path, 'end', onEndReached)
See also