Vizard 7 » Command Index » Vizard objects » animationpath » <animationpath>.addEventAtTime
7.6

<animationpath>.addEventAtTime

Trigger event when time is reached

<animationpath>.addEventAtTime(  
name  
time  
)  
name
Name of the event. This can be any string which will be assigned to the name attribute of the viz.PATH_EVENT event object.
time
The number of seconds from the start of the path.

Remarks

This command will add an event to the path which will be triggered when the path reaches the specified time (in seconds) from the start. The time should be between 0 and <animationpath>.getDuration. The event will be triggered on every loop.

A viz.PATH_EVENT will be triggered with the specified event name and animation path.

Return Value

None

Example

# Create event when at 3 seconds
path.addEventAtTime('second_3', 3.0)

# Register callback when path is 3 seconds from start
def onThreeSeconds():
    print('3 seconds from start')
vizact.onPathEvent(path, 'second_3', onThreeSeconds)

See also

<animationpath>.addEventAtControlPoint
<animationpath>.addEventAtDistance
<animationpath>.addEventAtEnd
<animationpath>.clearEvents
<animationpath>.removeEvent
<vizact>.onPathEvent
<viztask>.waitPathEvent
viz.PATH_EVENT